query
stringlengths
7
5.25k
document
stringlengths
15
1.06M
metadata
dict
negatives
listlengths
3
101
negative_scores
listlengths
3
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
Run the database seeds.
public function run() { //creando varias instancias de la tabla cola // $cola= new cola; //$cola->id_cola="1"; //$cola->vehiculo_id="120"; // $cola->parqueo_id="1"; //$cola->save(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function run()\n {\n // $this->call(UserTableSeeder::class);\n // $this->call(PostTableSeeder::class);\n // $this->call(TagTableSeeder::class);\n // $this->call(PostTagTableSeeder::class);\n\n /*AB - use faker to populate table see file ModelFactory.php */\n factory(App\\Editeur::class, 40) ->create();\n factory(App\\Auteur::class, 40) ->create();\n factory(App\\Livre::class, 80) ->create();\n\n for ($i = 1; $i < 41; $i++) {\n $number = rand(2, 8);\n for ($j = 1; $j <= $number; $j++) {\n DB::table('auteur_livre')->insert([\n 'livre_id' => rand(1, 40),\n 'auteur_id' => $i\n ]);\n }\n }\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n // Let's truncate our existing records to start from scratch.\n Assignation::truncate();\n\n $faker = \\Faker\\Factory::create();\n \n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 40; $i++) {\n Assignation::create([\n 'ad_id' => $faker->numberBetween(1,20),\n 'buyer_id' => $faker->numberBetween(1,6),\n 'seller_id' => $faker->numberBetween(6,11),\n 'state' => NULL,\n ]);\n }\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n \t$faker = Faker::create();\n\n \tfor($i=0; $i<20; $i++) {\n \t\t$post = new Post;\n \t\t$post->title = $faker->sentence();\n \t\t$post->body = $faker->paragraph();\n \t\t$post->category_id = rand(1, 5);\n \t\t$post->save();\n \t}\n\n \t$list = ['General', 'Technology', 'News', 'Internet', 'Mobile'];\n \tforeach($list as $name) {\n \t\t$category = new Category;\n \t\t$category->name = $name;\n \t\t$category->save();\n \t}\n\n \tfor($i=0; $i<20; $i++) {\n \t\t$comment = new Comment;\n \t\t$comment->comment = $faker->paragraph();\n \t\t$comment->post_id = rand(1,20);\n \t\t$comment->save();\n \t}\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n $this->call(RoleTableSeeder::class);\n $this->call(UserTableSeeder::class);\n \n factory('App\\Cat', 5)->create();\n $tags = factory('App\\Tag', 8)->create();\n\n factory(Post::class, 15)->create()->each(function($post) use ($tags){\n $post->comments()->save(factory(Comment::class)->make());\n $post->tags()->attach( $tags->random(mt_rand(1,4))->pluck('id')->toArray() );\n });\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::table('post')->insert(\n [\n 'title' => 'Test Post1',\n 'desc' => str_random(100).\" post1\",\n 'alias' => 'test1',\n 'keywords' => 'test1',\n ]\n );\n DB::table('post')->insert(\n [\n 'title' => 'Test Post2',\n 'desc' => str_random(100).\" post2\",\n 'alias' => 'test2',\n 'keywords' => 'test2',\n ]\n );\n DB::table('post')->insert(\n [\n 'title' => 'Test Post3',\n 'desc' => str_random(100).\" post3\",\n 'alias' => 'test3',\n 'keywords' => 'test3',\n ]\n );\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n \t$faker = Factory::create();\n \t\n \tforeach ($this->departments as $key => $department) {\n \t\tDepartment::create([\n \t\t\t'name' => $department\n \t\t]);\n \t}\n \tforeach ($this->collections as $key => $collection) {\n \t\tCollection::create([\n \t\t\t'name' => $collection\n \t\t]);\n \t}\n \t\n \t\n \tfor ($i=0; $i < 40; $i++) {\n \t\tUser::create([\n \t\t\t'name' \t=>\t$faker->name,\n \t\t\t'email' \t=>\t$faker->email,\n \t\t\t'password' \t=>\tbcrypt('123456'),\n \t\t]);\n \t} \n \t\n \t\n \tforeach ($this->departments as $key => $department) {\n \t\t//echo ($key + 1) . PHP_EOL;\n \t\t\n \t\tfor ($i=0; $i < 10; $i++) { \n \t\t\techo $faker->name . PHP_EOL;\n\n \t\t\tArt::create([\n \t\t\t\t'name'\t\t\t=> $faker->sentence(2),\n \t\t\t\t'img'\t\t\t=> $this->filenames[$i],\n \t\t\t\t'medium'\t\t=> 'canvas',\n \t\t\t\t'department_id'\t=> $key + 1,\n \t\t\t\t'user_id'\t\t=> $this->userIndex,\n \t\t\t\t'dimension'\t\t=> '18.0 x 24.0',\n\t\t\t\t]);\n \t\t\t\t\n \t\t\t\t$this->userIndex ++;\n \t\t}\n \t}\n \t\n \tdd(\"END\");\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // $this->dataCategory();\n factory(App\\Model\\Category::class, 70)->create();\n factory(App\\Model\\Producer::class, rand(5,10))->create();\n factory(App\\Model\\Provider::class, rand(5,10))->create();\n factory(App\\Model\\Product::class, 100)->create();\n factory(App\\Model\\Album::class, 300)->create();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n\n factory('App\\User', 10 )->create();\n\n $users= \\App\\User::all();\n $users->each(function($user){ factory('App\\Category', 1)->create(['user_id'=>$user->id]); });\n $users->each(function($user){ factory('App\\Tag', 3)->create(['user_id'=>$user->id]); });\n\n\n $users->each(function($user){\n factory('App\\Post', 10)->create([\n 'user_id'=>$user->id,\n 'category_id'=>rand(1,20)\n ]\n );\n });\n\n $posts= \\App\\Post::all();\n $posts->each(function ($post){\n\n $post->tags()->attach(array_unique([rand(1,20),rand(1,20),rand(1,20)]));\n });\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $types = factory(\\App\\Models\\Type::class, 5)->create();\n\n $cities = factory(\\App\\Models\\City::class, 10)->create();\n\n $cities->each(function ($city) {\n $districts = factory(\\App\\Models\\District::class, rand(2, 5))->create([\n 'city_id' => $city->id,\n ]);\n\n $districts->each(function ($district) {\n $properties = factory(\\App\\Models\\Property::class, rand(2, 5))->create([\n 'type_id' => rand(1, 5),\n 'district_id' => $district->id\n ]);\n\n $properties->each(function ($property) {\n $galleries = factory(\\App\\Models\\Gallery::class, rand(3, 10))->create([\n 'property_id' => $property->id\n ]);\n });\n });\n });\n }", "public function run()\n {\n $this->call(UsersTableSeeder::class);\n\n $categories = factory(App\\Models\\Category::class, 10)->create();\n\n $categories->each(function ($category) {\n $category\n ->posts()\n ->saveMany(\n factory(App\\Models\\Post::class, 3)->make()\n );\n });\n }", "public function run()\n {\n $this->call(CategoriesTableSeeder::class);\n\n $users = factory(App\\User::class, 5)->create();\n $recipes = factory(App\\Recipe::class, 30)->create();\n $preparations = factory(App\\Preparation::class, 70)->create();\n $photos = factory(App\\Photo::class, 90)->create();\n $comments = factory(App\\Comment::class, 200)->create();\n $flavours = factory(App\\Flavour::class, 25)->create();\n $flavour_recipe = factory(App\\FlavourRecipe::class, 50)->create();\n $tags = factory(App\\Tag::class, 25)->create();\n $recipe_tag = factory(App\\RecipeTag::class, 50)->create();\n $ingredients = factory(App\\Ingredient::class, 25)->create();\n $ingredient_preparation = factory(App\\IngredientPreparation::class, 300)->create();\n \n \n \n DB::table('users')->insert(['name' => 'SimpleUtilisateur', 'email' => 'simpleadressemail@mail.com', 'password' => bcrypt('SimpleMotDePasse')]);\n \n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n // Sample::truncate();\n // TestItem::truncate();\n // UOM::truncate();\n Role::truncate();\n User::truncate();\n\n // factory(Role::class, 4)->create();\n Role::create([\n 'name'=> 'Director',\n 'description'=> 'Director type'\n ]);\n\n Role::create([\n 'name'=> 'Admin',\n 'description'=> 'Admin type'\n ]);\n Role::create([\n 'name'=> 'Employee',\n 'description'=> 'Employee type'\n ]);\n Role::create([\n 'name'=> 'Technician',\n 'description'=> 'Technician type'\n ]);\n \n factory(User::class, 20)->create()->each(\n function ($user){\n $roles = \\App\\Role::all()->random(mt_rand(1, 2))->pluck('id');\n $user->roles()->attach($roles);\n }\n );\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n UsersLevel::create([\n 'name' => 'Administrator'\n ]);\n\n UsersLevel::create([\n 'name' => 'User'\n ]);\n\n User::create([\n 'username' => 'admin',\n 'password' => bcrypt('admin123'),\n 'level_id' => 1,\n 'fullname' => \"Super Admin\",\n 'email'=> \"admin@admin.com\"\n ]);\n\n\n \\App\\CategoryPosts::create([\n 'name' =>'Paket Trip'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' =>'Destinasi Kuliner'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' => 'Event'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' => 'Profil'\n ]);\n }", "public function run()\n {\n DB::table('users')->insert([\n 'name' => 'Admin',\n 'email' => 'admin@petstore.com',\n 'avatar' => \"avatar\",\n 'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi',\n ]);\n $this->call(CategorySeeder::class);\n // \\App\\Models\\Admin::factory(1)->create();\n \\App\\Models\\User::factory(10)->create();\n // \\App\\Models\\Category::factory(50)->create();\n \\App\\Models\\PetComment::factory(50)->create();\n $pets = \\App\\Models\\Pet::factory(50)->create();\n foreach ($pets as $pet) {\n \\App\\Models\\PetTag::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\PetPhotoUrl::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\Order::factory(1)->create(['pet_id' => $pet->id]);\n };\n }", "public function run()\n { \n\n $this->call(RoleSeeder::class);\n \n $this->call(UserSeeder::class);\n\n Storage::deleteDirectory('socials-icon');\n Storage::makeDirectory('socials-icon');\n $socials = Social::factory(7)->create();\n\n Storage::deleteDirectory('countries-flag');\n Storage::deleteDirectory('countries-firm');\n Storage::makeDirectory('countries-flag');\n Storage::makeDirectory('countries-firm');\n $countries = Country::factory(18)->create();\n\n // Se llenan datos de la tabla muchos a muchos - social_country\n foreach ($countries as $country) {\n foreach ($socials as $social) {\n\n $country->socials()->attach($social->id, [\n 'link' => 'https://www.facebook.com/ministeriopalabrayespiritu/'\n ]);\n }\n }\n\n Person::factory(50)->create();\n\n Category::factory(7)->create();\n\n Video::factory(25)->create(); \n\n $this->call(PostSeeder::class);\n\n Storage::deleteDirectory('documents');\n Storage::makeDirectory('documents');\n Document::factory(25)->create();\n\n }", "public function run()\n {\n $faker = Faker::create('id_ID');\n /**\n * Generate fake author data\n */\n for ($i=1; $i<=50; $i++) { \n DB::table('author')->insert([\n 'name' => $faker->name\n ]);\n }\n /**\n * Generate fake publisher data\n */\n for ($i=1; $i<=50; $i++) { \n DB::table('publisher')->insert([\n 'name' => $faker->name\n ]);\n }\n /**\n * Seeding payment method\n */\n DB::table('payment')->insert([\n ['name' => 'Mandiri'],\n ['name' => 'BCA'],\n ['name' => 'BRI'],\n ['name' => 'BNI'],\n ['name' => 'Pos Indonesia'],\n ['name' => 'BTN'],\n ['name' => 'Indomaret'],\n ['name' => 'Alfamart'],\n ['name' => 'OVO'],\n ['name' => 'Cash On Delivery']\n ]);\n }", "public function run()\n {\n DatabaseSeeder::seedLearningStylesProbs();\n DatabaseSeeder::seedCampusProbs();\n DatabaseSeeder::seedGenderProbs();\n DatabaseSeeder::seedTypeStudentProbs();\n DatabaseSeeder::seedTypeProfessorProbs();\n DatabaseSeeder::seedNetworkProbs();\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n // MyList::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 3; $i++) {\n MyList::create([\n 'title' => 'List-'.($i+1),\n 'color' => $faker->sentence,\n 'icon' => $faker->randomDigitNotNull,\n 'index' => $faker->randomDigitNotNull,\n 'user_id' => 1,\n ]);\n }\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n Products::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few products in our database:\n for ($i = 0; $i < 50; $i++) {\n Products::create([\n 'name' => $faker->word,\n 'sku' => $faker->randomNumber(7, false),\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n User::create([\n 'name' => 'Pablo Rosales',\n 'email' => 'prosales@researchmobile.co',\n 'password' => bcrypt('admin'),\n 'status' => 1,\n 'role_id' => 1,\n 'movil' => 0\n ]);\n\n User::create([\n 'name' => 'Usuario Movil',\n 'email' => 'movil@researchmobile.co',\n 'password' => bcrypt('secret'),\n 'status' => 1,\n 'role_id' => 3,\n 'movil' => 1\n ]);\n\n Roles::create([\n 'name' => 'Administrador'\n ]);\n Roles::create([\n 'name' => 'Operaciones'\n ]);\n Roles::create([\n 'name' => 'Comercial'\n ]);\n Roles::create([\n 'name' => 'Aseguramiento'\n ]);\n Roles::create([\n 'name' => 'Facturación'\n ]);\n Roles::create([\n 'name' => 'Creditos y Cobros'\n ]);\n\n factory(App\\Customers::class, 100)->create();\n }", "public function run()\n {\n // php artisan db:seed --class=StoreTableSeeder\n\n foreach(range(1,20) as $i){\n $faker = Faker::create();\n Store::create([\n 'name' => $faker->name,\n 'desc' => $faker->text,\n 'tags' => $faker->word,\n 'address' => $faker->address,\n 'longitude' => $faker->longitude($min = -180, $max = 180),\n 'latitude' => $faker->latitude($min = -90, $max = 90),\n 'created_by' => '1'\n ]);\n }\n\n }", "public function run()\n {\n DB::table('users')->insert([\n 'name'=>\"test\",\n 'password' => Hash::make('123'),\n 'email'=>'test@yandex.ru'\n ]);\n DB::table('tags')->insert(['name'=>'tags']);\n $this->call(UserSeed::class);\n $this->call(CategoriesSeed::class);\n $this->call(TopicsSeed::class);\n $this->call(CommentariesSeed::class);\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n echo 'seeding permission...', PHP_EOL;\n $permissions = [\n 'role-list',\n 'role-create',\n 'role-edit',\n 'role-delete',\n 'formation-list',\n 'formation-create',\n 'formation-edit',\n 'formation-delete',\n 'user-list',\n 'user-create',\n 'user-edit',\n 'user-delete'\n ];\n foreach ($permissions as $permission) {\n Permission::create(['name' => $permission]);\n }\n echo 'seeding users...', PHP_EOL;\n\n $user= User::create(\n [\n 'name' => 'Mr. admin',\n 'email' => 'admin@yahoo.com',\n 'password' => bcrypt('admin'),\n 'remember_token' => null,\n ]\n );\n echo 'Create Roles...', PHP_EOL;\n Role::create(['name' => 'former']);\n Role::create(['name' => 'learner']);\n Role::create(['name' => 'admin']);\n Role::create(['name' => 'manager']);\n Role::create(['name' => 'user']);\n\n echo 'seeding Role User...', PHP_EOL;\n $user->assignRole('admin');\n $role = $user->assignRole('admin');\n $role->givepermissionTo(Permission::all());\n\n \\DB::table('languages')->insert(['name' => 'English', 'code' => 'en']);\n \\DB::table('languages')->insert(['name' => 'Français', 'code' => 'fr']);\n }", "public function run()\n {\n $this->call(UsersTableSeeder::class);\n $this->call(PermissionsSeeder::class);\n $this->call(RolesSeeder::class);\n $this->call(ThemeSeeder::class);\n\n //\n\n DB::table('paypal_info')->insert([\n 'client_id' => '',\n 'client_secret' => '',\n 'currency' => '',\n ]);\n DB::table('contact_us')->insert([\n 'content' => '',\n ]);\n DB::table('setting')->insert([\n 'site_name' => ' ',\n ]);\n DB::table('terms_and_conditions')->insert(['terms_and_condition' => 'text']);\n }", "public function run()\n {\n $this->call([\n UserSeeder::class,\n ]);\n\n User::factory(20)->create();\n Author::factory(20)->create();\n Book::factory(60)->create();\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(UserSeeder::class);\n $this->call(RolePermissionSeeder::class);\n $this->call(AppmodeSeeder::class);\n\n // \\App\\Models\\Appmode::factory(3)->create();\n \\App\\Models\\Doctor::factory(100)->create();\n \\App\\Models\\Unit::factory(50)->create();\n \\App\\Models\\Broker::factory(100)->create();\n \\App\\Models\\Patient::factory(100)->create();\n \\App\\Models\\Expence::factory(100)->create();\n \\App\\Models\\Testcategory::factory(100)->create();\n \\App\\Models\\Test::factory(50)->create();\n \\App\\Models\\Parameter::factory(50)->create();\n \\App\\Models\\Sale::factory(50)->create();\n \\App\\Models\\SaleItem::factory(100)->create();\n \\App\\Models\\Goption::factory(1)->create();\n \\App\\Models\\Pararesult::factory(50)->create();\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // DB::table('roles')->insert(\n // [\n // ['name' => 'admin', 'description' => 'Administrator'],\n // ['name' => 'student', 'description' => 'Student'],\n // ['name' => 'lab_tech', 'description' => 'Lab Tech'],\n // ['name' => 'it_staff', 'description' => 'IT Staff Member'],\n // ['name' => 'it_manager', 'description' => 'IT Manager'],\n // ['name' => 'lab_manager', 'description' => 'Lab Manager'],\n // ]\n // );\n\n // DB::table('users')->insert(\n // [\n // 'username' => 'admin', \n // 'password' => Hash::make('password'), \n // 'active' => 1,\n // 'name' => 'Administrator',\n // 'email' => 'programmerlemar@gmail.com',\n // 'role_id' => \\App\\Role::where('name', 'admin')->first()->id\n // ]\n // );\n\n DB::table('status')->insert([\n // ['name' => 'Active'],\n // ['name' => 'Cancel'],\n // ['name' => 'Disable'],\n // ['name' => 'Open'],\n // ['name' => 'Closed'],\n // ['name' => 'Resolved'],\n ['name' => 'Used'],\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n factory(User::class)->create([\n 'name' => 'Qwerty',\n 'email' => 'qwerty@gmail.com',\n 'password' => bcrypt('secretpassw'),\n ]);\n\n factory(User::class, 59)->create([\n 'password' => bcrypt('secretpassw'),\n ]);\n\n for ($i = 1; $i < 11; $i++) {\n factory(Category::class)->create([\n 'name' => 'Category ' . $i,\n ]);\n }\n\n for ($i = 1; $i < 101; $i++) {\n factory(Product::class)->create([\n 'name' => 'Product ' . $i,\n ]);\n }\n }", "public function run()\n {\n\n \t// Making main admin role\n \tDB::table('roles')->insert([\n 'name' => 'Admin',\n ]);\n\n // Making main category\n \tDB::table('categories')->insert([\n 'name' => 'Other',\n ]);\n\n \t// Making main admin account for testing\n \tDB::table('users')->insert([\n 'name' \t\t=> 'Admin',\n 'email' \t=> 'admin@example.com',\n 'password' => bcrypt('12345'),\n 'role_id' => 1,\n 'created_at' => date('Y-m-d H:i:s' ,time()),\n 'updated_at' => date('Y-m-d H:i:s' ,time())\n ]);\n\n \t// Making random users and posts\n factory(App\\User::class, 10)->create();\n factory(App\\Post::class, 35)->create();\n }", "public function run()\n {\n $faker = Faker::create();\n\n \\DB::table('positions')->insert(array (\n 'codigo' => strtoupper($faker->randomLetter).$faker->postcode,\n 'nombre' => 'Chef',\n 'salario' => '15000.00'\n ));\n\n\t\t \\DB::table('positions')->insert(array (\n 'codigo' => strtoupper($faker->randomLetter).$faker->postcode,\n 'nombre' => 'Mesonero',\n 'salario' => '12000.00'\n ));\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker = \\Faker\\Factory::create();\n\n foreach (range(1,5) as $index) {\n Lista::create([\n 'name' => $faker->sentence(2),\n 'description' => $faker->sentence(10), \n ]);\n } \n\n foreach (range(1,20) as $index) {\n $n = $faker->sentence(2);\n \tTarea::create([\n \t\t'name' => $n,\n \t\t'description' => $faker->sentence(10),\n 'lista_id' => $faker->numberBetween(1,5),\n 'slug' => Str::slug($n),\n \t\t]);\n } \n }", "public function run()\n {\n $faker = Faker::create('lt_LT');\n\n DB::table('users')->insert([\n 'name' => 'user',\n 'email' => 'briedis@aa.bb',\n 'password' => Hash::make('123')\n ]);\n DB::table('users')->insert([\n 'name' => 'user2',\n 'email' => 'briedis2@aa.bb',\n 'password' => Hash::make('123')\n ]);\n\n foreach (range(1,100) as $val)\n DB::table('authors')->insert([\n 'name' => $faker->firstName(),\n 'surname' => $faker->lastName(),\n \n ]);\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(UsersTableSeeder::class);\n\n // DB::table('users')->insert([\n // 'name' => 'User1',\n // 'email' => 'admin@admin.com',\n // 'password' => bcrypt('password'),\n // ]);\n\n\n $faker = Faker::create();\n \n foreach (range(1,10) as $index){\n DB::table('companies')->insert([\n 'name' => $faker->company(),\n 'email' => $faker->email(10).'@gmail.com',\n 'logo' => $faker->image($dir = '/tmp', $width = 640, $height = 480),\n 'webiste' => $faker->domainName(),\n \n ]);\n }\n \n \n foreach (range(1,10) as $index){\n DB::table('employees')->insert([\n 'first_name' => $faker->firstName(),\n 'last_name' => $faker->lastName(),\n 'company' => $faker->company(),\n 'email' => $faker->str_random(10).'@gmail.com',\n 'phone' => $faker->e164PhoneNumber(),\n \n ]);\n }\n\n\n\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n Flight::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 100; $i++) {\n\n\n Flight::create([\n 'flightNumber' => $faker->randomNumber(5),\n 'depAirport' => $faker->city,\n 'destAirport' => $faker->city,\n 'reservedWeight' => $faker->numberBetween(1000 - 10000),\n 'deptTime' => $faker->dateTime('now'),\n 'arrivalTime' => $faker->dateTime('now'),\n 'reservedVolume' => $faker->numberBetween(1000 - 10000),\n 'airlineName' => $faker->colorName,\n ]);\n }\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->truncteTables([\n 'users',\n 'products'\n ]);\n\n $this->call(UsersSeeder::class);\n $this->call(ProductsSeeder::class);\n\n }", "public function run()\n {\n /**\n * Dummy seeds\n */\n DB::table('metas')->truncate();\n $faker = Faker::create();\n\n for ($i=0; $i < 10; $i++) { \n DB::table('metas')->insert([\n 'id_rel' => $faker->randomNumber(),\n 'titulo' => $faker->sentence,\n 'descricao' => $faker->paragraph,\n 'justificativa' => $faker->paragraph,\n 'valor_inicial' => $faker->numberBetween(0,100),\n 'valor_atual' => $faker->numberBetween(0,100),\n 'valor_final' => $faker->numberBetween(0,10),\n 'regras' => json_encode([$i => [\"values\" => $faker->words(3)]]),\n 'types' => json_encode([$i => [\"values\" => $faker->words(2)]]),\n 'categorias' => json_encode([$i => [\"values\" => $faker->words(4)]]),\n 'tags' => json_encode([$i => [\"values\" => $faker->words(5)]]),\n 'active' => true,\n ]);\n }\n\n\n }", "public function run()\n {\n // $this->call(UserTableSeeder::class);\n\n $faker = Faker::create();\n\n $lessonIds = Lesson::lists('id')->all(); // An array of ID's in that table [1, 2, 3, 4, 5, 7]\n $tagIds = Tag::lists('id')->all();\n\n foreach(range(1, 30) as $index)\n {\n // a real lesson id\n // a real tag id\n DB::table('lesson_tag')->insert([\n 'lesson_id' => $faker->randomElement($lessonIds),\n 'tag_id' => $faker->randomElement($tagIds),\n ]);\n }\n }", "public function run()\n {\n $this->call(CategoriasTableSeeder::class);\n $this->call(UfsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n $this->call(UserTiposTableSeeder::class);\n factory(App\\User::class, 2)->create();\n/* factory(App\\Models\\Categoria::class, 20)->create();*/\n/* factory(App\\Models\\Anuncio::class, 50)->create();*/\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n Language::truncate();\n Reason::truncate();\n Report::truncate();\n Category::truncate();\n Position::truncate();\n\n $languageQuantity = 10;\n $reasonQuantity = 10;\n $reportQuantity = 10;\n $categoryQuantity = 10;\n $positionQuantity = 10;\n\n factory(Language::class,$languageQuantity)->create();\n factory(Reason::class,$reasonQuantity)->create();\n \n factory(Report::class,$reportQuantity)->create();\n \n factory(Category::class,$categoryQuantity)->create();\n \n factory(Position::class,$positionQuantity)->create();\n\n }", "public function run()\n {\n // \\DB::statement('SET_FOREIGN_KEY_CHECKS=0');\n \\DB::table('users')->truncate();\n \\DB::table('posts')->truncate();\n // \\DB::table('category')->truncate();\n \\DB::table('photos')->truncate();\n \\DB::table('comments')->truncate();\n \\DB::table('comment_replies')->truncate();\n\n \\App\\Models\\User::factory()->times(10)->hasPosts(1)->create();\n \\App\\Models\\Role::factory()->times(10)->create();\n \\App\\Models\\Category::factory()->times(10)->create();\n \\App\\Models\\Comment::factory()->times(10)->hasReplies(1)->create();\n \\App\\Models\\Photo::factory()->times(10)->create();\n\n \n // \\App\\Models\\User::factory(10)->create([\n // 'role_id'=>2,\n // 'is_active'=>1\n // ]);\n\n // factory(App\\Models\\Post::class, 10)->create();\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n $this->call([\n ArticleSeeder::class, \n TagSeeder::class,\n Arttagrel::class\n ]);\n // \\App\\Models\\User::factory(10)->create();\n \\App\\Models\\Article::factory()->count(7)->create();\n \\App\\Models\\Tag::factory()->count(15)->create(); \n \\App\\Models\\Arttagrel::factory()->count(15)->create(); \n }", "public function run()\n {\n $this->call(ArticulosTableSeeder::class);\n /*DB::table('articulos')->insert([\n 'titulo' => str_random(50),\n 'cuerpo' => str_random(200),\n ]);*/\n }", "public function run()\n {\n $this->call(CategoryTableSeeder::class);\n $this->call(ProductTableSeeder::class);\n\n \t\t\n\t\t\tDB::table('users')->insert([\n 'first_name' => 'Ignacio',\n 'last_name' => 'Garcia',\n 'email' => 'ignacio@dh.com',\n 'password' => bcrypt('123456'),\n 'role' => '1',\n 'avatar' => 'CGnABxNYYn8N23RWlvTTP6C2nRjOLTf8IJcbLqRP.jpeg',\n ]);\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(RoleSeeder::class);\n $this->call(UserSeeder::class);\n\n Medicamento::factory(50)->create();\n Reporte::factory(5)->create();\n Cliente::factory(200)->create();\n Asigna_valor::factory(200)->create();\n Carga::factory(200)->create();\n }", "public function run()\n {\n $this->call([\n RoleSeeder::class,\n TicketSeeder::class\n ]);\n\n DB::table('departments')->insert([\n 'abbr' => 'IT',\n 'name' => 'Information Technologies',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ]);\n\n DB::table('users')->insert([\n 'name' => 'admin',\n 'email' => 'admin@gmail.com',\n 'email_verified_at' => Carbon::now(),\n 'password' => Hash::make('admin'),\n 'department_id' => 1,\n 'avatar' => 'default.png',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ]);\n\n DB::table('role_user')->insert([\n 'role_id' => 1,\n 'user_id' => 1\n ]);\n }", "public function run()\n {\n \\App\\Models\\Article::factory(20)->create();\n \\App\\Models\\Category::factory(5)->create();\n \\App\\Models\\Comment::factory(40)->create();\n\n \\App\\Models\\User::create([\n \"name\"=>\"Alice\",\n \"email\"=>'alice@gmail.com',\n 'password' => Hash::make('password'),\n ]);\n \\App\\Models\\User::create([\n \"name\"=>\"Bob\",\n \"email\"=>'bob@gmail.com',\n 'password' => Hash::make('password'),\n ]);\n }", "public function run()\n {\n /** \n * Note: You must add these lines to your .env file for this Seeder to work (replace the values, obviously):\n SEEDER_USER_FIRST_NAME = 'Firstname'\n SEEDER_USER_LAST_NAME = 'Lastname'\n\t\tSEEDER_USER_DISPLAY_NAME = 'Firstname Lastname'\n\t\tSEEDER_USER_EMAIL = your.email@domain.com\n SEEDER_USER_PASSWORD = yourpassword\n */\n\t\tDB::table('users')->insert([\n 'user_first_name' => env('SEEDER_USER_FIRST_NAME'),\n 'user_last_name' => env('SEEDER_USER_LAST_NAME'),\n 'user_name' => env('SEEDER_USER_DISPLAY_NAME'),\n\t\t\t'user_email' => env('SEEDER_USER_EMAIL'),\n 'user_status' => 1,\n \t'password' => Hash::make((env('SEEDER_USER_PASSWORD'))),\n 'permission_fk' => 1,\n 'created_at' => Carbon::now()->format('Y-m-d H:i:s'),\n 'updated_at' => Carbon::now()->format('Y-m-d H:i:s')\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class,3)->create()->each(\n \tfunction($user)\n \t{\n \t\t$user->questions()\n \t\t->saveMany(\n \t\t\tfactory(App\\Question::class, rand(2,6))->make()\n \t\t)\n ->each(function ($q) {\n $q->answers()->saveMany(factory(App\\Answer::class, rand(1,5))->make());\n })\n \t}\n );\n }\n}", "public function run()\n {\n $faker = Faker::create();\n\n // $this->call(UsersTableSeeder::class);\n\n DB::table('posts')->insert([\n 'id'=>str_random(1),\n 'user_id'=> str_random(1),\n 'title' => $faker->name,\n 'body' => $faker->safeEmail,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ]);\n }", "public function run()\n\t{\n\t\tDB::table(self::TABLE_NAME)->delete();\n\n\t\tforeach (seed(self::TABLE_NAME) as $row)\n\t\t\t$records[] = [\n\t\t\t\t'id'\t\t\t\t=> $row->id,\n\t\t\t\t'created_at'\t\t=> $row->created_at ?? Carbon::now(),\n\t\t\t\t'updated_at'\t\t=> $row->updated_at ?? Carbon::now(),\n\n\t\t\t\t'sport_id'\t\t\t=> $row->sport_id,\n\t\t\t\t'gender_id'\t\t\t=> $row->gender_id,\n\t\t\t\t'tournamenttype_id'\t=> $row->tournamenttype_id ?? null,\n\n\t\t\t\t'name'\t\t\t\t=> $row->name,\n\t\t\t\t'external_id'\t\t=> $row->external_id ?? null,\n\t\t\t\t'is_top'\t\t\t=> $row->is_top ?? null,\n\t\t\t\t'logo'\t\t\t\t=> $row->logo ?? null,\n\t\t\t\t'position'\t\t\t=> $row->position ?? null,\n\t\t\t];\n\n\t\tinsert(self::TABLE_NAME, $records ?? []);\n\t}", "public function run()\n\t{\n\t\tDB::table('libros')->truncate();\n\n\t\t$faker = Faker\\Factory::create();\n\n\t\tfor ($i=0; $i < 10; $i++) { \n\t\t\tLibro::create([\n\n\t\t\t\t'titulo'\t\t=> $faker->text(40),\n\t\t\t\t'isbn'\t\t\t=> $faker->numberBetween(100,999),\n\t\t\t\t'precio'\t\t=> $faker->randomFloat(2,3,150),\n\t\t\t\t'publicado'\t\t=> $faker->numberBetween(0,1),\n\t\t\t\t'descripcion'\t=> $faker->text(400),\n\t\t\t\t'autor_id'\t\t=> $faker->numberBetween(1,3),\n\t\t\t\t'categoria_id'\t=> $faker->numberBetween(1,3)\n\n\t\t\t]);\n\t\t}\n\n\t\t// Uncomment the below to run the seeder\n\t\t// DB::table('libros')->insert($libros);\n\t}", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class, 10)->create()->each(function ($user) {\n // Seed the relation with 5 purchases\n // $videos = factory(App\\Video::class, 5)->make();\n // $user->videos()->saveMany($videos);\n // $user->videos()->each(function ($video){\n // \t$video->videometa()->save(factory(App\\VideoMeta::class)->make());\n // \t// :( \n // });\n factory(App\\User::class, 10)->create()->each(function ($user) {\n\t\t\t factory(App\\Video::class, 5)->create(['user_id' => $user->id])->each(function ($video) {\n\t\t\t \tfactory(App\\VideoMeta::class, 1)->create(['video_id' => $video->id]);\n\t\t\t // $video->videometa()->save(factory(App\\VideoMeta::class)->create(['video_id' => $video->id]));\n\t\t\t });\n\t\t\t});\n\n });\n }", "public function run()\n {\n // for($i=1;$i<11;$i++){\n // DB::table('post')->insert(\n // ['title' => 'Title'.$i,\n // 'post' => 'Post'.$i,\n // 'slug' => 'Slug'.$i]\n // );\n // }\n $faker = Faker\\Factory::create();\n \n for($i=1;$i<20;$i++){\n $dname = $faker->name;\n DB::table('post')->insert(\n ['title' => $dname,\n 'post' => $faker->text($maxNbChars = 200),\n 'slug' => str_slug($dname)]\n );\n }\n }", "public function run()\n {\n $this->call([\n CountryTableSeeder::class,\n ProvinceTableSeeder::class,\n TagTableSeeder::class\n ]);\n\n User::factory()->count(10)->create();\n Category::factory()->count(5)->create();\n Product::factory()->count(20)->create();\n Section::factory()->count(5)->create();\n Bundle::factory()->count(20)->create();\n\n $bundles = Bundle::all();\n // populate bundle-product table (morph many-to-many)\n Product::all()->each(function ($product) use ($bundles) {\n $product->bundles()->attach(\n $bundles->random(2)->pluck('id')->toArray(),\n ['default_quantity' => rand(1, 10)]\n );\n });\n // populate bundle-tags table (morph many-to-many)\n Tag::all()->each(function ($tag) use ($bundles) {\n $tag->bundles()->attach(\n $bundles->random(2)->pluck('id')->toArray()\n );\n });\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n Contract::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 50; $i++) {\n Contract::create([\n 'serialnumbers' => $faker->numberBetween($min = 1000000, $max = 2000000),\n 'address' => $faker->address,\n 'landholder' => $faker->lastName,\n 'renter' => $faker->lastName,\n 'price' => $faker->numberBetween($min = 10000, $max = 50000),\n 'rent_start' => $faker->date($format = 'Y-m-d', $max = 'now'),\n 'rent_end' => $faker->date($format = 'Y-m-d', $max = 'now'),\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker=Faker\\Factory::create();\n\n for($i=0;$i<100;$i++){\n \tApp\\Blog::create([\n \t\t'title' => $faker->catchPhrase,\n 'description' => $faker->text,\n 'showns' =>true\n \t\t]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0'); // TO PREVENT CHECKS FOR foreien key in seeding\n\n User::truncate();\n Category::truncate();\n Product::truncate();\n Transaction::truncate();\n\n DB::table('category_product')->truncate();\n\n User::flushEventListeners();\n Category::flushEventListeners();\n Product::flushEventListeners();\n Transaction::flushEventListeners();\n\n $usersQuantities = 1000;\n $categoriesQuantities = 30;\n $productsQuantities = 1000;\n $transactionsQuantities = 1000;\n\n factory(User::class, $usersQuantities)->create();\n factory(Category::class, $categoriesQuantities)->create();\n\n factory(Product::class, $productsQuantities)->create()->each(\n function ($product) {\n $categories = Category::all()->random(mt_rand(1, 5))->pluck('id');\n $product->categories()->attach($categories);\n });\n\n factory(Transaction::class, $transactionsQuantities)->create();\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n $this->call(PermissionsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n\n $this->call(BusinessTableSeeder::class);\n $this->call(PrinterTableSeeder::class);\n factory(App\\Tag::class,10)->create();\n factory(App\\Category::class,10)->create();\n factory(App\\Subcategory::class,50)->create();\n factory(App\\Provider::class,10)->create();\n factory(App\\Product::class,24)->create()->each(function($product){\n\n $product->images()->saveMany(factory(App\\Image::class, 4)->make());\n\n });\n\n\n factory(App\\Client::class,10)->create();\n }", "public function run()\n {\n Article::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 50; $i++) {\n Article::create([\n 'name' => $faker->sentence,\n 'sku' => $faker->paragraph,\n 'price' => $faker->number,\n ]);\n }\n }", "public function run()\n {\n Storage::deleteDirectory('public/products');\n Storage::makeDirectory('public/products');\n\n $this->call(UserSeeder::class);\n Category::factory(4)->create();\n $this->call(ProductSeeder::class);\n Order::factory(4)->create();\n Order_Detail::factory(4)->create();\n Size::factory(100)->create();\n }", "public function run()\n {\n $this->call(RolSeeder::class);\n\n $this->call(UserSeeder::class);\n Category::factory(4)->create();\n Doctor::factory(25)->create();\n Patient::factory(50)->create();\n Status::factory(3)->create();\n Appointment::factory(100)->create();\n }", "public function run()\n\t{\n\t\t\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n\t\t$faker = \\Faker\\Factory::create();\n\n\t\tTodolist::truncate();\n\n\t\tforeach(range(1, 50) as $index)\n\t\t{\n\n\t\t\t$user = User::create([\n\t\t\t\t'name' => $faker->name,\n\t\t\t\t'email' => $faker->email,\n\t\t\t\t'password' => 'password',\n\t\t\t\t'confirmation_code' => mt_rand(0, 9),\n\t\t\t\t'confirmation' => rand(0,1) == 1\n\t\t\t]);\n\n\t\t\t$list = Todolist::create([\n\t\t\t\t'name' => $faker->sentence(2),\n\t\t\t\t'description' => $faker->sentence(4),\n\t\t\t]);\n\n\t\t\t// BUILD SOME TASKS FOR EACH LIST ITEM\n\t\t\tforeach(range(1, 10) as $index) \n\t\t\t{\n\t\t\t\t$task = new Task;\n\t\t\t\t$task->name = $faker->sentence(2);\n\t\t\t\t$task->description = $faker->sentence(4);\n\t\t\t\t$list->tasks()->save($task);\n\t\t\t}\n\n\t\t}\n\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS = 1'); \n\n\t}", "public function run()\n {\n Campus::truncate();\n Canteen::truncate();\n Dorm::truncate();\n\n $faker = Faker\\Factory::create();\n $schools = School::all();\n foreach ($schools as $school) {\n \tforeach (range(1, 2) as $index) {\n\t \t$campus = Campus::create([\n\t \t\t'school_id' => $school->id,\n\t \t\t'name' => $faker->word . '校区',\n\t \t\t]);\n\n \t$campus->canteens()->saveMany(factory(Canteen::class, mt_rand(2,3))->make());\n $campus->dorms()->saveMany(factory(Dorm::class, mt_rand(2,3))->make());\n\n }\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::table('users')->insert([\n 'name' => 'admin',\n 'email' => 'admin@gmail.com',\n 'password' => bcrypt('admin'),\n 'seq_q'=>'1',\n 'seq_a'=>'admin'\n ]);\n\n // DB::table('bloods')->insert([\n // ['name' => 'A+'],\n // ['name' => 'A-'],\n // ['name' => 'B+'],\n // ['name' => 'B-'],\n // ['name' => 'AB+'],\n // ['name' => 'AB-'],\n // ['name' => 'O+'],\n // ['name' => 'O-'],\n // ]);\n\n \n }", "public function run()\n {\n // $this->call(UserTableSeeder::class);\n \\App\\User::create([\n 'name'=>'PAPE SAMBA NDOUR',\n 'email'=>'papesambandour@hotmail.com',\n 'password'=>bcrypt('Admin1122'),\n ]);\n\n $faker = Faker::create();\n\n for ($i = 0; $i < 100 ; $i++)\n {\n $firstName = $faker->firstName;\n $lastName = $faker->lastName;\n $niveau = \\App\\Niveau::inRandomOrder()->first();\n \\App\\Etudiant::create([\n 'prenom'=>$firstName,\n 'nom'=>$lastName,\n 'niveau_id'=>$niveau->id\n ]);\n }\n\n\n }", "public function run()\n {\n //\n DB::table('foods')->delete();\n\n Foods::create(array(\n 'name' => 'Chicken Wing',\n 'author' => 'Bambang',\n 'overview' => 'a deep-fried chicken wing, not in spicy sauce'\n ));\n\n Foods::create(array(\n 'name' => 'Beef ribs',\n 'author' => 'Frank',\n 'overview' => 'Slow baked beef ribs rubbed in spices'\n ));\n\n Foods::create(array(\n 'name' => 'Ice cream',\n 'author' => 'Lou',\n 'overview' => ' A sweetened frozen food typically eaten as a snack or dessert.'\n ));\n\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n News::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 10; $i++) {\n News::create([\n 'title' => $faker->sentence,\n 'summary' => $faker->sentence,\n 'content' => $faker->paragraph,\n 'imagePath' => '/img/exclamation_mark.png'\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class, 3)->create();\n factory(App\\Models\\Category::class, 3)\n ->create()\n ->each(function ($u) {\n $u->courses()->saveMany(factory(App\\Models\\Course::class,3)->make())->each(function ($c){\n $c->exams()->saveMany(factory(\\App\\Models\\Exam::class,3)->make())->each(function ($e){\n $e->questions()->saveMany(factory(\\App\\Models\\Question::class,4)->make())->each(function ($q){\n $q->answers()->saveMany(factory(\\App\\Models\\Answer::class,4)->make())->each(function ($a){\n $a->correctAnswer()->save(factory(\\App\\Models\\Correct_answer::class)->make());\n });\n });\n });\n });\n\n });\n\n }", "public function run()\n {\n \\DB::table('employees')->delete();\n\n $faker = \\Faker\\Factory::create('ja_JP');\n\n $role_id = ['1','2','3'];\n\n for ($i = 0; $i < 10; $i++) {\n \\App\\Models\\Employee::create([\n 'last_name' =>$faker->lastName() ,\n 'first_name' => $faker->firstName(),\n 'mail' => $faker->email(),\n 'password' => Hash::make( \"password.$i\"),\n 'birthday' => $faker->date($format='Y-m-d',$max='now'),\n 'role_id' => $faker->randomElement($role_id)\n ]);\n }\n }", "public function run()\n {\n\n DB::table('clients')->delete();\n DB::table('trips')->delete();\n error_log('empty tables done.');\n\n $random_cities = City::inRandomOrder()->select('ar_name')->limit(5)->get();\n $GLOBALS[\"random_cities\"] = $random_cities->pluck('ar_name')->toArray();\n\n $random_airlines = Airline::inRandomOrder()->select('code')->limit(5)->get();\n $GLOBALS[\"random_airlines\"] = $random_airlines->pluck('code')->toArray();\n\n factory(App\\Client::class, 5)->create();\n error_log('Client seed done.');\n\n\n factory(App\\Trip::class, 50)->create();\n error_log('Trip seed done.');\n\n\n factory(App\\Quicksearch::class, 10)->create();\n error_log('Quicksearch seed done.');\n }", "public function run()\n {\n // Admins\n User::factory()->create([\n 'name' => 'Zaiman Noris',\n 'username' => 'rognales',\n 'email' => 'rognales@gmail.com',\n 'active' => true,\n ]);\n\n User::factory()->create([\n 'name' => 'Affiq Rashid',\n 'username' => 'affiqr',\n 'email' => 'sonic21danger@gmail.com',\n 'active' => true,\n ]);\n\n // Only seed test data in non-prod\n if (! app()->isProduction()) {\n Member::factory()->count(1000)->create();\n Staff::factory()->count(1000)->create();\n\n Participant::factory()\n ->addSpouse()\n ->addChildren()\n ->addInfant()\n ->addOthers()\n ->count(500)\n ->hasUploads(2)\n ->create();\n }\n }", "public function run()\n {\n $this->call([\n RoleSeeder::class,\n UserSeeder::class,\n ]);\n\n \\App\\Models\\Category::factory(4)->create();\n \\App\\Models\\View::factory(6)->create();\n \\App\\Models\\Room::factory(8)->create();\n \n $rooms = \\App\\Models\\Room::all();\n // \\App\\Models\\User::all()->each(function ($user) use ($rooms) { \n // $user->rooms()->attach(\n // $rooms->random(rand(1, \\App\\Models\\Room::max('id')))->pluck('id')->toArray()\n // ); \n // });\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n Employee::factory()->create(['email' => 'sovon.kucse@gmail.com']);\n Brand::factory()->count(3)->create();\n $this->call([\n TagSeeder::class,\n AttributeSeeder::class,\n AttributeValueSeeder::class,\n ProductSeeder::class,\n ]);\n }", "public function run()\n {\n $this->call(RolesTableSeeder::class); // crée les rôles\n $this->call(PermissionsTableSeeder::class); // crée les permissions\n\n factory(Employee::class,3)->create();\n factory(Provider::class,1)->create();\n\n $user = User::create([\n 'name'=>'Alioune Bada Ndoye',\n 'email'=>'abada@gmail.com',\n 'phone'=>'773012470',\n 'password'=>bcrypt('123'),\n ]);\n Employee::create([\n 'job'=>'Informaticien',\n 'user_id'=>User::where('email','abada@gmail.com')->first()->id,\n 'point_id'=>Point::find(1)->id,\n ]);\n $user->assignRole('admin');\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n factory(User::class, 1)\n \t->create(['email' => 'eddyjaair@gmail.com']);\n\n factory(Category::class, 5)->create();\n }", "public function run()\n {\n //$this->call(UsersTableSeeder::class);\n $this->call(rootSeed::class);\n factory(App\\Models\\Egresado::class,'hombre',15)->create();\n factory(App\\Models\\Egresado::class,'mujer',15)->create();\n factory(App\\Models\\Administrador::class,5)->create();\n factory(App\\Models\\Notificacion::class,'post',10)->create();\n factory(App\\Models\\Notificacion::class,'mensaje',5)->create();\n factory(App\\Models\\Egresado::class,'bajaM',5)->create();\n factory(App\\Models\\Egresado::class,'bajaF',5)->create();\n factory(App\\Models\\Egresado::class,'suscritam',5)->create();\n factory(App\\Models\\Egresado::class,'suscritaf',5)->create();\n }", "public function run()\n {\n \n User::factory(1)->create([\n 'rol'=>'EPS'\n ]);\n Person::factory(10)->create();\n $this->call(EPSSeeder::class);\n $this->call(OfficialSeeder::class);\n $this->call(VVCSeeder::class);\n $this->call(VaccineSeeder::class);\n }", "public function run()\n {\n // $faker=Faker::create();\n // foreach(range(1,100) as $index)\n // {\n // DB::table('products')->insert([\n // 'name' => $faker->name,\n // 'price' => rand(10,100000)/100\n // ]);\n // }\n }", "public function run()\n {\n $this->call([\n LanguagesTableSeeder::class,\n ListingAvailabilitiesTableSeeder::class,\n ListingTypesTableSeeder::class,\n RoomTypesTableSeeder::class,\n AmenitiesTableSeeder::class,\n UsersTableSeeder::class,\n UserLanguagesTableSeeder::class,\n ListingsTableSeeder::class,\n WishlistsTableSeeder::class,\n StaysTableSeeder::class,\n GuestsTableSeeder::class,\n TripsTableSeeder::class,\n ReviewsTableSeeder::class,\n RatingsTableSeeder::class,\n PopularDestinationsTableSeeder::class,\n ImagesTableSeeder::class,\n ]);\n\n // factory(App\\User::class, 5)->states('host')->create();\n // factory(App\\User::class, 10)->states('hostee')->create();\n\n // factory(App\\User::class, 10)->create();\n // factory(App\\Models\\Listing::class, 30)->create();\n }", "public function run()\n {\n Schema::disableForeignKeyConstraints();\n Grade::truncate();\n Schema::enableForeignKeyConstraints();\n\n $faker = \\Faker\\Factory::create();\n\n for ($i = 0; $i < 10; $i++) {\n Grade::create([\n 'letter' => $faker->randomElement(['а', 'б', 'в']),\n 'school_id' => $faker->unique()->numberBetween(1, School::count()),\n 'level' => 1\n ]);\n }\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n factory(App\\User::class,5)->create();//5 User created\n factory(App\\Model\\Genre::class,5)->create();//5 genres\n factory(App\\Model\\Film::class,6)->create();//6 films\n factory(App\\Model\\Comment::class, 20)->create();// 20 comments\n }", "public function run()\n {\n\n $this->call(UserSeeder::class);\n factory(Empresa::class,10)->create();\n factory(Empleado::class,50)->create();\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n User::create([\n 'name' => 'jose luis',\n 'email' => 'barbozagonzalesjose@gmail.com',\n 'password' => bcrypt('xxxxxx'),\n 'role' => 'admin',\n ]);\n\n Category::create([\n 'name' => 'inpods',\n 'description' => 'auriculares inalambricos que funcionan con blouthue genial'\n ]);\n\n Category::create([\n 'name' => 'other',\n 'description' => 'otra cosa diferente a un inpods'\n ]);\n\n\n /* Create 10 products */\n Product::factory(10)->create();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(User::class)->create([\n 'email' => 'russell@gmail.com',\n 'name' => 'Russell'\n ]);\n\n factory(User::class)->create([\n 'email' => 'bitfumes@gmail.com',\n 'name' => 'Bitfumes'\n ]);\n\n factory(User::class)->create([\n 'email' => 'paul@gmail.com',\n 'name' => 'Paul'\n ]);\n }", "public function run()\n {\n $user_ids = [1,2,3];\n $faker = app(\\Faker\\Generator::class);\n $posts = factory(\\App\\Post::class)->times(50)->make()->each(function($post) use ($user_ids,$faker){\n $post->user_id = $faker->randomElement($user_ids);\n });\n \\App\\Post::insert($posts->toArray());\n }", "public function run()\n {\n // Vaciar la tabla.\n Favorite::truncate();\n $faker = \\Faker\\Factory::create();\n // Crear artículos ficticios en la tabla\n\n // factory(App\\Models\\User::class, 2)->create()->each(function ($user) {\n // $user->users()->saveMany(factory(App\\Models\\User::class, 25)->make());\n //});\n }", "public function run()\n\t{\n\t\t$this->call(ProductsTableSeeder::class);\n\t\t$this->call(CategoriesTableSeeder::class);\n\t\t$this->call(BrandsTableSeeder::class);\n\t\t$this->call(ColorsTableSeeder::class);\n\n\t\t$products = \\App\\Product::all();\n \t$categories = \\App\\Category::all();\n \t$brands = \\App\\Brand::all();\n \t$colors = \\App\\Color::all();\n\n\t\tforeach ($products as $product) {\n\t\t\t$product->colors()->sync($colors->random(3));\n\n\t\t\t$product->category()->associate($categories->random(1)->first());\n\t\t\t$product->brand()->associate($brands->random(1)->first());\n\n\t\t\t$product->save();\n\t\t}\n\n\t\t// for ($i = 0; $i < count($products); $i++) {\n\t\t// \t$cat = $categories[rand(0,5)];\n\t\t// \t$bra = $brands[rand(0,7)];\n\t\t// \t$cat->products()->save($products[$i]);\n\t\t// \t$bra->products()->save($products[$i]);\n\t\t// }\n\n\t\t// $products = factory(App\\Product::class)->times(20)->create();\n\t\t// $categories = factory(App\\Category::class)->times(6)->create();\n\t\t// $brands = factory(App\\Brand::class)->times(8)->create();\n\t\t// $colors = factory(App\\Color::class)->times(15)->create();\n\t}", "public function run()\n {\n /*$this->call(UsersTableSeeder::class);\n $this->call(GroupsTableSeeder::class);\n $this->call(TopicsTableSeeder::class);\n $this->call(CommentsTableSeeder::class);*/\n DB::table('users')->insert([\n 'name' => 'pkw',\n 'email' => 'pkw@pkw.com',\n 'password' => bcrypt('secret'),\n 'type' => '1'\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker = Faker::create();\n foreach (range(1,200) as $index) {\n DB::table('users')->insert([\n 'name' => $faker->name,\n 'email' => $faker->email,\n 'phone' => $faker->randomDigitNotNull,\n 'address'=> $faker->streetAddress,\n 'password' => bcrypt('secret'),\n ]);\n }\n }", "public function run()\n {\n $this->call(UsersSeeder::class);\n User::factory(2)->create();\n Company::factory(2)->create();\n\n }", "public function run()\n {\n echo PHP_EOL , 'seeding roles...';\n\n Role::create(\n [\n 'name' => 'Admin',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Principal',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Teacher',\n 'deletable' => false,\n ]\n );\n\n Role::create(\n [\n 'name' => 'Student',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Parents',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Accountant',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Librarian',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Receptionist',\n 'deletable' => false,\n ]\n );\n\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // $this->call(QuestionTableSeed::class);\n\n $this->call([\n QuestionTableSeed::class,\n AlternativeTableSeed::class,\n ScheduleActionTableSeeder::class,\n UserTableSeeder::class,\n CompanyClassificationTableSeed::class,\n ]);\n // DB::table('clients')->insert([\n // 'name' => 'Empresa-02',\n // 'email' => 'empresa02@gmail.com',\n // 'password' => bcrypt('07.052.477/0001-60'),\n // ]);\n }", "public function run()\n {\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 5; $i++) {\n Runner::create([\n 'external_id' => $faker->uuid,\n 'name' => $faker->name,\n 'race_id' =>rand(1,5),\n 'age' => rand(30, 45),\n 'sex' => $faker->randomElement(['male', 'female']),\n 'color' => $faker->randomElement(['#ecbcb4', '#d1a3a4']),\n ]);\n }\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n\n User::factory()->create([\n 'name' => 'Carlos',\n 'email' => 'carlos@email.com',\n 'email_verified_at' => now(),\n 'password' => bcrypt('123456'), // password\n 'remember_token' => Str::random(10),\n ]);\n \n $this->call([PostsTableSeeder::class]);\n $this->call([TagTableSeeder::class]);\n\n }", "public function run()\n {\n $this->call(AlumnoSeeder::class);\n //Alumnos::factory()->count(30)->create();\n //DB::table('alumnos')->insert([\n // 'dni_al' => '13189079',\n // 'nom_al' => 'Jose',\n // 'ape_al' => 'Araujo',\n // 'rep_al' => 'Principal',\n // 'esp_al' => 'Tecnologia',\n // 'lnac_al' => 'Valencia'\n //]);\n }", "public function run()\n {\n Eloquent::unguard();\n\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n\n // $this->call([\n // CountriesTableSeeder::class,\n // ]);\n\n factory(App\\User::class, 100)->create();\n factory(App\\Type::class, 10)->create();\n factory(App\\Item::class, 100)->create();\n factory(App\\Order::class, 1000)->create();\n\n $items = App\\Item::all();\n\n App\\Order::all()->each(function($order) use ($items) {\n\n $n = rand(1, 10);\n\n $order->items()->attach(\n $items->random($n)->pluck('id')->toArray()\n , ['quantity' => $n]);\n\n $order->total = $order->items->sum(function($item) {\n return $item->price * $item->pivot->quantity;\n });\n\n $order->save();\n\n });\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n factory(User::class)->create(\n [\n 'email'=>'izzanniroshlei@gmail.com',\n 'name'=>'izzanni',\n \n ]\n );\n factory(User::class)->create(\n [\n 'email'=>'aina@gmail.com',\n 'name'=>'aina',\n\n ]\n );\n factory(User::class)->create(\n [\n 'email'=>'sab@gmail.com',\n 'name'=>'sab',\n\n ]\n );\n }", "public function run()\n {\n\n factory('App\\Models\\Pessoa', 60)->create();\n factory('App\\Models\\Profissional', 10)->create();\n factory('App\\Models\\Paciente', 50)->create();\n $this->call(UsersTableSeeder::class);\n $this->call(ProcedimentoTableSeeder::class);\n // $this->call(PessoaTableSeeder::class);\n // $this->call(ProfissionalTableSeeder::class);\n // $this->call(PacienteTableSeeder::class);\n // $this->call(AgendaProfissionalTableSeeder::class);\n }", "public function run()\n {\n //Acá se define lo que el seeder va a hacer.\n //insert() para insertar datos.\n //Array asociativo. La llave es el nombre de la columna.\n// DB::table('users')->insert([\n// //Para un solo usuario.\n// 'name' => 'Pedrito Perez',\n// 'email' => 'pedrito@juase.com',\n// 'password' => bcrypt('123456')\n// ]);//Se indica el nombre de la tabla.\n\n //Crea 50 usuarios (sin probar)\n// factory(App\\User::class, 50)->create()->each(function($u) {\n// $u->posts()->save(factory(App\\Post::class)->make());\n// });\n\n factory(App\\User::class, 10)->create(); //Así se ejecuta el model factory creado en ModelFactory.php\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n //nhập liệu mẫu cho bảng users\n DB::table('users')->insert([\n \t['id'=>'1001', 'name'=>'Phan Thị Hiền', 'email'=>'hienphan18112015@gmail.com', 'password'=>'123456', 'isadmin'=>1],\n \t['id'=>'1002', 'name'=>'Phan Thị Hà', 'email'=>'haphan@gmail.com', 'password'=>'111111', 'isadmin'=>0]\n ]);\n\n\n //nhập liệu mẫu cho bảng suppliers\n DB::table('suppliers')->insert([\n \t['name'=>'FPT', 'address'=>'151 Hùng Vương, TP. Đà Nẵng', 'phonenum'=>'0971455395'],\n \t['name'=>'Điện Máy Xanh', 'address'=>'169 Phan Châu Trinh, TP. Đà Nẵng', 'phonenum'=>'0379456011']\n ]);\n\n\n //Bảng phiếu bảo hành\n }", "public function run()\n {\n \t// DB::table('categories')->truncate();\n // factory(App\\Models\\Category::class, 10)->create();\n Schema::disableForeignKeyConstraints();\n Category::truncate();\n $faker = Faker\\Factory::create();\n\n $categories = ['SAMSUNG','NOKIA','APPLE','BLACK BERRY'];\n foreach ($categories as $key => $value) {\n Category::create([\n 'name'=>$value,\n 'description'=> 'This is '.$value,\n 'markup'=> rand(10,100),\n 'category_id'=> null,\n 'UUID' => $faker->uuid,\n ]);\n }\n }" ]
[ "0.8013876", "0.79804534", "0.7976992", "0.79542726", "0.79511505", "0.7949612", "0.794459", "0.7942486", "0.7938189", "0.79368967", "0.79337025", "0.78924936", "0.78811055", "0.78790957", "0.78787595", "0.787547", "0.7871811", "0.78701615", "0.7851422", "0.7850352", "0.7841468", "0.7834583", "0.7827792", "0.7819104", "0.78088796", "0.7802872", "0.7802348", "0.78006834", "0.77989215", "0.7795819", "0.77903426", "0.77884805", "0.77862066", "0.7778816", "0.7777486", "0.7765202", "0.7762492", "0.77623445", "0.77621746", "0.7761383", "0.77606887", "0.77596676", "0.7757001", "0.7753607", "0.7749522", "0.7749292", "0.77466977", "0.7729947", "0.77289546", "0.772796", "0.77167094", "0.7714503", "0.77140456", "0.77132195", "0.771243", "0.77122366", "0.7711113", "0.77109736", "0.7710777", "0.7710086", "0.7705484", "0.770464", "0.7704354", "0.7704061", "0.77027386", "0.77020216", "0.77008796", "0.7698617", "0.76985973", "0.76973504", "0.7696405", "0.7694293", "0.7692694", "0.7691264", "0.7690576", "0.76882726", "0.7687433", "0.7686844", "0.7686498", "0.7685065", "0.7683827", "0.7679184", "0.7678287", "0.76776296", "0.76767945", "0.76726556", "0.76708084", "0.76690495", "0.766872", "0.76686716", "0.7666299", "0.76625943", "0.7662227", "0.76613766", "0.7659881", "0.7656644", "0.76539344", "0.76535016", "0.7652375", "0.7652313", "0.7652022" ]
0.0
-1
Lists all StampCases models.
public function actionIndex() { $searchModel = new StampSearch(); $dataProvider = $searchModel->search(Yii::$app->request->queryParams); return $this->render('index', [ 'searchModel' => $searchModel, 'dataProvider' => $dataProvider, ]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function index()\n {\n return Campus::all();\n }", "public function index()\n {\n return Campus::onlyTrashed()->get();\n }", "public function index()\n {\n return Student::all();\n }", "public function index()\n {\n return Student::all();\n }", "public function actionIndex()\r\n {\r\n $searchModel = new CaseManagementSearch();\r\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\r\n \r\n return $this->render('index', [\r\n 'searchModel' => $searchModel,\r\n 'dataProvider' => $dataProvider,\r\n ]);\r\n }", "public function getModels();", "public function getModels();", "public function actionIndex()\n {\n $searchModel = new SuratSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function index()\n {\n $campuses = Campus::with('shiftTimings')->get();\n\n return view('admin.edit.shifttiminglist',\n ['campuses' => $campuses]);\n }", "public function index()\n {\n // return view('cinema::index');\n return $this->model->all();\n }", "public function index()\n\t{\n\t\t$cases = Case::all();\n\n\t\treturn View::make('cases.index', compact('cases'));\n\t}", "public function index()\n {\n $schools = School::all();\n\n return view('schools.index')->withSchools($schools);\n }", "public function viewallunitmodelsAction() {\n\n\t\t$model = new Unit_Model_UnitModel();\n\t\t$this->view->records = $model->fetchAll( 'name','ASC' );\n \n\t\tif( $this->view->records ) {\n $attached = $model->getAttachedModels();\n $this->view->attached = $attached;\n\t\t $this->view->paginator = $this->paginate( $this->view->records );\n }\n\t}", "public function index()\n {\n return $this->model->all();\n }", "public function actionIndex() {\n $searchModel = new SurveySearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n $surveyz = new Surveys();\n $surv = $surveyz->find()->orderBy(['survey_id' => SORT_ASC])->all();\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider, 'surv' => $surv,\n ]);\n }", "public function index()\n {\n $classes = ClassGroup::all();\n $students = Student::all();\n return view('admin.data_siswa.index', [\n 'classes' => $classes,\n 'students' => $students,\n ]);\n }", "public function index()\n {\n $skaters = Skater::all();\n return $skaters;\n }", "public function actionIndex()\n {\n $searchModel = new SkedSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function index(){\n return $this->model->all();\n }", "public function index()\n {\n $schools = School::orderBy('id', 'DESC')->get();\n return view('admin.schools.index', compact('schools'));\n }", "public function models()\n {\n $this->_display('models');\n }", "public function index()\n { \n $model = new StudentModel();\n \n $data['students'] = $model->orderBy('id', 'DESC')->findAll();\n \n return $this->respond($data);\n }", "public function index()\n {\n $stations = Station::paginate(20);\n return view('stations.index')->withStations($stations);\n }", "public function index()\n {\n $data = [\n 'stamps' => Stamp::get()\n ];\n \n return view('admin.stamps.index', $data);\n\n }", "public function index()\n {\n return Model::all();\n }", "public function index()\n {\n return Subject::with('course', 'curriculum', 'schedules')->get();\n }", "public function index()\n {\n $cities = City::all();\n return $this->showAll($cities);\n }", "public function index()\n {\n $sedes = \\App\\Sede::All(); //Variable que relaciona con el modelo, trae todo por el ::All\n return view('sede.index', compact('sedes'));\n }", "public function index() {\n $cities = City::all();\n return $cities;\n }", "public function index()\n {\n return Disciplina::all();\n }", "public function index()\n {\n $subjects = new ClassSubjectMap;\n return view('modules.school.ClassSubjectMap.list', compact('subjects'));\n }", "public function index()\n {\n $schools = schoolDetail::find('1')->toArray();\n return array_reverse($schools);\n }", "public function index()\n {\n return $this->model->getAll();\n }", "public function index()\n {\n //\n $sports = Sport::all();\n return $this->showAll($sports);\n }", "public function listtabelCSAction() {\n $this->view->tableList = $this->adm_listtabel_serv->getTableList('CURRENT SYSTEM');\n }", "public function index()\n {\n \n $train_station = TrainStation::all();\n return view('index', compact( 'train_station'));\n }", "public function index()\n {\n return Subjects::all();\n }", "public function allStudents()\n {\n\n $students = Student::all();\n return $students;\n\n\n\n }", "public function index()\n {\n $students = Student::all();\n return view('backend.student.index',compact('students'));\n }", "public function index()\n {\n $items = ZoznamStn::where('cisk', \" \")->orderBy('cist')->get();\n \n return view('z_stn.index1')->withItems($items);\n }", "public function opencasesAction()\n {\n $this->view->pageTitle = 'Open Cases';\n\n $service = new App_Service_Search();\n $userId = Zend_Auth::getInstance()->getIdentity()->user_id;\n $this->view->cases = $service->getOpenCasesByUserId($userId);\n }", "public function index()\n {\n $students = Student::simplePaginate(10);\n \n return view('students.list', compact('students'));\n }", "public function index()\n {\n $cases = Cas::latest()->where('user_id',auth()->user()->id)->get();\n return view('client.case.index',compact('cases'));\n }", "public function actionIndex()\n {\n $searchModel = new SfidaSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function indexAction()\n\t{\n\t\t$this->render( View::make( 'schools/index' , array(\n\t\t\t'title' => 'Mes &Eacute;coles',\n\t\t\t'entities' => School::all()\n\t\t) ) );\n\t}", "public function getAllStations(){\n return $this->stationRequest->getAllStations();\n }", "public function action_list()\n {\n if(($data = $this->check_student($this->request->param('id'))))\n {\n $data['year'] = isset($data['year']) ? $data['year'] : \n $data['student']->end_year;\n $data['current_class'] = $data['student']->class_id; \n \n if(is_null($data['current_class']) || \n $data['year'] != $data['student']->end_year)\n {\n $data['subjects_records'] = Model::factory('year_subject')->get_subject_records($data);\n $data['class'] = count($data['subjects_records']) > 0 ? \n $data['subjects_records'][0]->class : '';\n }\n else\n {\n $data['subjects_records'] = Model::factory('year_subject')\n ->get_subject_records_by_classname($data);\n $data['subjects'] = Model::factory('class_subject')\n ->get_subjects_by_class_id($data['student']->class->id);\n $data['class'] = $data['student']->class->level->name . $data['student']->class->name;\n $data['table_class'] = View::factory('academicrecords/tables/class', $data);\n }\n $data['period'] = Model::factory('setting')->get_value('academic_year');\n \n $data['table'] = $this->set_table($data);\n $this->setTitle('Academic Records')\n ->view('academicrecords/list', $data)\n ->render();\n }\n// else\n// throw new HTTP_Exception_404;\n }", "function index()\n {\n return $this->dp->getAllCinema();\n }", "public function index()\n {\n //\n $classes = StudentClass::all();\n return view('admin.class/index', ['classes' => $classes]);\n }", "public function actionIndex()\n {\n $searchModel = new DataSiswaSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function index()\n {\n $sightingRepository = EntityManager::getRepository(Sighting::class);\n\n return view(\"Sighting.index\", array('sightings' => $sightingRepository->findAll()));\n }", "protected function _getCasesList() {\n if (Pi::service('module')->isActive(CASES)) {\n try {\n $cases = Pi::api('api', CASES)->caseList();\n return $cases;\n } catch (\\Exception $exception) {\n return array();\n }\n }\n }", "public function index()\n {\n $student = Student::all();\n return $student;\n }", "public function actionIndex($cat_id=null) \n {\n\t\tif(!$cat_id){\n\t\t\treturn $this->redirect(['sponsor-category/index']);\n\t\t} else {\n\t\t\t$model = SponserCategory::findOne(['id' => $cat_id]);\n\t\t}\n $searchModel = new SponserSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams, $cat_id);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n\t\t\t'cat_id' => $cat_id,\n\t\t\t'catmodel' => $model,\n ]);\n }", "public function actionIndex()\n {\n $searchModel = new CampaignsSearch();\n\n $cond = \"user_id = \".Yii::$app->user->identity->id .\" and status != -1 \";\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams,$cond);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function index()\n {\n $city = City::all();\n\n return $this->showAll($city,City::class);\n }", "public function index()\n {\n $sources = Source::all();\n return view('sources.index', compact('sources', $sources));\n }", "public function index()\n {\n return Lessons::all();\n }", "public function index()\n {\n $sports = Sport::get();\n return SportResource::collection($sports);\n }", "public function index()\n {\n $students = Student::all();\n\n return view('backEnd.students.index', compact('students'));\n }", "public function actionIndex()\n {\n $searchModel = new LessonsSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n $teacher = Teachers::findOne(['user_id' => Yii::$app->user->id]);\n $groups = Groups::findAll(['teacher_id' => $teacher->id]);\n $ids = [];\n if(isset($groups)){\n foreach($groups as $group) {array_push($ids, $group['id']);}\n }\n $dataProvider->query->andWhere(['IN', 'group_id', $ids]);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function actionIndex()\n {\n $searchModel = new CampaignSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n \n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function findAllScolarite()\n\t{\t\n\t\t$scolarite = Model::findAll($orderBy = 'id_s', $orderDir = 'ASC', $limit = null, $offset = null);\n\t\treturn $scolarite;\n\t}", "public function show(Cases $cases)\n {\n //\n }", "public function index()\n {\n $this->authorize('viewAny', Continent::class);\n\n $continents = Continent::all();\n return $this->showAll($continents);\n }", "public function index()\n {\n $students = Student::cursor();\n return view('student.index', ['students' => $students]);\n }", "public function index()\n {\n return CustomerStep::all();\n }", "public function index()\n {\n $trucks = TruckTract::paginate();\n\n return TruckTractResource::collection($trucks);\n }", "function index()\n {\n $this->set('bands', $this->Band->find('all'));\n }", "public function index()\n {\n $customers = Customer::all();\n return $customers;\n }", "public function actionIndex()\n {\n $searchModel = new DaftarSmkSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function index()\n {\n $categories = $this->category_model->get();\n\n return $categories;\n }", "public function index()\n {\n $icmss = DB::table('icmss')\n ->orderBy('id', 'desc')\n ->paginate(6);\n\n return view('admin.icmss.index', compact('icmss'));\n }", "public function index()\n {\n return Conviction::all();\n }", "public function index()\n {\n //\n return view('clinics.index')->with([\n 'clinics' => Clinic::all(),\n '_clinic' => new Clinic()\n ]);\n }", "public function actionIndex()\n {\n $searchModel = new CampaignSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function index()\n {\n $sedes = Sede::orderBy('id', 'ASC')->paginate(3);\n\n return view('admin.sedes.index')->with('sedes', $sedes);\n }", "public function index()\n {\n $student_class = student_class::all();\n return view('school.classes.studentClass')->with('student_class',$student_class);\n \n }", "public function index()\n {\n $camp = Camps::all();\n return view('camp.index', compact('camp'));\n\n }", "public function index()\n {\n $testingCases = testing_case::paginate(25);\n\n return view('tables', compact('testingCases'));\n }", "public function index()\n {\n $students = Student::all(); \n return view('students.index', compact('students'));\n }", "public function index()\n {\n $campuses = Campus::orderBy( 'name' )->get();\n\n return view( 'campus.index', compact( 'campuses' ) );\n }", "public function index()\n {\n\t\t$objStaff = new Staff();\n\n\t\treturn $objStaff->all();\n\t}", "public function getAllStations() {\n $result=$this->con->query(\"SELECT * FROM station;\");\n \n return $result;\n }", "public function index()\n {\n $input = Request::all();\n\n $spent = $this->repo->getSpents($input);\n\n $limit = isset($input['limit']) ? $input['limit'] : config('jp.pagination_limit');\n\n if (!$limit) {\n $spent = $spent->get();\n\n return ApiResponse::success($this->response->collection($spent));\n }\n\n $spent = $spent->paginate($limit);\n\n return ApiResponse::success($this->response->paginatedCollection($spent));\n }", "public function index()\n {\n $camps = Camp::paginate(24);\n return view('camps.index', ['camps' => $camps]);\n }", "public function index()\n {\n $schools = School::all();\n return view(\"school.index\",['schools' =>$schools]);\n }", "public function index()\n {\n \t$schools = \\DB::table('schools')->get();\n \t\n return view('admin.uniform.index',compact('schools'));\n }", "public function actionIndex()\n {\n $dataProvider = new ActiveDataProvider([\n 'query' => InsightsDef::find(),\n ]);\n\n return $this->render('index', [\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function index()\n {\n //返回集合\n return new ContinentCollection(Continent::paginate(null));\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $stades = $em->getRepository('AppBundle:Stade')->findAll();\n\n return $this->render('stade/index.html.twig', array(\n 'stades' => $stades,\n ));\n }", "public function actionIndex()\n {\n $searchModel = new LessonsSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function index()\n {\n $swimmers= Swimmer::all();\n return SwimmerResource::collection($swimmers);\n \n\n }", "public function index()\n {\n return Industry::all();\n }", "public function index()\n {\n $data['active_class'] = 'academic';\n $data['title'] = getPhrase('student_list');\n\n $data['academic_years'] = addSelectToList(getAcademicYears());\n $list = App\\Course::getCourses(0);\n\n $data['layout'] = getLayout();\n $data['module_helper'] = getModuleHelper('student-list');\n\n return view('student.list', $data);\n }", "public function actionList()\r\n {\r\n $this->_userAutehntication();\r\n switch($_GET['model'])\r\n {\r\n case 'posts': \r\n $models = Post::model()->findAll();\r\n break; \r\n default: \r\n $this->_sendResponse(501, sprintf('Error: Mode <b>list</b> is not implemented for model <b>%s</b>',$_GET['model']) );\r\n exit; \r\n }\r\n if(is_null($models)) {\r\n $this->_sendResponse(200, sprintf('No Post found for model <b>%s</b>', $_GET['model']) );\r\n } else {\r\n $rows = array();\r\n foreach($models as $model)\r\n $rows[] = $model->attributes;\r\n\r\n $this->_sendResponse(200, CJSON::encode($rows));\r\n }\r\n }", "public function caseList( $slug = null ) {\n\t\tif ( $slug != null ) {\n\t\t\treturn $this->caseDetail( $slug );\n\t\t}\n\t\t$page = \\request()->input( 'page', 0 );\n\t\t$data[\"cases\"] = SM::getCache( 'case' . $page, function () {\n\t\t\t$case_posts_per_page = SM::smGetThemeOption(\n\t\t\t\t\"case_posts_per_page\",\n\t\t\t\t12\n\t\t\t);\n\n\t\t\treturn Cases::with( \"categories\", \"tags\" )\n\t\t\t ->where( \"status\", 1 )\n\t\t\t ->paginate( $case_posts_per_page );\n\t\t}, [ 'case' ] );\n\t\t$data[\"categories\"] = [];\n\t\tif ( count( $data[\"cases\"] ) > 0 ) {\n\t\t\tforeach ( $data[\"cases\"] as $case ) {\n\t\t\t\tif ( isset( $case->categories ) && count( $case->categories ) > 0 ) {\n\t\t\t\t\tforeach ( $case->categories as $cat ) {\n\t\t\t\t\t\t$data[\"categories\"][ $cat->id ] = $cat->title;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$data['seo_title'] = SM::smGetThemeOption( \"case_seo_title\" );\n\t\t$data['meta_description'] = SM::smGetThemeOption( \"case_meta_keywords\" );\n\t\t$data['meta_description'] = SM::smGetThemeOption( \"case_meta_description\" );\n\n\t\treturn view( \"page.case_list\", $data );\n\t}", "public function index(){\n\t\t$result=$this->ctRepo->all();\n\n\t\treturn view('centrotrabajo.listCCT',compact('result'));\n\t}", "public function actionIndex()\n {\n $searchModel = new StSpdSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n // Only show pegawai based on curent user instansi\n if(Yii::$app->user->identity->role!=99){\n $dataProvider->query->andFilterWhere(['su_st_spd.id_instansi' => Yii::$app->user->identity->id_instansi]);\n }\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function index() {\n $templates = Template::all();\n return $templates;\n }" ]
[ "0.579719", "0.5765497", "0.5690944", "0.5690944", "0.55975443", "0.5453654", "0.5453654", "0.53929347", "0.53874546", "0.53729373", "0.53716", "0.5361093", "0.5346803", "0.5346249", "0.5322018", "0.5319718", "0.53157985", "0.5306652", "0.52988595", "0.5297581", "0.52885205", "0.52881944", "0.5270924", "0.5265287", "0.5245687", "0.5228612", "0.5214917", "0.52145886", "0.52097225", "0.520566", "0.51962274", "0.5180592", "0.51628757", "0.51622975", "0.5161119", "0.5157019", "0.51469517", "0.5138845", "0.51378185", "0.51371473", "0.51314145", "0.5130911", "0.5119114", "0.5109798", "0.50961864", "0.50898534", "0.507425", "0.5068423", "0.5067129", "0.50628644", "0.5062031", "0.5061353", "0.50584733", "0.50579685", "0.5057634", "0.505707", "0.50518084", "0.5048435", "0.5046945", "0.5046438", "0.50445086", "0.5039957", "0.50387144", "0.5038494", "0.50339186", "0.5030445", "0.50272685", "0.5017819", "0.5012255", "0.501069", "0.50105006", "0.5010073", "0.5008393", "0.5006691", "0.50063616", "0.5001385", "0.49994949", "0.49991444", "0.49974018", "0.49962166", "0.4994839", "0.49928066", "0.49922603", "0.49908173", "0.49900156", "0.49889633", "0.49858403", "0.49855173", "0.49820906", "0.49818847", "0.49806428", "0.49787253", "0.4978618", "0.49759802", "0.49749947", "0.49740103", "0.497204", "0.49638444", "0.496295", "0.4961298" ]
0.62956685
0
Displays a single StampCases model.
protected function saveImage($previous_image = '') { $image = UploadedFile::getInstanceByName('image'); if ($image) { $file = pathinfo($image->name); $filename = uniqid().'.'.$file['extension']; $path = Yii::getAlias('@webroot').'/images/stamp/'; if($image->saveAs($path.$filename)){ if ($previous_image !== '') { unlink($path . $previous_image); } return $filename; } }else{ return ''; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function show(Cases $cases)\n {\n //\n }", "public function actionViewByStaf($id){\n return $this->render('viewByStaf',[\n 'model' => $this->findModel($id),\n ]);\n }", "public function actionIndex()\n {\n $searchModel = new StampSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function show()\r\n {\r\n return view('mpcs::show');\r\n }", "public function opencasesAction()\n {\n $this->view->pageTitle = 'Open Cases';\n\n $service = new App_Service_Search();\n $userId = Zend_Auth::getInstance()->getIdentity()->user_id;\n $this->view->cases = $service->getOpenCasesByUserId($userId);\n }", "public function show()\n {\n $students = Student::all();\n return view('admin.students.index', compact('students', 'class'));\n }", "public function show($id) {\n\t\t$model = Cases::with('acts', 'hearing_dates')->findOrFail($id);\n\t\treturn view('case.show', compact('model'));\n\t}", "public function show(Suitcase $suitcase)\n {\n //\n }", "public function showAction($id)\n\t{\n\t\t$school = School::find( $id );\n\t\t$this->render( View::make( 'schools/show', array(\n\t\t\t'title' => $school->name,\n\t\t\t'entity' => $school,\n\t\t\t'locations' => $school->locations()\n\t\t) ) );\n\t}", "public function index()\n\t{\n\t\t$cases = Case::all();\n\n\t\treturn View::make('cases.index', compact('cases'));\n\t}", "public function actionViewsurat($id)\n {\n $searchModel = new SuratSearch();\n // $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n $query = Surat::find()->where(['id_kasus'=>$id]);\n $dataProvider = new ActiveDataProvider([\n 'query' => $query,\n ]);\n\n return $this->render('viewsurat', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n 'id' => $id\n ]);\n // return $this->render('view', [\n // 'model' => $this->findModel($id),\n // ]);\n }", "public function indexAction()\n\t{\n\t\t$this->render( View::make( 'schools/index' , array(\n\t\t\t'title' => 'Mes &Eacute;coles',\n\t\t\t'entities' => School::all()\n\t\t) ) );\n\t}", "public function show($id)\n {\n return view('site.schoolClass.show', ['id' => $id]);\n }", "public function index()\n {\n $cases = Cas::latest()->where('user_id',auth()->user()->id)->get();\n return view('client.case.index',compact('cases'));\n }", "public function show($id)\n\t{\n\t\t$case = Case::findOrFail($id);\n\n\t\treturn View::make('cases.show', compact('case'));\n\t}", "public function actionViewByHrdStaf($id){\n return $this->render('viewByHrdStaf',[\n 'model' => $this->findModel($id),\n ]);\n }", "public function index()\n {\n $student_class = student_class::all();\n return view('school.classes.studentClass')->with('student_class',$student_class);\n \n }", "public function show(Student $student)\n {\n //\n }", "public function show(Student $student)\n {\n //\n }", "public function show(Student $student)\n {\n //\n }", "public function show(Student $student)\n {\n //\n }", "public function show(Student $student)\n {\n //\n }", "public function show(Student $student)\n {\n //\n }", "public function show(Student $student)\n {\n //\n }", "public function show(Student $student)\n {\n //\n }", "public function show(Student $student)\n {\n //\n }", "public function show(Student $student)\n {\n //\n }", "public function show(Student $student)\n {\n //\n }", "public function show(Student $student)\n {\n //\n }", "public function show(Student $student)\n {\n //\n }", "public function show(Student $student)\n {\n //\n }", "public function viewcaseAction()\n {\n // If no ID was provided, bail out.\n if (!$this->_hasParam('id')) {\n throw new UnexpectedValueException('No ID parameter provided');\n }\n\n // Fetch client data for display.\n $identity = Zend_Auth::getInstance()->getIdentity();\n $userId = $identity->user_id;\n $role = $identity->role;\n\n $service = new App_Service_Member();\n\n $case = $service->getCaseById($this->_getParam('id'));\n $comments = $service->getCommentsByCaseId($case->getId());\n $users = self::fetchMemberOptions($service);\n\n // A case is displayed read-only if it's closed, and also if the user is not a normal member\n // (e.g., if they're a treasurer).\n $readOnly = ($case->getStatus() === 'Closed' || $role === App_Roles::TREASURER);\n\n // Initialize the case view form.\n $this->view->pageTitle = 'View Case';\n $this->view->form = new Application_Model_Member_ViewCaseForm(\n $userId, $case, $comments, $users, $readOnly);\n\n // If this isn't a POST request, populate the form from the database and bail out.\n $request = $this->getRequest();\n\n if (!$request->isPost()) {\n $this->view->form->setNeeds($case->getNeeds());\n $this->view->form->setVisits($case->getVisits());\n return;\n }\n\n // Repopulate the form with POST data.\n $data = $request->getPost();\n $this->view->form->preValidate($data);\n $this->view->form->populate($data);\n\n if (!$this->view->form->isChangeNeedsRequest($data)) {\n $this->view->form->setNeeds($case->getNeeds());\n }\n\n if (!$this->view->form->isChangeVisitsRequest($data)) {\n $this->view->form->setVisits($case->getVisits());\n }\n\n // If the user is adding or removing needs/visits or form validation fails, bail out.\n if ($this->view->form->handleAddRemoveRecords($data)\n || !$this->view->form->isValid($data)) {\n return;\n }\n\n // Handle requests to close the case.\n if ($this->view->form->isCloseCaseRequest($data)) {\n $service->closeCaseById($case->getId());\n }\n\n // Handle requests to add, edit, and/or remove case needs.\n if ($this->view->form->isChangeNeedsRequest($data)) {\n $changedNeeds = $this->view->form->getChangedNeeds();\n $removedNeeds = $this->view->form->getRemovedNeeds();\n\n self::updateCaseNeeds($case, $changedNeeds, $removedNeeds);\n\n // Check for violations of parish limits.\n if (!$this->_getParam('skipLimitCheck')) {\n $limitService = new App_Service_Limit();\n $needErrorMsg = self::getNeedLimitErrorMsg($limitService, $case);\n\n if ($needErrorMsg) {\n $this->_helper->flashMessenger(array(\n 'type' => 'error',\n 'text' => \"$needErrorMsg.\",\n ));\n }\n\n if ($needErrorMsg !== null) {\n $this->_helper->flashMessenger(array(\n 'text' =>\n 'These case needs exceed parish limits.'\n . ' Submit again to change needs anyway.',\n 'noEscape' => true,\n ));\n $this->view->form->setLimitViolation(true);\n return;\n }\n }\n\n // Ensure that the case will be left with at least one need.\n if (!$case->getNeeds()) {\n $this->_helper->flashMessenger(array(\n 'type' => 'error',\n 'text' => 'A case must have at least one need.',\n ));\n return;\n }\n\n // If no limit violations occurred (or we skipped the check), then we need to write the\n // new needs to the database.\n foreach ($changedNeeds as $changedNeed) {\n $service->changeCaseNeed($case->getId(), $changedNeed);\n }\n $service->removeCaseNeeds($removedNeeds);\n }\n\n // Handle requests to add, edit, and/or remove case visits.\n if ($this->view->form->isChangeVisitsRequest($data)) {\n foreach ($this->view->form->getChangedVisits() as $changedVisit) {\n $service->changeCaseVisit($case->getId(), $changedVisit);\n }\n $service->removeCaseVisits($this->view->form->getRemovedVisits());\n }\n\n // Handle requests to add case comments.\n $comment = $this->view->form->getAddedComment($data);\n\n if ($comment !== null) {\n $service->createCaseComment($case->getId(), $comment);\n }\n\n // Redirect back to view case action to display updated case data.\n $this->_helper->redirector('viewCase', App_Resources::MEMBER, null, array(\n 'id' => $case->getId(),\n ));\n }", "public function show($id)\n {\n return view('school::show');\n }", "public function show() {\n // without an id we just redirect to the error page as we need the post id to find it in the database\n if (!isset($_GET['id']))\n return call('pages', 'error404');\n\n // we use the given id to get the right post\n $schools = School::find($_GET['id']);\n require_once('views/school/show.php');\n }", "public function show(Cas $cas)\n {\n return view('client.case.show',compact('cas'));\n }", "public function index()\n {\n $schools = School::orderBy('id', 'DESC')->get();\n return view('admin.schools.index', compact('schools'));\n }", "public function showAction() {\n $model = new Application_Model_Compromisso();\n //busco o id que eu quero ver\n $comp = $model->find($this->_getParam('id'));\n //crio uma view para o id referente;\n $this->view->assign(\"compromisso\", $comp);\n }", "public function index()\n {\n \n $data=DB::table('showcases')->select(['S_id','S_name','S_link','S_image'])->get();\n return view('admin.showcase.view',['data'=>$data]);\n }", "public function show($id)\n {\n $students = Student::where('class_id',$id)->get()->sortByDesc('created_at');\n return view('students.show')->with('students',$students);\n }", "public function show(asesor $asesor)\n {\n //\n }", "public function actionView()\n {\n $id=(int)Yii::$app->request->get('id');\n return $this->render('view', [\n 'model' => $this->findModel($id),\n ]);\n }", "public function index()\n {\n \t$schools = \\DB::table('schools')->get();\n \t\n return view('admin.uniform.index',compact('schools'));\n }", "public function show(Cour $cour)\n {\n //\n }", "public function index()\n {\n $campuses = Campus::with('shiftTimings')->get();\n\n return view('admin.edit.shifttiminglist',\n ['campuses' => $campuses]);\n }", "public function surfaceAction() {\n\tif($this->_getparam('id',false)) {\n\t$surfaces = new Surftreatments();\n\t$this->view->surfaces = $surfaces->getSurfaceTreatmentDetails($this->_getParam('id'));\n\t$this->view->counts = $surfaces->getSurfaceCounts($this->_getParam('id'));\n\t} else {\n\t\tthrow new Pas_Exception_Param($this->_missingParameter);\n\t}\n\t}", "public function actionIndex()\n {\n $searchModel = new SuratSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function show(Stud $stud)\n {\n return view('Students.stud');\n }", "public function actionView()\n\t{\n\t\t$model = $this->loadModel();\n\t\t$this->render('view',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}", "public function index()\n {\n $data = [\n 'stamps' => Stamp::get()\n ];\n \n return view('admin.stamps.index', $data);\n\n }", "public function actionView() {\n $this->render('view', array(\n 'model' => $this->loadModel(),\n ));\n }", "public function index()\n {\n $items = ZoznamStn::where('cisk', \" \")->orderBy('cist')->get();\n \n return view('z_stn.index1')->withItems($items);\n }", "public function show(students $students)\n {\n //\n }", "public function actionIndex()\n {\n\t\t$id = 1;\n return $this->render('/backend/siteinfo/view', [\n 'model' => $this->findModel($id),\n ]);\n }", "public function show(School $school)\n {\n //\n }", "public function show(School $school)\n {\n //\n }", "public function show()\n {\n return view('scaffold::show');\n }", "public function index()\n {\n return view('admin/school/detail/school_student.index');\n }", "public function show(student $student)\n {\n //\n }", "public function index()\n {\n return view('site.schoolClass.index');\n }", "public function actionView()\n {\n $this->render('view', array(\n 'model' => $this->loadModel(),\n ));\n }", "public function actionIndex()\r\n {\r\n $searchModel = new CaseManagementSearch();\r\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\r\n \r\n return $this->render('index', [\r\n 'searchModel' => $searchModel,\r\n 'dataProvider' => $dataProvider,\r\n ]);\r\n }", "public function show($id)\n {\n return view('school.show');\n }", "public function actionView($id) {\n $model = $this->findModel($id);\n return $this->render('view', [\n 'model' => $model,\n 'modelDetails' => $model->creditDetails\n ]);\n }", "public function show(Contest $contest)\n {\n //\n }", "public function index(){\n\n $cases = Cases::all();\n\n return view ('tasks',[\n 'cases'=> $cases,\n ]);\n }", "public function show(ContinuousAssessment $continuousAssessment)\n {\n //\n }", "public function show($id)\n {\n $estampa = $this->repository->find($id);\n\n return view('admin.estampas.show', compact('estampa'));\n }", "public function show($id)\n {\n $school = school::find($id);\n return view('schools.show')->withSchool($school);\n }", "public function actionView($id)\n {\n $model = $this->findModel($id);\n $providerTabelleSwPl = new \\yii\\data\\ArrayDataProvider([\n 'allModels' => $model->tabelleSwPls,\n ]);\n return $this->render('view', [\n 'model' => $this->findModel($id),\n 'providerTabelleSwPl' => $providerTabelleSwPl,\n ]);\n }", "public function show($id)\n {\n $data['id'] = $id;\n $data['menu'] = 'stamp';\n $data['stamps'] = Stamp::where('subcategory_id',$id)/*->leftjoin('images','images.stamp_id','=','stamps.id')*/->get();\n //$data['subcategory'] = Stamp::getSubCategory($id);\n return view('stamps.show', $data);\n }", "public function display($tpl = null) {\n //-- Get some data from the model\n $model =& $this->getModel();\n\n $lowestYear = $model->yearMin();\n $highestYear = $model->yearMax();\n $tournaments = $model->tournaments();\n $competitionTypes = $model->competitionTypes();\n \n $this->assignRef('lowestYear', $lowestYear);\n $this->assignRef('highestYear', $highestYear);\n $this->assignRef('tournaments', $tournaments);\n $this->assignRef('competitionTypes', $competitionTypes);\n \n parent::display($tpl);\n\n }", "public function actionView($id)\r\n\t{\r\n\t\t// sets global studyId for authoring\r\n \t\t$this->studyId = $id;\r\n\r\n\t\t$this->render('view',array(\r\n\t\t\t'model'=>$this->loadModel($id),\r\n\t\t));\r\n\t}", "public function index()\n {\n $schools = School::all();\n\n return view('schools.index')->withSchools($schools);\n }", "function run() {\n\t\t$view = new View();\n\t\t\n\t\t$students = new Student();\n\t\tif ($view->students_tbl = $students->get_students_as_tbl_arr() ) {\n\t\t\t$view->error = $students->get_error();\n\t\t}\n\n\t\t$view->student_desc = $students->get_student_desc();\n\t\t$view->render('main_page.php');\n\t}", "public function showstudentsAction() { \r\n $students = $this->getDoctrine()\r\n ->getRepository(Student::class)\r\n ->findAll();\r\n\r\n foreach ($students as $student) {\r\n $student->getClassroom();\r\n }\r\n\r\n return $this->render('admin/admin-student/adminStudentDashboard.html.twig', [\r\n 'students' => $students,\r\n ]);\r\n }", "public function show(Districts $districts)\n {\n //\n }", "public function show(Sprint $sprint)\n {\n //\n }", "public function show(Sprint $sprint)\n {\n //\n }", "public function show($id)\n {\n $icms = DB::table('icmss')->where('id', $id)->first();\n\n if (!$icms) \n return redirect()->back();\n\n return view('admin.icmss.show', compact('icms'));\n }", "public function show(Lessons $lessons)\n {\n //\n }", "public function show($id)\n {\n $teste = ModelProf::find(1)->MultiDisciplinas;\n\n return view('show', compact('teste'));\n\n\n }", "public function show($ClassInfoID)\n {\n $Classname = Classes::where('SchoolCode',auth()->user()->SchoolCode)->lists('ClassName','ClassID');\n $Year = year_term_setup::where('year_term_setups.SchoolCode',auth()->user()->SchoolCode)->lists('Year','Year');\n $Term = year_term_setup::where('year_term_setups.SchoolCode',auth()->user()->SchoolCode)->leftjoin('terms','year_term_setups.TermID','=','terms.TermID')->lists('terms.TermName','year_term_setups.TermID');\n\n $rows = classinfo::find($ClassInfoID);\n if(is_null($rows)){\n Session::flash('message','record could not be found!');\n Session::flash('alert_class','alert_warning');\n return redirect('classinfo');\n }\n\n \n return view('Classinfo.show',compact('rows','staff','building','Classname','Year','Term'));\n }", "public function show(schoolDetail $schoolDetail)\n {\n //\n }", "public function index()\n\n {\n $students=Student::all();\n return view('control panel.student.index',compact('students'));\n //\n }", "public function index()\n {\n return view('admin.schools.index');\n }", "public function index()\n {\n $students = Students::all();\n return view('students/show',['data_students'=>$students]);\n }", "public function viewAction()\n {\n $id = $this->_getPrimaryId();\n $row = $this->_getRow($id);\n\n $this->view->row = $row;\n }", "public function index()\n {\n $schools = School::all();\n return view(\"school.index\",['schools' =>$schools]);\n }", "function viewStory() {\n // Make sure the story is set to publish before displaying.\n if ($this->story->published == 1) {\n\n $picture = new Picture();\n $picture->load(['id = ?', $this->story->picture_id]);\n $page = $this->db->exec('SELECT MIN(page_number) as firstPage FROM pages WHERE story_id = ?', $this->story->id);\n\n $this->assign('story', $this->story);\n $this->assign('role', $this->getAuthorizationStatus());\n $this->assign('contentTitle', $this->story->title);\n $this->assign('pageTitle', $this->story->title);\n $this->assign('firstPage', $page[0]['firstPage']);\n $this->assign('filename', $picture->filename);\n $this->display('viewStory.tpl');\n }\n else {\n // Otherwise send to 404.\n $this->f3->error(404);\n }\n }", "public function index()\n {\n $sedes = \\App\\Sede::All(); //Variable que relaciona con el modelo, trae todo por el ::All\n return view('sede.index', compact('sedes'));\n }", "public function show(ScsRequest $scsRequest)\n {\n //\n }", "public function actionView()\n\t{\n\t\tif (!($model = $this->loadModel()))\n\t\t\treturn;\n\t\t$this->render('view',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}", "public function show(Sample $sample)\n {\n //\n }", "public function surfacesAction() {\n\t$surfaces = new Surftreatments();\n\t$this->view->surfaces = $surfaces->getSurfaceTreatments();\n\t}", "public function actionShow()\r\n\t{\r\n\t\t$this->render('show',array('model'=>$this->loadcontent()));\r\n\t}", "public function show(StudentClass $studentClass)\n {\n //\n }", "public function actionView()\n\t{\n\t\t$this->render('view',array(\n\t\t\t'model'=>$this->loadModel(),\n\t\t));\n\t}", "public function actionView()\n\t{\n\t\t$this->render('view',array(\n\t\t\t'model'=>$this->loadModel(),\n\t\t));\n\t}", "public function actionView()\n\t{\n\t\t$this->render('view',array(\n\t\t\t'model'=>$this->loadModel(),\n\t\t));\n\t}", "public function actionView()\n\t{\n\t\t$this->render('view',array(\n\t\t\t'model'=>$this->loadModel(),\n\t\t));\n\t}", "public function actionView()\n\t{\n\t\t$this->render('view',array(\n\t\t\t'model'=>$this->loadModel(),\n\t\t));\n\t}" ]
[ "0.648739", "0.6238579", "0.6132778", "0.6095805", "0.60404056", "0.60293174", "0.5992311", "0.5958481", "0.59164536", "0.59089273", "0.5868887", "0.58658725", "0.5841568", "0.58179265", "0.5793416", "0.57894105", "0.57458043", "0.57282174", "0.57282174", "0.57282174", "0.57282174", "0.57282174", "0.57282174", "0.57282174", "0.57282174", "0.57282174", "0.57282174", "0.57282174", "0.57282174", "0.57282174", "0.57282174", "0.5695839", "0.5688869", "0.56742203", "0.5654945", "0.5652095", "0.56369925", "0.5634283", "0.56329566", "0.5629245", "0.5619101", "0.56138057", "0.5610737", "0.56098276", "0.56062824", "0.56008583", "0.5598616", "0.5593891", "0.55878496", "0.5587274", "0.55870813", "0.5585596", "0.5585127", "0.55823165", "0.55823165", "0.55815333", "0.55792034", "0.5575617", "0.5575323", "0.5569641", "0.5564705", "0.5563505", "0.5562369", "0.5557248", "0.55561006", "0.55552524", "0.55546284", "0.5553058", "0.55520207", "0.5545445", "0.5539071", "0.5535702", "0.5534306", "0.55291843", "0.55208737", "0.55150104", "0.55137587", "0.55137587", "0.5511087", "0.5506904", "0.5504028", "0.5503462", "0.55033016", "0.5501857", "0.5500438", "0.5492946", "0.54855454", "0.54820037", "0.54800755", "0.54758394", "0.54735076", "0.54713595", "0.5467011", "0.54638743", "0.5462453", "0.5461836", "0.54609764", "0.54609764", "0.54609764", "0.54609764", "0.54609764" ]
0.0
-1
Creates a new StampTypes model. If creation is successful, the browser will be redirected to the 'view' page.
public function actionCreate() { $model = new Stamp(); if (Yii::$app->request->isAjax && $model->load(Yii::$app->request->post())) { Yii::$app->response->format = \yii\web\Response::FORMAT_JSON; return ActiveForm::validate($model); } if ($model->load(Yii::$app->request->post())) { $model->image = $this->saveImage(); if ($model->save()) { Yii::$app->getSession()->setFlash('', ['type'=>'success','message' => 'Информация сохранена']); return $this->redirect(['index']); } } return $this->renderAjax('form_modal', [ 'model' => $model, ]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function actionCreate()\n {\n $model = new GiftcodeType();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function actionCreate()\n\t{\n\t\t$model=new Solicitudes;\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t// $this->performAjaxValidation($model);\n\n\t\tif(isset($_POST['Solicitudes']))\n\t\t{\n\t\t\t$model->attributes=$_POST['Solicitudes'];\n\t\t\tif($model->save())\n\t\t\t\t$this->redirect(array('view','id'=>$model->id));\n\t\t}\n\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}", "public function create()\n {\n //\n return view('studentType.create');\n }", "public function create()\n {\n return view('sporttypes.create');\n }", "public function actionCreate()\n {\n $model = new Post();\n $post_types = ArrayHelper::map(PostType::find()->orderBy('name')->all(), 'id', 'name');\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n 'post_types' => $post_types,\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new CompPrep;\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n 'types' => $model->getTypes(),\n ]);\n }\n }", "public function actionCreate()\n {\n // $model = new StSpd();\n\n // if ($model->load(Yii::$app->request->post()) && $model->save()) {\n // return $this->redirect(['view', 'id' => $model->id]);\n // }\n\n // return $this->render('create', [\n // 'model' => $model,\n // ]);\n\n $model = new StSpd();\n $modelsAnggota = [new StSpdAnggota];\n $model->setScenario(StSpd::SCENARIO_INSERT);\n\n // Only admin can change pegawai instansi otherwise auto_fill_instansi_with_user\n if(Yii::$app->user->identity->role==99){\n $model->setScenario(StSpd::SCENARIO_ADMIN);\n $model->detachBehavior(\"auto_fill_instansi_with_user\");\n }\n\n if ($model->loadAll(Yii::$app->request->post()) && $model->saveAll()) {\n $model->createDocx();\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n 'modelsAnggota' => (empty($modelsAnggota)) ? [new StSpdAnggota] : $modelsAnggota\n ]);\n }\n\n }", "public function actionCreate()\n {\n $model = new StandartOne();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function create()\n {\n $types = Type::all();\n return view('admin.addtype');\n }", "public function actionCreate()\n {\n $model = new Student();\n \n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function AddClassType()\n\t{\n\t\t//Getting school_id\n\t\t$school_id = Auth::user()->school_id;\n\t\t$name = Input::get('name');\n\n\t\t//Creates a new class type \n\t\t$ClassType = ClassType::create(array('name'=>$name,'school_id'=>$school_id));\n\n\t\t//redirects to ViewClassType action\n\t\treturn Redirect::action('ViewClassTypesController@ViewClassTypes');\n\t}", "public function actionCreate()\n {\n $model = new WeichatPushSetTemplatePushList();\n\n $date_tiem = date(\"Y-m-d H:i:s\",time());\n $model->created_time = $date_tiem;\n $model->updated_time = $date_tiem;\n $model->status = 1;\n $model->create_user = Yii::$app->user->id;\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\r\n\t{\r\n\t\t$model=new Study;\r\n\r\n\t\t// Uncomment the following line if AJAX validation is needed\r\n\t\t// $this->performAjaxValidation($model);\r\n\r\n\t\tif(isset($_POST['Study']))\r\n\t\t{\r\n\t\t\t$model->attributes=$_POST['Study'];\r\n\t\t\tif($model->save())\r\n\t\t\t\t$this->redirect(array('view','id'=>$model->id));\r\n\t\t}\r\n\r\n\t\t$this->render('create',array(\r\n\t\t\t'model'=>$model,\r\n\t\t));\r\n\t}", "public function actionCreate() {\n $model = new Stakeholder();\n\n if ($model->load(Yii::$app->request->post())) {\n $model->datecreated = Date('Y-m-d h:i:sa');\n\n if ($model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function create()\n {\n\n $types = Type::all();\n return view('warbands.create', ['types' => $types]);\n }", "public function actionCreate()\n {\n $model = new DrpMaterialType();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function create()\n {\n return view('salery_types.create');\n }", "public function actionCreate() {\r\n $model = new Statements;\r\n\r\n // Uncomment the following line if AJAX validation is needed\r\n // $this->performAjaxValidation($model);\r\n\r\n if (isset($_POST['Statements'])) {\r\n $model->attributes = $_POST['Statements'];\r\n if ($model->save())\r\n $this->redirect(array('view', 'id' => $model->idStatement));\r\n }\r\n\r\n $this->render('create', array(\r\n 'model' => $model,\r\n ));\r\n }", "public function actionCreate()\n {\n $model = new ListRegionType();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n $getParams = Yii::$app->getRequest()->get();\n $model->generateDefaults($getParams);\n return $this->render('form', ['model' => $model]);\n }\n }", "public function actionCreate()\r\n {\r\n $model = new Attributes();\r\n\r\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\r\n return $this->redirect(['view', 'id' => $model->id]);\r\n } else {\r\n $typeFields = ArrayHelper::map(TypeFields::find()->asArray()->orderBy('name')->all(), 'id', 'name');\r\n\r\n return $this->render('create', [\r\n 'model' => $model,\r\n 'typeFields' => $typeFields\r\n ]);\r\n }\r\n }", "public function actionCreate()\n {\n $model = new StoreTransfer();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function actionCreate()\n {\n $model = new States();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new FeedbackType();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n \tYii::$app->getSession()->setFlash('success', $model->fkt_form_name.' '.$model->fkt_list_name.' 添加成功,结果将展示在列表。');\n return $this->redirect(['index']);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new InfoSpares;\n // Uncomment the following line if AJAX validation is needed\n $this->performAjaxValidation($model);\n\n if (isset($_POST['InfoSpares'])) {\n $model->attributes = $_POST['InfoSpares'];\n $model->date_in = date('Y-m-d', strtotime($model->date_in));\n $model->status = \"Approve\";\n if ($model->car_or_spare_status_id == 1) {\n $model->branch_from_share = NULL;\n }\n if ($model->car_or_spare_status_id == 2 && empty($model->branch_from_share)) {\n Yii::app()->user->setFlash('error', \"ກະ​ລຸ​ນາ​ເລືອກ​ສາ​ຂາ\");\n } else {\n if ($model->save())\n $this->redirect(array('index'));\n }\n }\n\n $this->render('create', array(\n 'model' => $model,\n ));\n }", "public function actionCreate() {\n $model = new GestionStock;\n\n // Uncomment the following line if AJAX validation is needed\n // $this->performAjaxValidation($model);\n\n if (isset($_POST['GestionStock'])) {\n $model->attributes = $_POST['GestionStock'];\n if ($model->save())\n $this->redirect(array('view', 'id' => $model->id));\n }\n\n $this->render('create', array(\n 'model' => $model,\n ));\n }", "public function create()\n\t{\n\t\treturn View::make('tournamenttypes.create');\n\t}", "public function actionCreate()\n {\n $model = new Amphur();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->amphurId]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function create()\n\t{\n\t\treturn view('admin.awardtypes.create');\n\t}", "public function create()\n\t{\n\t\t$center = Center::lists('name_vi', 'id');\n\t\t$type = $this->type->lists('name','id');\n\t\treturn view('Admin::pages.student.create', compact('type', 'center'));\n\t}", "public function actionCreate()\n {\n $model = new JetShopDetails();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $model=new StudentReg;\n\n // Uncomment the following line if AJAX validation is needed\n // $this->performAjaxValidation($model);\n\n if(isset($_POST['StudentReg']))\n {\n $model->attributes=$_POST['StudentReg'];\n if($model->save())\n $this->redirect(array('view','id'=>$model->id));\n }\n\n $this->render('create',array(\n 'model'=>$model,\n ));\n }", "public function actionCreate()\n {\n $session = \\yii::$app->session;\n $user_type = $session->get('type',-1);\n\n $model = new Student();\n $user = new User();\n\n if ($model->load(Yii::$app->request->post())) {\n $stu = User::findOne($model->user_id);\n if($stu !== null){\n $model->addError('user_id', 'ID exists');\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n $user->id = $model->user_id;\n $user->username = strval($model->user_id);\n $user->password = '#'.$model->stu_ssn;\n $user->user_type = 2;\n if($model->stu_cost === ''){\n $model->stu_cost = 0;\n }\n if($user->save()) {\n if ($model->save()) {\n return $this->redirect(['view', 'id' => $model->user_id]);\n }\n else{\n $user->delete();\n }\n }\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function actionCreate()\n {\n $this->layout = 'layout_admin2';\n $model = new Setor();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id_setor]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function create()\n {\n // ตรวจสอบ permission\n ChkPerm('st-vehicle-type-create', 'setting/st-vehicle-type');\n\n return view('setting.st-vehicle-type.create');\n }", "public function actionCreate()\n {\n $model = new Status();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new Lessons();\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n $model->setStudentsInLessons($model->id);\n return $this->redirect(['/teacher/lessons']);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n } \n }", "public function actionCreate()\n\t{\n \n $uid = Yii::app()->user->getId(); \n if($uid != 1){\n $value = ComSpry::getUnserilizedata($uid);\n if(empty($value) || !isset($value)){\n throw new CHttpException(403,'You are not authorized to perform this action.');\n }\n if(!in_array(37, $value)){\n throw new CHttpException(403,'You are not authorized to perform this action.');\n }\n }\n\t\t$model=new Stone;\n $models='';\n $priceopt=array('p'=>'Per Pc','c'=>'Per Ct');\n \n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t// $this->performAjaxValidation($model);\n\n\t\tif(isset($_POST['Stone']))\n\t\t{\n if($this->checkDuplicate($_POST['Stone'])){\n\t\t\t\t$model->attributes=$_POST['Stone'];\n\t if($_POST['priceopt']=='c')\n\t $model->curcost=$model->weight*$_POST['Stone']['curcost'];\n\t $model->scountry=Stonem::model()->findByPk($model->idstonem)->scountry;\n\t $model->creatmeth=Stonem::model()->findByPk($model->idstonem)->creatmeth;\n\t $model->treatmeth=Stonem::model()->findByPk($model->idstonem)->treatmeth;\n\n\t\t\t\tif($model->save())\n\t\t\t\t\t Yii::app()->user->setFlash('errormessage', \"Stone created successfully!\");\n\t\t\t\t\t$this->redirect(array('create'));\n } else{\n Yii::app()->user->setFlash('errormessage', \"Cannot create a duplicate stone!\");\n }\n\t\t}\n $models=new Stone('search');\n $models->unsetAttributes(); // clear any default values\n if(isset($_GET['Stone']))\n $models->attributes=$_GET['Stone'];\n\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,'models'=>$models,'priceopt'=>$priceopt,\n\t\t));\n \n\t}", "public function actionCreate()\n\t{\n\t\t$model=new Vendor;\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t// $this->performAjaxValidation($model);\n\n\t\tif(isset($_POST['Vendor']))\n\t\t{\n\t\t\t$model->attributes=$_POST['Vendor'];\n\t\t\t$model->type = $_POST['Vendor']['type'];\n\t\t\tif($model->save())\n\t\t\t\t$this->redirect(array('index'));\n\t\t}\n\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}", "public function actionCreate()\n {\n $model = new Slaves();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['index']);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function create()\n {\n return $this->view('admin::shiptypes.create');\n }", "public function actionCreate() {\r\n $model = new Fltr();\r\n\r\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\r\n return $this->redirect(['view', 'id' => $model->id]);\r\n } else {\r\n return $this->render('create', [\r\n 'model' => $model,\r\n ]);\r\n }\r\n }", "public function actionCreate()\n\t{\n\t\t$model = new Whitelist ();\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t// $this->performAjaxValidation($model);\n\n\t\tif (isset ( $_POST ['Whitelist'] ))\n\t\t{\n\t\t\t$model->attributes = $_POST ['Whitelist'];\n\t\t\t$conn = Yii::app ()->db;\n\t\t\t$trans = $conn->beginTransaction ();\n\t\t\ttry\n\t\t\t{\n\t\t\t\t$model->save ();\n\t\t\t\t$trans->commit ();\n\t\t\t} catch ( Exception $e )\n\t\t\t{\n\t\t\t\t$trans->rollback ();\n\t\t\t}\n\t\t\t$this->redirect ( array (\n\t\t\t\t\t'admin'\n\t\t\t) );\n\t\t}\n\n\t\t$this->render ( 'create', array (\n\t\t\t\t'model' => $model\n\t\t) );\n\t}", "public function actionCreate()\n {\n $model = new SupItemsSync;\n\n // Uncomment the following line if AJAX validation is needed\n // $this->performAjaxValidation($model);\n\n if (isset($_POST['SupItemsSync'])) {\n $model->attributes = $_POST['SupItemsSync'];\n if ($model->save())\n $this->redirect(array('view', 'id' => $model->id));\n }\n\n $this->render('create', array(\n 'model' => $model,\n ));\n }", "public function actionCreate() {\n $model = new TimeBooks();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new StudentPackageDetails();\n $packageType = PackageType::getPackageType();\n $model->student_id = Yii::$app->user->identity->id;\n \n if ($model->load(Yii::$app->request->post())) {\n if($model->validate()) {\n $model->created_by = Yii::$app->user->identity->id;\n $model->updated_by = Yii::$app->user->identity->id;\n $model->created_at = gmdate('Y-m-d H:i:s');\n $model->updated_at = gmdate('Y-m-d H:i:s');\n $offerings = implode(',', $model->package_offerings);\n $model->package_offerings = $offerings;\n $temp = PackageSubtype::findOne($model->package_subtype_id);\n $model->limit_type = $temp->limit_type;\n $model->limit_pending = $temp->limit_count; \n if($model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n } else {\n var_dump($model->errors);\n die();\n } \n }\n return $this->render('create', [\n 'model' => $model,\n 'packageType' => $packageType\n ]);\n }", "public function actionCreate()\n {\n $model = new ListWarehouse();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n $model->generateDefaults(Yii::$app->request->get());\n return $this->render('form', ['model' => $model]);\n }\n }", "public function create()\n {\n return view('backend.types.create');\n }", "public function actionCreate()\n {\n $model = new Stock();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id_stock]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function actionCreate()\n {\n $model = new Variant();\n\n var_dump(Yii::$app->request->post());die;\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('variant/create', [\n 'model' => $model,\n ]);\n }\n }", "public function create()\n {\n if (!checkRole(getUserGrade(1)))\n {\n prepareBlockUserMessage();\n return back();\n }\n\n $data['title'] = 'Create Industry Type';\n $data['active_class'] = 'industry_type';\n \n\n $data['subscribers'] = Subscriber::getSubscriberOptions();\n \n return view('admin.industry_type.create', $data);\n }", "public function create()\n {\n return view('types.create');\n }", "public function create()\n {\n return view('types.create');\n }", "public function create()\n {\n return view('types.create');\n }", "public function create()\n {\n return view('types.create');\n }", "public function actionCreate()\n {\n $model = new SasaranEs4();\n\n if ($model->load(Yii::$app->request->post())) {\n if ($model->save()){\n flash('success','Data Sasaran Eselon IV Berhasil Disimpan');\n return $this->redirect(['index']);\n }\n \n flash('error','Data Sasaran Eselon IV Gagal Disimpan');\n \n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function actionCreate()\n {\n $model = new Tournament();\n\n if ($model->load(Yii::$app->request->post()) && $model->createNewTournament()) {\n\n return $this->redirect(['view', 'id' => $model->id_t]);\n }\n\n return $this->render('create', [\n 'model' => $model\n ]);\n }", "public function store(TypeStoreRequest $request)\n {\n types::create([\n 'type_id' => $request->type_id,\n 'type_name' => $request->type_name,\n ]);\n return redirect()->route('types.index')->with('message','Type Added Successfully');\n }", "public function actionCreate()\n\t{\n\t\t$model=new Store();\n\t\t$model->user_id = Yii::app()->user->id;\n\t\t$model->status = Store::STATUS_ACTIVE;\n\t\t$model->type = Store::TYPE_OFFLINE; // тип по умолчанию\n\t\t$model->save(false);\n\n\t\t$this->redirect($this->createUrl('update', array('id'=>$model->id)));\n\t}", "public function actionCreate()\n {\n $model = new StockLocation();\n\n if(Yii::$app->request->isAjax){\n if($model->load(Yii::$app->request->post()) && $model->save()){\n Yii::$app->response->format = Response::FORMAT_JSON;\n return Json::encode([true,$model->code]);\n }else{\n return Json::encode([false,$model->errors]);\n }\n \n \n }\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n //return $this->redirect(['view', 'code' => $model->code, 'user_id' => $model->user_id]);\n return $this->redirect(['index']);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n \n }\n }", "public function actionCreate()\n {\n $model = new Template();\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['index']);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function createAction()\n {\n\n if (!$this->request->isPost()) {\n return $this->dispatcher->forward(array(\n \"controller\" => \"vehicletypes\",\n \"action\" => \"index\"\n ));\n }\n\n $vehicletype = new Vehicletypes();\n\n $vehicletype->setName($this->request->getPost(\"name\"));\n\n if (!$vehicletype->save()) {\n foreach ($vehicletype->getMessages() as $message) {\n $this->flash->error($message);\n }\n\n return $this->dispatcher->forward(array(\n \"controller\" => \"vehicletypes\",\n \"action\" => \"new\"\n ));\n }\n\n $this->flash->success(\"vehicletype was created successfully\");\n\n return $this->dispatcher->forward(array(\n \"controller\" => \"vehicletypes\",\n \"action\" => \"index\"\n ));\n\n }", "public function store(SporttypeRequest $request)\n {\n $sportstype = new Sporttype([\n 'name' => $request->get('name'),\n 'description' => $request->get('description')\n ]);\n $sportstype->save();\n return redirect('sporttypes')->with('message','Saved item !');\n }", "public function create()\n {\n return view('payType.create', ['types' => Type::all()]);\n }", "public function create()\n {\n $types = type::all();\n return view('dashboard.matrail.create', compact('types'));\n //\n }", "public function actionCreate()\n\t{\n\t\t$model=new Student;\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t// $this->performAjaxValidation($model);\n\n\t\tif(isset($_POST['Student']))\n\t\t{\n\t\t\t$model->attributes=$_POST['Student'];\n\t\t\tif($model->save(false)){\n\t\t\t\t$studentCourse = new StudentCourse;\n\t\t\t\t$studentCourse->STUDENT_ID = $model->ID;\n\t\t\t\t$studentCourse->COURSE_ID = $_POST['StudentCourse']['COURSE_ID'];\n\t\t\t\t$studentCourse->STATUS = 1;\n\t\t\t\t$studentCourse->save(false);\n\t\t\t\t$this->redirect(array('admin'));\n\t\t\t}\n\t\t}\n\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}", "public function actionCreate()\n {\n $model = new ShareUser();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function create($type_id)\n {\n\n return view('admin.brands.types.models.create',compact('type_id'));\n }", "public function actionCreate()\n {\n $model = new EstudiosIps();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $model=new Seat;\n\n // Uncomment the following line if AJAX validation is needed\n // $this->performAjaxValidation($model);\n\n if(isset($_POST['Seat']))\n {\n $model->attributes=$_POST['Seat'];\n if($model->save())\n $this->redirect(array('view','id'=>$model->id));\n }\n\n $this->render('create',array(\n 'model'=>$model,\n ));\n }", "public function actionCreate()\n {\n $model = new Subscribeclass();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "private function newModel(){\n\t\t$this->assign('title', 'New Model');\n\t\t$this->assign('types', $this->getModelTypes());\n\t\t$this->display('model/new.tpl');\n\t}", "public function actionCreate() {\n $model = new Direction;\n\n // Uncomment the following line if AJAX validation is needed\n // $this->performAjaxValidation($model);\n\n if (isset($_POST['Direction'])) {\n $model->attributes = $_POST['Direction'];\n if ($model->save())\n $this->redirect(array('view', 'id' => $model->id));\n }\n\n $this->render('create', array(\n 'model' => $model,\n ));\n }", "public function create()\n {\n return view('admin.truck.type.create');\n }", "public function actionCreate() {\n $model = new TProspect;\n $history = new TProspectHistory;\n // Uncomment the following line if AJAX validation is needed\n // $this->performAjaxValidation($model);\n\n $model->marketing_id = 1;\n if (isset($_POST['TProspect'], $_POST['TProspectHistory'])) {\n CActiveForm::validate(array($model, $history));\n $model->attributes = $_POST['TProspect'];\n $model->prospect_id = $this->noProspect();\n $model->create_user = 1;\n $model->marketing_id = 1;\n $history->attributes = $_POST['TProspectHistory'];\n $history->prospect_id = $model->prospect_id;\n $history->history_id = 1;\n $history->create_at = date(\"Y-m-d H:i:s\");\n $valid = $model->validate();\n $valid = $history->validate() && $valid;\n if ($valid) {\n if ($model->save()) {\n $history->prospect_id = $model->prospect_id;\n $history->history_id = 1;\n $history->create_at = date(\"Y-m-d H:i:s\");\n $history->save(false);\n $this->redirect(\n array('update',\n 'id' => $model->id)\n );\n }\n }\n }\n\n $this->render('create', array(\n 'model' => $model,\n 'history' => $history,\n ));\n }", "public function actionCreate()\n\t{\n\t\t$model = $this->loadModel();\n\n\t\tif(isset($_POST[get_class($model)]))\n\t\t{\n $model = $this->_prepareModel($model);\n if (Yii::app()->getRequest()->isAjaxRequest) {\n if($model->save())\n echo json_encode($model);\n else\n echo json_encode(array('modelName' => get_class($model),'errors' => $model->getErrors()));\n\n Yii::app()->end();\n }\n\n\t\t\tif($model->save())\n\t\t\t\t$this->redirect(array('view','id'=>$model->id));\n\t\t}\n\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}", "public function actionCreateMarket()\n\t{\n\t $model=new Codesparam;\n\t \t\t$model->cm_type = \"Market\";\n\t \t\t$model->inserttime = date(\"Y-m-d H:i\");\n $model->insertuser = Yii::app()->user->name;\n\n\t if(isset($_POST['Codesparam']))\n\t {\n\t $model->attributes=$_POST['Codesparam'];\n\t if($model->validate())\n\t {\n\t\t\t\t$this->saveModel($model);\n\t\t\t\t$this->redirect(array('CreateMarket'));\n\t }\n\t }\n\t $this->render('create_market',array('model'=>$model));\n\t}", "public function actionCreate() {\n $model = new Surveys();\n\n if ($model->load(Yii::$app->request->post())) {\n if ($model->validate() == TRUE) {\n // print_r($model);\n $model->save();\n Yii::$app->session->setFlash('success', \"Poll Created Succsesfully\");\n\n return $this->redirect('create');\n } else {\n $sessions = Yii::$app->session->set(\"Error\", \"Error when creating Survey\");\n }\n //print_r($model);\n //return $this->redirect(['view', 'id' => $model->survey_id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function _actionCreate()\n\t{\n\t\t$model=new Providers;\n\t\t$modelAffi=new Affiliates;\n\t\t$modelNet=new Networks;\n\t\t$modelPub=new Publishers;\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t$this->performAjaxValidation($model);\n\t\t// $this->performAjaxValidation($modelProv);\n\t\tif(isset($_POST['Providers']))\n\t\t{\n\t\t\t$defaultAttributes=array(\n\t\t\t\t'status' =>'Active',\n\t\t\t\t'commercial_name' =>'prospect',\n\t\t\t\t'state' =>'state',\n\t\t\t\t'zip_code' =>'000',\n\t\t\t\t'tax_id' =>'000',\n\t\t\t\t);\n\t\t\t$attributes=array(\n\t\t\t\t'name' =>$_POST['Providers']['name'],\n\t\t\t\t'entity' =>$_POST['Providers']['entity'],\n\t\t\t\t'model' =>$_POST['Providers']['model'],\n\t\t\t\t'net_payment' =>$_POST['Providers']['net_payment'],\n\t\t\t\t'deal' =>$_POST['Providers']['deal'],\n\t\t\t\t'start_date' =>$_POST['Providers']['start_date'],\n\t\t\t\t'end_date' =>$_POST['Providers']['end_date'],\n\t\t\t\t'daily_cap' =>$_POST['Providers']['daily_cap'],\n\t\t\t\t'sizes' =>$_POST['Providers']['sizes'],\n\t\t\t\t'currency' =>$_POST['Providers']['currency'],\n\t\t\t\t'prospect' =>1,\n\t\t\t\t);\n\t\t\t$attributes=array_merge($defaultAttributes,$attributes);\n\t\t\t$model->attributes=$attributes;\n\t\t\tif ($model->save()) {\n\t\t\t\t$type=$model->getAllTypes()[$_POST['type']];\n\t\t\t\tswitch ($type) {\n\t\t\t\t\tcase 'Affiliates':\n\t\t\t\t\t\t$modelAffi->attributes=array('providers_id'=>$model->id,'users_id'=>Yii::app()->user->getId());\n\t\t\t\t\t\tif($modelAffi->save())\n\t\t\t\t\t\t\t$this->redirect(array('prospect'));\t\t\t\t\t\t\t\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'Networks':\n\t\t\t\t\t\t$modelNet->attributes=array('providers_id'=>$model->id);\n\t\t\t\t\t\tif($modelNet->save())\n\t\t\t\t\t\t\t$this->redirect(array('prospect'));\t\t\t\t\t\t\t\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'Publishers':\n\t\t\t\t\t\t$modelPub->providers_id=$model->id;\n\t\t\t\t\t\t$modelPub->attributes=array('account_manager_id'=>Yii::app()->user->getId());\n\t\t\t\t\t\tif($modelPub->save())\n\t\t\t\t\t\t\t$this->redirect(array('prospect'));\t\t\t\t\t\t\t\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t\techo json_encode($model->getErrors());\n\t\t}\n\n\t\t$this->renderFormAjax($model);\n\t}", "public function create()\n {\n //\n return view(\"LoaiPhim/nhap-thong-tin-moviestypes\");\n }", "public function actionCreate()\n {\n $model = new Ved();\n\t\t/**\n * This is the model class for table \"ved_str\".\n *\n * @property integer $id\n * @property integer $ved\n * @property string $stud\n * @property integer $ocenka\n */\n\t\t\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n\t\t\t\n\t\t\t$studenty = Stud::find()->filterWhere(['like', 'gruppa', $model->gruppa])->all();\n\n\t\t\tforeach ($studenty as $stud)\n\t\t\t{\n\t\t\t\t$modelstr=new VedStr();\n\t\t\t\t$modelstr->ved=$model->id;\n\t\t\t\t$modelstr->stud=$stud->id;\n\t\t\t\t$modelstr->ocenka=0;/**/\n\t\t\t\t$modelstr->save();\n\t\t\t}\n \n\t\t\t\n\t\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n\t\t\t\n\t\t\n\t\t\t\n\t\t\t\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new InfoBlocks();\n $model->structure_id = Yii::$app->request->get('structure_id');\n $model->type = Yii::$app->request->get('type');\n $model->is_publish = 1;\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n if($model->type == 'gallery') {\n return $this->redirect(['update', 'id' => $model->id]);\n }\n\n $part = Structure::findOne($model->structure_id);\n if($part->type_id !== 2) {\n return $this->redirect($part->getAdminUrl());\n }\n return $this->redirect(['index', 'id' => $model->structure_id]);\n }\n\n return $this->render('create', [\n 'model' => $model\n ]);\n }", "public function create()\n {\n return view('unit_type.create');\n }", "public function actionCreate()\n {\n $model = new Survey();\n\n Yii::$app->gon->send('saveSurveyUrl', '/survey/save-new');\n Yii::$app->gon->send('afterSaveSurveyRedirectUrl', \\Yii::$app->request->referrer);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function create()\n {\n return view('usertypes.create');\n }", "public function actionCreate()\n {\n $model = new MintaData();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function create()\n {\n $title = \"Create New type for the Items\";\n return view('admin.types.create', compact('title'));\n }", "public function create()\n {\n return view('admin/type/create');\n }", "public function actionCreate($type=false)\n {\n $model = new Params();\n if($type)\n $model->type = $type;\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['index']);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function store(CreateTypeRequest $request)\n {\n $input = $request->only('name');\n if($this->typeRepository->create($input)) {\n return redirect()->route('types.index');\n }\n return redirect()->back();\n\n }", "public function actionCreate()\n {\n $model = new Rents();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new Point();\n $model->create_at = time();\n $model->user_id = User::getCurrentId();\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function create()\n {\n return view('admin::appraisal.types.create');\n }", "public function create()\n {\n return view(\"feedtype.create\");\n }", "public function create()\n\t{\n\t\treturn View::make('gametypes.create');\n\t}", "public function store(TypeFormRequest $request)\n {\n $types = new Type();\n $types->typename = $request->get('typename');\n $mess = \"\";\n if($types->save())\n {\n $mess = (\"Thêm Thành Công\");\n }\n $types = Type::all();\n \n return view('admin.type', compact('types'))->with(('mess'), $mess);\n }", "public function create()\n {\n return view('admin.type.create');\n }", "public function actionCreate()\n {\n $model = new Schedule();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function actionCreate()\n {\n $model = new Schedule();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function create()\n {\n return view('product_type.create');\n }", "public function actionCreate()\n {\n $model = new Position();\n $model->loadDefaultValues();\n if (strpos(Yii::$app->request->referrer, 'structure') !== false) {\n $referrer = Yii::$app->request->referrer;\n } else {\n $referrer = null;\n }\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n if (!empty(Yii::$app->request->post('referrer'))) {\n $referrer = explode('?',Yii::$app->request->post('referrer'));\n return $this->redirect([$referrer[0].'?id=position-'.$model->id]);\n }\n\n return $this->redirect(['index']);\n } else {\n return $this->render('create', [\n 'model' => $model,\n 'referrer' => $referrer,\n ]);\n }\n }" ]
[ "0.66128886", "0.6479352", "0.6391571", "0.6365652", "0.63448405", "0.6331866", "0.63111085", "0.62778836", "0.6273377", "0.6268419", "0.62676495", "0.62411624", "0.62046605", "0.62001914", "0.6177969", "0.61688554", "0.61599386", "0.615114", "0.61457634", "0.6140306", "0.6129906", "0.6120945", "0.6107398", "0.60733277", "0.6059666", "0.6055262", "0.6037863", "0.60342085", "0.6032333", "0.60307926", "0.60299665", "0.60221946", "0.6019517", "0.60173553", "0.59866637", "0.59837955", "0.59783095", "0.59658206", "0.5964211", "0.59611976", "0.59605646", "0.59565866", "0.5950856", "0.5947998", "0.5939628", "0.5925641", "0.5918421", "0.5916699", "0.5907337", "0.5903812", "0.5903197", "0.5903197", "0.5903197", "0.5903197", "0.5899987", "0.5898057", "0.58879894", "0.58856714", "0.58809394", "0.58801794", "0.58771664", "0.58721566", "0.58711076", "0.58690846", "0.58673847", "0.5864216", "0.58613074", "0.5860102", "0.5847588", "0.58436894", "0.5842928", "0.5842519", "0.5842485", "0.58356947", "0.5831023", "0.5810186", "0.5809488", "0.5805535", "0.5803098", "0.57996887", "0.5795084", "0.57910705", "0.5786134", "0.5781905", "0.57797384", "0.57778275", "0.57769775", "0.5772133", "0.57712024", "0.57692415", "0.57683694", "0.57572675", "0.57545155", "0.57455355", "0.5743835", "0.573972", "0.5735768", "0.5735768", "0.5734789", "0.5734266" ]
0.6469638
2
Updates an existing StampTypes model. If update is successful, the browser will be redirected to the 'view' page.
public function actionUpdate($id) { $model = $this->findModel($id); $previous_image = $model->image; if (Yii::$app->request->isAjax && $model->load(Yii::$app->request->post())) { Yii::$app->response->format = \yii\web\Response::FORMAT_JSON; return ActiveForm::validate($model); } if ($model->load(Yii::$app->request->post())) { if (UploadedFile::getInstanceByName('image')){ $image = $this->saveImage($previous_image); $model->image = $image; } if ($model->save()) { Yii::$app->getSession()->setFlash('', ['type'=>'success','message' => 'Информация сохранена']); return $this->redirect(['index']); } } return $this->renderAjax('form_modal', [ 'model' => $model, ]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n 'types' => $model->getTypes(),\n ]);\n }\n }", "public function actionUpdate($id, $PSD_Type_Id)\n {\n $model = $this->findModel($id, $PSD_Type_Id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id, 'PSD_Type_Id' => $model->PSD_Type_Id]);\n }\n\n return $this->render('update', [\n 'model' => $model,\n ]);\n }", "public function actionUpdate()\n {\n\t\t\t$id=7;\n $model = $this->findModel($id);\n $model->slug = \"asuransi\";\n $model->waktu_update = date(\"Y-m-d H:i:s\");\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['update']);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }", "public function actionUpdate($id)\r\n {\r\n $model = $this->findModel($id);\r\n\r\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\r\n return $this->redirect(['view', 'id' => $model->id]);\r\n } else {\r\n $typeFields = ArrayHelper::map(TypeFields::find()->asArray()->orderBy('name')->all(), 'id', 'name');\r\n\r\n return $this->render('update', [\r\n 'model' => $model,\r\n 'typeFields' => $typeFields\r\n ]);\r\n }\r\n }", "public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n $post_types = ArrayHelper::map(PostType::find()->orderBy('name')->all(), 'id', 'name');\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n 'post_types' => $post_types,\n ]);\n }\n }", "public function update(TypeStoreRequest $request, types $type)\n {\n $type->update([\n 'type_id' => $request->type_id,\n 'type_name' => $request->type_name,\n // 'password' => Hash::make($request->password),\n ]);\n return redirect()->route('types.index')->with('message','Type updated Successfully');\n }", "public function update(Request $request, TypeTrucks $typeTrucksб, $id)\n {\n\n $type = TypeTrucks::find((int)$id);\n $type->val = $request->val;\n $type->update();\n return redirect()->route('types.index');\n }", "public function actionUpdate($id)\n\t{\n\t\t$model=$this->loadModel($id);\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t// $this->performAjaxValidation($model);\n\n\t\tif(isset($_POST['Vendor']))\n\t\t{\n\t\t\t$model->attributes=$_POST['Vendor'];\n\t\t\t$model->type = $_POST['Vendor']['type'];\n\t\t\tif($model->save())\n\t\t\t\t$this->redirect(array('index'));\n\t\t}\n\n\t\t$this->render('update',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}", "public function update(SporttypeRequest $request, $id)\n {\n $sportstype = Sporttype::find($id);\n $sportstype->name = $request->get('name');\n $sportstype->description = $request->get('description');\n $sportstype->save();\n return redirect('sporttypes')->with('message', 'Successfully updated !');\n }", "public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->amphurId]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }", "public function actionUpdate()\r\n {\r\n $model=Settings::findOne(1);\r\n\r\n \r\n if ($model->load(Yii::$app->request->post())) \r\n {\r\n $model->code=strtolower($model->code);\r\n if($model->save())\r\n {\r\n Yii::$app->session->setFlash('success','Account Updated');\r\n return $this->redirect(['/site/index']);\r\n }\r\n else\r\n {\r\n print_r($model->errors); exit;\r\n }\r\n } \r\n else \r\n {\r\n Yii::$app->view->title=\"Update Account Info\";\r\n return $this->render('update', [\r\n 'model' => $model,\r\n ]);\r\n }\r\n \r\n\r\n }", "public function update(Request $request, $id)\n {\n $attributes = $request->all();\n $this->productTypeService->update($id, $attributes);\n\n return redirect()->route('type.edit', $id)->with('status', 'Тип товаров обновлен!');\n }", "public function update($id, TypeRequest $request)\n {\n\n $updatedType = $this->typeRepo->update($id, $request->all());\n\n if ($updatedType) {\n\n \\Session::flash('success', 'Apprasial order Type was successfully updated!');\n\n return redirect()->route('admin.appraisal.appr-types.index');\n \n } else {\n\n \\Session::flash('error', 'Something was wrong!');\n\n return redirect()->route('admin.appraisal.appr-types.index');\n }\n }", "public function update($id)\n\t{\n\t\t$input = array_except(Input::all(), '_method');\n\t\t$validation = Validator::make($input, Etype::$rules);\n\n\t\tif ($validation->passes())\n\t\t{\n\t\t\t$etype = $this->etype->find($id);\n\t\t\t$etype->update($input);\n\n\t\t\treturn Redirect::route('etypes.show', $id);\n\t\t}\n\t\tFlash::error('There were validation errors');\n\t\treturn Redirect::route('etypes.edit', $id)\n\t\t\t->withInput()\n\t\t\t->withErrors($validation);\n\t}", "public function update($id)\n\t{\n\t\t$input = array_except(Input::all(), '_method');\n\t\t$validation = Validator::make($input, Tournamenttype::$rules);\n\n\t\tif ($validation->passes())\n\t\t{\n\t\t\t$tournamenttype = $this->tournamenttype->find($id);\n\t\t\t$tournamenttype->update($input);\n\n\t\t\treturn Redirect::route('tournamenttypes.show', $id);\n\t\t}\n\n\t\treturn Redirect::route('tournamenttypes.edit', $id)\n\t\t\t->withInput()\n\t\t\t->withErrors($validation)\n\t\t\t->with('message', 'There were validation errors.');\n\t}", "public function update(StylistAdminFormRequest $request, Stylist $stylist)\n\t{\n\t\t$stylist->update($request->all());\n\t\t\n\t\treturn redirect()->back()->with('message', 'The info has been updated');\n\t}", "public function update(Request $request, $id)\n {\n Validator::make($request->all(), [\n 'type' => 'required',\n\n ])->validate();\n\n $unit_type = UnitType::find($id);\n $unit_type->type = $request->type;\n\n $unit_type->save();\n\n return redirect()->route('unit_type.index')->with('success', 'Unit Type updated!');\n }", "public function viewUpdateProductType(){\n\n $stationary_types = DB::table('stationary_types')->get();\n\n return view('updatedeletetype', ['stationary_types' => $stationary_types]);\n }", "public function update(Request $request, Type $type)\n {\n //\n $request -> validate([\n 'name' => 'required'\n ]);\n\n Type::update($request->all());\n\n return redirect()->route('type')\n ->with('success','แก้ไขหมวดหมู่อัลบั้มสำเร็จ');\n }", "public function update()\n {\n\t $dataArr = array(\n\t\t'id' => $this->input->post('id'),\n\t\t'paper_code' => $this->input->post('paper_code'),\n\t\t'subject' => $this->input->post('subject'),\n\t\t'min_marks' => $this->input->post('min_marks'),\n\t\t'max_marks' => $this->input->post('max_marks')\n\t\t);\n\t $SetUp=new SetUpModel;\n $SetUp->update_product($dataArr);\n redirect(base_url('index.php/SetUp'));\n }", "public function saveAction()\n {\n\n if (!$this->request->isPost()) {\n return $this->dispatcher->forward(array(\n \"action\" => \"index\"\n ));\n }\n\n $type_id = $this->request->getPost(\"type_id\");\n\n $itemsType = ItemsType::findFirstBytype_id($type_id);\n if (!$itemsType) {\n $this->flash->error(\"Items Type does not exist \" . $type_id);\n\n return $this->dispatcher->forward(array(\n \"action\" => \"index\"\n ));\n }\n\n $itemsType->code = $this->request->getPost(\"code\");\n $itemsType->name = $this->request->getPost(\"name\");\n \n\n if (!$itemsType->save()) {\n\n foreach ($itemsType->getMessages() as $message) {\n $this->flash->error($message);\n }\n\n return $this->dispatcher->forward(array(\n \"action\" => \"edit\",\n \"params\" => array($itemsType->type_id)\n ));\n }\n\n $this->flash->success(\"Items Type was updated successfully\");\n\n return $this->dispatcher->forward(array(\n \"action\" => \"index\"\n ));\n\n }", "public function actionUpdate() {\n $model = $this->loadModel();\n $modelAmbienteUso = new Ambiente_Uso;\n $modelUsuario = new Usuario();\n $modelAmbiente = new Ambiente();\n $modelPredio = new Predio();\n\n // Uncomment the following line if AJAX validation is needed\n // $this->performAjaxValidation($model);\n\n if (isset($_POST['Alocacao'])) {\n $model->attributes = $_POST['Alocacao'];\n $a = $model->DT_DIA;\n if ($model->save())\n $this->redirect(array('view', 'id' => $model->ID_ALOCACAO));\n }\n\n $this->render('update', array(\n 'model' => $model,\n 'modelAU' => $modelAmbienteUso,\n 'modelU' => $modelAmbienteUso,\n 'modelA' => $modelAmbiente,\n 'modelP' => $modelPredio\n ));\n }", "public function update(TypeFormRequest $request, $id)\n {\n $types = Type::findOrfail($id);\n $types->typename = $request->get('typename');\n if($types->save())\n {\n $mess = \"Sửa thành công\";\n }\n\n return view('admin.edittype', compact('types'))->with(('mess'), $mess);\n }", "public function actionUpdate($id)\n\t{\n\t\t$model=$this->loadModel($id);\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t// $this->performAjaxValidation($model);\n\n\t\tif(isset($_POST['Solicitudes']))\n\t\t{\n\t\t\t$model->attributes=$_POST['Solicitudes'];\n\t\t\tif($model->save())\n\t\t\t\t$this->redirect(array('view','id'=>$model->id));\n\t\t}\n\n\t\t$this->render('update',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}", "public function updatesettingsview() {\r\n\r\n $this->logger->info(\"Action Update Settings View \");\r\n $this->fields['id'] = $_POST[\"id\"];\r\n $this->fields['combotype'] = $_POST[\"combotype\"];\r\n $this->fields['Combovalue'] = $_POST[\"Combovalue\"];\r\n $this->fields['meta_code'] = $_POST[\"timedetails\"];\r\n\r\n if ($_POST[\"isactive\"] == 'on') {\r\n $this->fields['isactive'] = 1;\r\n } else {\r\n $this->fields['isactive'] = 0;\r\n }\r\n\r\n $validResult = $this->settingsModel->updatecombovalue($this->fields);\r\n\r\n if ($validResult == 0) {\r\n\r\n $this->type = $this->settingsModel->getcombotypevalues($this->fields['combotype']);\r\n\r\n foreach ($this->type as $value) {\r\n $this->fields['combotype'] = $value['type'];\r\n }\r\n\r\n $this->template->display('viewsetting', $this->fields, 'settings');\r\n } else {\r\n\r\n $error = $this->settingsModel->geterror();\r\n $this->type = $this->settingsModel->getcombotypevalues($this->fields['combotype']);\r\n\r\n foreach ($this->type as $value) {\r\n $this->fields['combotype'] = $value['type'];\r\n }\r\n\r\n $this->template->display_data('listsettings', $this->fields, 'settings', $this->fields, '', $error);\r\n }\r\n }", "public function actionUpdate()\n\t{\n\t\t$model=$this->loadfiles();\n\t\tif(isset($_POST['Files']))\n\t\t{\n\t\t\t$model->attributes=$_POST['Files'];\n\t\t\tif($model->save())\n\t\t\t\t$this->redirect(array('show','id'=>$model->id));\n\t\t}\n\t\t$this->render('update',array('model'=>$model));\n\t}", "public function actionUpdate($id)\n {\n $model = $this->loadModel($id);\n\n // Uncomment the following line if AJAX validation is needed\n // $this->performAjaxValidation($model);\n\n if (Yii::app()->request->isPostRequest && isset($_POST['BookingItemsPosition'])) {\n $model->setAttributes(Yii::app()->request->getPost('BookingItemsPosition'));\n\n if ($model->save()) {\n if (Yii::app()->request->isAjaxRequest) {\n echo Yii::t('BookingModule.booking', 'Объект бронирования обновлен!');\n Yii::app()->end();\n } else {\n Yii::app()->user->setFlash(\n YFlashMessages::NOTICE_MESSAGE, Yii::t('BookingModule.booking', 'Объект бронирования обновлен!')\n );\n if (!isset($_POST['submit-type']))\n $this->redirect(array('update', 'id' => $model->id));\n else\n $this->redirect(array($_POST['submit-type']));\n\n $this->redirect(array('view', 'id' => $model->id));\n }\n } else {\n if (Yii::app()->request->isAjaxRequest) {\n var_dump($model->getError());\n Yii::app()->end();\n } else {\n $this->render('update', array(\n 'model' => $model,\n ));\n }\n }\n }\n\n $model->date = date('d.m.Y');\n\n $this->render('update', array(\n 'model' => $model,\n ));\n }", "public function update(Request $request, $id)\n {\n $validationRules = $this->getValidationRules('Update');\n $this->validate($request, $validationRules);\n\n $type = Type::findOrFail($id);\n $type->type = $request->type;\n\n $type->save();\n\n $request->session()->flash('status', '<span>Success</span>: Type updated.');\n return redirect()->route('types.index');\n }", "public function update(Request $request, $id)\n {\n //\n\t\t$type = Type::findOrFail($id);\n\t\t$type->l1_name = trim($request->l1_name);\n\t\t$type->l2_name = trim($request->l2_name);\n\t\t$type->ding_hook = trim($request->ding_hook);\n\t\t$type->desc = trim($request->desc);\n\t\tif ($type->save()) {\n\t\t\treturn redirect(route('type.index'));\n\t\t} else {\n\t\t\treturn response('error', 500);\n\t\t}\n }", "public function update($id)\n\t{\n\t\t$input = array_except(Input::all(), '_method');\n\t\t$validation = Validator::make($input, ProductType::$rules);\n\n\t\tif ($validation->passes())\n\t\t{\n\t\t\t$product_type = $this->product_type->find($id);\n\t\t\t$product_type->update($input);\n\n\t\t\treturn Redirect::route('product_types.show', $id);\n\t\t}\n\n\t\treturn Redirect::route('product_types.edit', $id)\n\t\t\t->withInput()\n\t\t\t->withErrors($validation)\n\t\t\t->with('message', 'There were validation errors.');\n\t}", "public function actionUpdate()\n {\n $model = $this->loadModel();\n\n if (isset($_POST['User']))\n {\n $model->attributes = $_POST['User'];\n\n if ($model->save())\n {\n Yii::app()->user->setFlash(YFlashMessages::NOTICE_MESSAGE, Yii::t('user', 'Данные обновлены!'));\n\n $this->redirect(array('view', 'id' => $model->id));\n }\n }\n\n $this->render('update', array(\n 'model' => $model,\n ));\n }", "public function actionUpdate($id)\n {\n // $model = $this->findModel($id);\n\n // if ($model->load(Yii::$app->request->post()) && $model->save()) {\n // return $this->redirect(['view', 'id' => $model->id]);\n // }\n\n // return $this->render('update', [\n // 'model' => $model,\n // ]);\n\n $model = $this->findModel($id);;\n $modelsAnggota = $model->stSpdAnggotas;\n\n // Only admin can change pegawai instansi otherwise auto_fill_instansi_with_user\n if(Yii::$app->user->identity->role==99){\n $model->setScenario(StSpd::SCENARIO_ADMIN);\n $model->detachBehavior(\"auto_fill_instansi_with_user\");\n }\n\n if ($model->loadAll(Yii::$app->request->post()) && $model->saveAll()) {\n $model->createDocx();\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n 'modelsAnggota' => (empty($modelsAnggota)) ? [new StSpdAnggota] : $modelsAnggota\n ]);\n }\n }", "public function update(Request $request, $id)\n {\n //\n /*$validateData = $request->validate([\n 'studType' => 'required|unique:student_types,studentType',\n 'fees' => 'required',\n ]);*/\n\n $studentType = Program::findorFail($id);\n $studentType->name = $request->studType;\n $studentType->fees = $request->fees;\n $studentType->createdBy = Auth::user()->name;\n $studentType->save();\n\n $request->session()->flash('status', 'Student Type ' . $request->studType . ' successfully updated');\n return redirect('studentType');\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, \n [\n\n 'name' => 'required|max:50',\n \n\n ]);\n\n $usertype = Usertype::find($id);\n $usertype->name = $request->name;\n $usertype->save();\n Session::flash('success', 'The record was successfully saved.');\n return redirect()->route('usertypes.index');\n }", "public function actionUpdate($id)\n {\n if($this->isAuthenticate())\n {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) \n {\n return $this->redirect(['index','type' => $model->IdEntityType]);\n } else \n {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }\n }", "public function update(Request $request, ClassType $classType, Student $student)\n {\n //\n }", "public function update($id, UpdateTypeRequest $request)\n {\n $type = $this->typeRepository->findWithoutFail($id);\n\n if (empty($type)) {\n Flash::error('Type not found');\n\n return redirect(route('backend.types.index'));\n }\n\n $type = $this->typeRepository->update($request->all(), $id);\n\n Flash::success('Type updated successfully.');\n\n return redirect(route('backend.types.index'));\n }", "public function update(EditTypeRequest $request, $id)\n {\n $input = $request->only('name');\n\n if($this->typeRepository->update($input, $id)) {\n return redirect()->route('types.index');\n }\n\n return redirect()->back();\n }", "public function actionUpdate()\n {\n if (!$model = $this->findModel()) {\n Yii::$app->session->setFlash(\"error\", Yii::t('modules/user', \"You are not logged in.\"));\n $this->goHome();\n } else if ($model->load(Yii::$app->request->post()) && $model->save()) {\n Yii::$app->session->setFlash(\"success\", Yii::t('modules/user', \"Changes has been saved.\"));\n $this->refresh();\n } else {\n return $this->render('update', ['model' => $model,]);\n }\n }", "public function actionUpdate() //update value from default page to DB\n {\n\n\n $model = $this->findModel($_POST['ExamRoomDetail']['rooms_detail_date'],\n $_POST['ExamRoomDetail']['rooms_detail_time'],\n $_POST['ExamRoomDetail']['rooms_id']\n );\n if(isset($_POST)) {\n $model->load(Yii::$app->request->post());\n $update = $model;\n $update->exam_room_status = $_POST['ExamRoomDetail']['exam_room_status'];\n $update->save();\n }\n\n }", "public function actionUpdate($id)\n {\n $model = $this->loadModel($id);\n\n // Uncomment the following line if AJAX validation is needed\n // $this->performAjaxValidation($model);\n\n if (isset($_POST['SupItemsSync'])) {\n $model->attributes = $_POST['SupItemsSync'];\n if ($model->save())\n $this->redirect(array('view', 'id' => $model->id));\n }\n\n $this->render('update', array(\n 'model' => $model,\n ));\n }", "function update_id_type($id_type_id = '')\n\t{\n\t\t$data['name']\t\t\t\t\t=\t$this->input->post('name');\n\t\t$data['timestamp']\t\t\t\t= \ttime();\n\t\t$data['updated_by']\t\t\t\t= \t$this->session->userdata('user_id');\n\n\t\t$this->db->where('id_type_id', $id_type_id);\n\t\t$this->db->update('id_type', $data);\n\n\t\t$this->session->set_flashdata('success', 'ID type has been updated successfully.');\n\n\t\tredirect(base_url() . 'id_type_settings', 'refresh');\n\t}", "public function actionUpdate($id)\n\t{\n\t\t$model=$this->loadModel($id);\n\n\t\t$this->layout='//layouts/modalIframe';\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t$this->performAjaxValidation($model);\n\n\t\tif(isset($_POST['Providers']))\n\t\t{\n\t\t\t$model->attributes=$_POST['Providers'];\n\t\t\tif($model->save())\n\t\t\t\t$this->redirect(array('response', 'id'=>$model->id, 'action'=>'updated'));\n\t\t}\n\n\t\t$this->renderFormAjax($model);\n\n\t\t\n\t}", "public function update(Request $request, Type $type)\n {\n Gate::authorize('edit-type', $type);\n $validationData = $request->validate([\n 'name' => 'required|min:2',\n ]);\n\n $type->update([\n 'name' => $validationData['name'],\n 'slug' => Str::slug($validationData['name']),\n 'user_id' => Auth::id()\n ]);\n return redirect()->route('admin.types.show', ['type' => $type->id])->with(\"success\", \"{$type->name} has been updated successfully\");\n }", "public function actionUpdate() {\n $json = file_get_contents('php://input'); //$GLOBALS['HTTP_RAW_POST_DATA'] is not preferred: http://www.php.net/manual/en/ini.core.php#ini.always-populate-raw-post-data\n $put_vars = CJSON::decode($json, true); //true means use associative array\n switch ($_GET['model']) {\n // Find respective model\n case 'Order':\n $model = Order::model()->findByPk($_GET['id']);\n break;\n case 'Users':\n $model = Users::model()->findByPk($_GET['id']);\n break;\n case 'Product':\n $model = Product::model()->findByPk($_GET['id']);\n break;\n case 'Vendor':\n $model = Vendor::model()->findByPk($_GET['id']);\n break;\n case 'FavoriteProduct':\n $model = FavoriteProduct::model()->findByPk($_GET['id']);\n break;\n case 'Rating':\n $model = Rating::model()->findByPk($_GET['id']);\n break;\n case 'Review':\n $model = Review::model()->findByPk($_GET['id']);\n break;\n case 'UserAddress':\n $model = UserAddress::model()->findByPk($_GET['id']);\n break;\n case 'OrderDetail':\n $model = OrderDetail::model()->findByPk($_GET['id']);\n break;\n default:\n $this->_sendResponse(0, sprintf('Error: Mode update is not implemented for model ', $_GET['model']));\n Yii::app()->end();\n }\n // Did we find the requested model? If not, raise an error\n if ($model === null)\n $this->_sendResponse(0, sprintf(\"Error: Didn't find any model with ID .\", $_GET['model'], $_GET['id']));\n\n // Try to assign PUT parameters to attributes\n unset($_POST['id']);\n foreach ($_POST as $var => $value) {\n // Does model have this attribute? If not, raise an error\n if ($model->hasAttribute($var))\n $model->$var = $value;\n else {\n $this->_sendResponse(0, sprintf('Parameter %s is not allowed for model ', $var, $_GET['model']));\n }\n }\n // Try to save the model\n if ($model->update())\n $this->_sendResponse(1, '', $model);\n else\n $this->_sendResponse(0, $msg);\n // prepare the error $msg\n // see actionCreate\n // ...\n }", "public function update($model) :bool;", "function update(){\n\t\t$this->model->update();\n\t}", "public function update(UpdateOperationTypesRequest $request, $id)\n {\n if (! Gate::allows('operation_type_edit')) {\n return abort(401);\n }\n $operation_type = OperationType::findOrFail($id);\n $operation_type->update($request->all());\n\n\n\n return redirect()->route('admin.operation_types.index');\n }", "public function actionUpdate() {}", "public function actionUpdate() {}", "public function update($id, Request $request)\n\t{\n\t\tif(!Auth::user()->hasPermission('editType')){\n\t\t\treturn redirect()->route('admin.getHome')->with('flash_message_error', '403! Không thể Edit Type');\n\t\t}\n\t\t//\n\t\t$film_process = new FilmProcess();\n\t\t$film_type = FilmType::findOrFail($id);\n\t\t$film_type->type_name = $request->type_name;\n\t\t$film_type->type_alias = $film_process->getNameAlias($request->type_name);\n\t\t$film_type->save();\n\t\t//forget cache\n\t\tif(Cache::has('film_type')){\n\t\t\tCache::forget('film_type');\n\t\t}\n\t\treturn redirect()->route('admin.type.index')->with(['flash_message' => 'Thành công! Cập nhật Type: '.$request->type_name]);\n\t}", "public function actionUpdate($id)\n {\n $user = TollUsers::findIdentity(Yii::$app->user->id);\n if(!empty($user->group_id)){\n $dataTolls = ArrayHelper::map(Tolls::find()->where(['tbl_tolls.group_id' => $user->group_id])->asArray(true)->all(),'toll_id','toll_location');\n }else {\n $dataTolls = ArrayHelper::map(Tolls::find()->where(['tbl_tolls.toll_id' => $user->toll_id])->asArray(true)->all(),'toll_id','toll_location');\n }\n $dataLanguages = ArrayHelper::map(MasterLanguage::find()->asArray(true)->all(), 'lagunage_id', 'laguage_name');\n $dataUsertypes = ArrayHelper::map(MasterTollUserTypes::find()->where(['!=', 'toll_user_type_id', '1'])->all(), 'toll_user_type_id', 'type_name');\n\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n Yii::$app->getSession()->setFlash('msg', 'Toll User updated Successfully');\n return $this->redirect(['index']);\n //return $this->redirect(['view', 'id' => $model->toll_user_id]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n 'dataLanguages'=> $dataLanguages,\n 'dataUsertypes'=> $dataUsertypes,\n 'dataTolls' => $dataTolls\n ]);\n }\n }", "public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->tbs_id]);\n }\n\n return $this->render('update', [\n 'model' => $model,\n ]);\n }", "public function actionUpdate()\r\n {\r\n $this->_userAutehntication();\r\n\r\n /*\r\n * Receive all the PUT parameters\r\n */\r\n parse_str(file_get_contents('php://input'), $put_params);\r\n\r\n switch($_GET['model'])\r\n {\r\n /* Find respective model */\r\n case 'posts': \r\n $model = Post::model()->findByPk($_GET['id']); \r\n break; \r\n default: \r\n $this->_sendResponse(501, sprintf('Error: Mode <b>update</b> is not implemented for model <b>%s</b>',$_GET['model']) );\r\n exit; \r\n }\r\n if(is_null($model))\r\n $this->_sendResponse(400, sprintf(\"Error: Didn't find any model <b>%s</b> with ID <b>%s</b>.\",$_GET['model'], $_GET['id']) );\r\n \r\n /*\r\n * assign PUT parameters to attributes\r\n */ \r\n foreach($put_params as $var=>$value) {\r\n /*\r\n * Check if the model have this attribute\r\n */ \r\n if($model->hasAttribute($var)) {\r\n $model->$var = $value;\r\n } else {\r\n /* Error : model don't have this attribute */\r\n $this->_sendResponse(500, sprintf('Parameter <b>%s</b> is not allowed for model <b>%s</b>', $var, $_GET['model']) );\r\n }\r\n }\r\n /*\r\n *save the model\r\n */\r\n if($model->save()) {\r\n $this->_sendResponse(200, sprintf('The model <b>%s</b> with id <b>%s</b> has been updated.', $_GET['model'], $_GET['id']) );\r\n } else {\r\n $message = \"<h1>Error</h1>\";\r\n $message .= sprintf(\"Couldn't update model <b>%s</b>\", $_GET['model']);\r\n $message .= \"<ul>\";\r\n foreach($model->errors as $attribute=>$attribute_errors) {\r\n $message .= \"<li>Attribute: $attribute</li>\";\r\n $message .= \"<ul>\";\r\n foreach($attribute_errors as $attr_error) {\r\n $message .= \"<li>$attr_error</li>\";\r\n } \r\n $message .= \"</ul>\";\r\n }\r\n $message .= \"</ul>\";\r\n $this->_sendResponse(500, $message );\r\n }\r\n }", "public function actionUpdate($id) {\n $model = $this->loadModel($id);\n\n // Uncomment the following line if AJAX validation is needed\n // $this->performAjaxValidation($model);\n\n if (isset($_POST['Direction'])) {\n $model->attributes = $_POST['Direction'];\n if ($model->save())\n $this->redirect(array('view', 'id' => $model->id));\n }\n\n $this->render('update', array(\n 'model' => $model,\n ));\n }", "public function update(Request $request, OutcomeType $outcomeType)\n {\n $request->validate([\n 'name' => ['required', 'string']\n ]);\n $outcomeTypeModel = OutcomeType::find($outcomeType);\n $outcomeTypeModel->name = $request->input('name');\n if ($outcomeTypeModel->save()) {\n return redirect()->route('outcome-type.index');\n }\n }", "public function actionUpdate($id){\n //$id=getOrganisationID();\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n Yii::$app->session->setFlash('success', 'Saved successfully.');\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('update', [\n 'model' => $model,\n ]);\n }", "public function actionUpdate($id) {\n $model = $this->loadModel($id);\n\n // Uncomment the following line if AJAX validation is needed\n // $this->performAjaxValidation($model);\n\n if (isset($_POST['Itemstock'])) {\n $model->attributes = $_POST['Itemstock'];\n if ($model->save())\n $this->redirect(array('view', 'id' => $model->id));\n }\n\n $this->render('update', array(\n 'model' => $model,\n ));\n }", "public function actionUpdate($id)\n\t{\n\t\t$model=$this->loadModel($id);\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t// $this->performAjaxValidation($model);\n\n\t\tif(isset($_POST['Student']))\n\t\t{\n\t\t\t$model->attributes=$_POST['Student'];\n\t\t\tif($model->save())\n\t\t\t\t$this->redirect(array('view','id'=>$model->ID));\n\t\t}\n\n\t\t$this->render('update',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}", "public function update(UserTypeRequest $request, $id)\n {\n $userType = UserType::findOrFail($id);\n $result = $userType->update($request->all());\n if ($result){\n return redirect('user-type')->with('success', 'User Type Updated');\n }\n else{\n return back()->with('error','Failed to update!');\n }\n }", "public function actionUpdate($id) {\n\t\t$model = $this->findModel ( $id );\n\t\t\n\t\tif ($model->load ( Yii::$app->request->post () ) && $model->save ()) {\n\t\t\treturn $this->redirect ( [ \n\t\t\t\t\t'view','id' => $model->weid \n\t\t\t] );\n\t\t} else {\n\t\t\treturn $this->render ( 'update', [ \n\t\t\t\t\t'model' => $model \n\t\t\t] );\n\t\t}\n\t}", "public function updateAction() {\n $model = new Application_Model_Compromisso();\n //passo para a model os dados a serem upados\n $model->update($this->_getAllParams());\n //redireciono para a view\n $this->_redirect('compromisso/index');\n }", "public function update(Request $request, $id)\n {\n $fundTypes = Utils::getMainTypes();\n $request->validate([\n 'name' => 'required|unique:' . MutualFundType::$tablename . ',name,' . $id . ',id,is_trashed,NULL',\n 'main_type' => 'required|max:255|in:' . implode(',', array_keys($fundTypes)),\n ]);\n\n $mftype = MutualFundType::find($id);\n $mftype->main_type = $request['main_type'];\n $mftype->name = $request['name'];\n $mftype->description = $request['description'];\n $mftype->status = $request['status'];\n $mftype->save();\n\n return redirect()->route('type.show', $mftype->id)\n ->with('success', 'Type updated successfully.');\n }", "public function updateExpenseTypes()\n {\n $this->validate([\n 'name' => ['required', Rule::unique('expense_types')->ignore($this->expenseType->id)],\n 'description' => 'nullable',\n ]);\n\n $this->expenseType->update([\n 'name' => mb_strtolower($this->name),\n 'description' => mb_strtolower($this->description),\n ]);\n\n session()->flash('success', 'You have successfully updated an expenseType.');\n\n return redirect(route('breed-types.index'));\n }", "public function update(Request $request, MediaType $media_type)\n {\n if (!$media_type) {\n return redirect()->route('media_types.index')->with('error', 'Resource not found.');\n }\n\n $validator = Validator::make($request->all(), [\n 'label' => 'required|string|min:3',\n 'description' => 'required|string|min:3'\n ]);\n\n\n // validate inputs\n if ($validator->fails()) {\n return redirect()->back()\n ->withErrors($validator->errors())\n ->withInput($request->all());\n } else {\n $media_type->name = $request->title ? Str::slug(Str::lower($request->label)) : $media_type->name;\n $media_type->label = $request->title ? $request->label : $media_type->label;\n $media_type->description = $request->description ? $request->description : $media_type->description;\n $media_type->save();\n\n // redirect\n toast('success', 'Update successful!');\n return redirect()->route('media_types.show', $media_type)->with('media_type', $media_type);\n }\n }", "public function update(Request $request, $id)\n {\n $request->validate([\n 'title' => 'required'\n ]);\n $type = Type::findOrFail($id);\n $input = $request->all();\n\n $type->update($input);\n\n Session::flash('message', 'You successfully update the type');\n\n return redirect()->route('admin.type.index');\n }", "public function updateType(Request $request)\n {\n /*--------- Validating Data -------------------*/\n $rules = array (\n 'SolarTypeName' => 'required',\n 'SolarTypePrice' => 'required|max:7',\n );\n\n $validator = Validator::make($request->all(), $rules);\n if ($validator->fails()) {\n return Redirect::back()->withErrors($validator)->withInput();\n }\n\n $update = SolarPanelType::where('id', $request->KeyToEdit)\n ->update([\n 'solarTypeName' => $request->SolarTypeName,\n 'price' => $request->SolarTypePrice,\n ]);\n\n // if success\n if ($update) {\n alert()->success('saved with success!', 'Done!');\n return Redirect()->back();\n }\n alert()->danger('Failed to save', 'Oops!');\n return Redirect()->back();\n\n }", "public function actionUpdate($id)\n\t{\n $this->layout='admin';\n \n\t\t$model=$this->loadModel($id);\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t// $this->performAjaxValidation($model);\n\n\t\tif(isset($_POST['Bet']))\n\t\t{\n\t\t\t$model->attributes=$_POST['Bet'];\n\t\t\tif($model->save())\n\t\t\t\t$this->redirect(array('view','id'=>$model->id));\n\t\t}\n\n\t\t$this->render('update',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}", "public function actionUpdate($id)\n {\n $model=$this->loadModel($id);\n\n // Uncomment the following line if AJAX validation is needed\n // $this->performAjaxValidation($model);\n\n if(isset($_POST['StudentReg']))\n {\n $model->attributes=$_POST['StudentReg'];\n if($model->save())\n $this->redirect(array('view','id'=>$model->id));\n }\n\n $this->render('update',array(\n 'model'=>$model,\n ));\n }", "public function actionUpdate(string $id)\n {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post())) {\n\n $model->save();\n return $this->redirect(['index', 'id' => $model->smartgroup_code]);\n } else {\n return $this->renderAjax('update', [\n 'model' => $model,\n 'valStt'=>self::aryStatus(),\n ]);\n }\n }", "public function updateType(Request $request, $id)\n {\n $type = ExpenseType::find($id);\n $type->name = $request->name;\n $type->save();\n Flash::success(trans('general.successfully_saved'));\n return redirect('expense/type/data');\n }", "public function updated($model)\n {\n }", "public function update(Request $request, Stations $stations)\n {\n //\n }", "public function update($id, UpdateSaleryTypeRequest $request)\n {\n $saleryType = $this->saleryTypeRepository->findWithoutFail($id);\n\n if (empty($saleryType)) {\n Flash::error('Salery Type not found');\n\n return redirect(route('saleryTypes.index'));\n }\n\n $saleryType = $this->saleryTypeRepository->update($request->all(), $id);\n\n Flash::success('Salery Type updated successfully.');\n\n return redirect(route('saleryTypes.index'));\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'type' => 'required|max:255',\n ]);\n\n Type::find($id)->update([\n 'type' => $request['type'],\n ]\n );\n return redirect()->route('types.index')\n ->with('success','Tipo di utente modificato');\n }", "public function actionUpdate($order_id, $item_id, $shipping_id)\n{\n$model = $this->findModel($order_id, $item_id, $shipping_id);\n\nif ($model->load(Yii::$app->request->post()) && $model->save()) {\nreturn $this->redirect(['view', 'order_id' => $model->order_id, 'item_id' => $model->item_id, 'shipping_id' => $model->shipping_id]);\n} else {\nreturn $this->render('update', [\n'model' => $model,\n]);\n}\n}", "public function update(Request $request, FormType $form_type)\n {\n $form_type->update($request->all());\n\n return redirect()->route('admin.form-type.index')->with('success', 'Form Type updated');\n }", "public function actionUpdate($id)\n\t{\n\t\t$model=$this->loadModel($id);\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t// $this->performAjaxValidation($model);\n\n\t\tif(isset($_POST['Student']))\n\t\t{\n\t\t\t$model->attributes=$_POST['Student'];\n\t\t\tif($model->save())\n\t\t\t\t$this->redirect(array('view','id'=>$model->record_id));\n\t\t}\n\n\t\t$this->render('update',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}", "public function update(Request $request, $id)\n {\n UnitTypes::where('id', $id)->update(['name' => $request->name]);\n return redirect(route('unit-type.index'));\n //\n }", "public function actionUpdate($id) {\n $model = $this->loadModel($id);\n\n // Uncomment the following line if AJAX validation is needed\n // $this->performAjaxValidation($model);\n\n if (isset($_POST['GestionStock'])) {\n $model->attributes = $_POST['GestionStock'];\n if ($model->save())\n $this->redirect(array('view', 'id' => $model->id));\n }\n\n $this->render('update', array(\n 'model' => $model,\n ));\n }", "public function actionUpdate($id)\n\t{\n\t\t$model=$this->loadModel($id);\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t// $this->performAjaxValidation($model);\n\t\t\n\t\t$_brands = Brands::model()->findAll(array(\n\t\t\t'select'=>'BrandId, BrandName', 'condition'=>'status=\\'ACTIVE\\''));\n\t\t$brands = array();\n\t\tforeach($_brands as $row) {\n\t\t\t$brands[$row->BrandId] = $row->BrandName;\n\n\t\t}\n\t\t\n\t\t$_campaigns = Campaigns::model()->findAll(array(\n\t\t\t'select'=>'CampaignId, BrandId, CampaignName', 'condition'=>'status=\\'ACTIVE\\''));\n\t\t$campaigns = array();\n\t\tforeach($_campaigns as $row) {\n\t\t\t$campaigns[$row->CampaignId] = $row->CampaignName;\n\n\t\t}\n\t\t\n\t\t$_channels = Channels::model()->findAll(array(\n\t\t\t'select'=>'ChannelId, BrandId, CampaignId, ChannelName', 'condition'=>'status=\\'ACTIVE\\''));\n\t\t$channels = array();\n\t\tforeach($_channels as $row) {\n\t\t\t$channels[$row->ChannelId] = $row->ChannelName;\n\n\t\t}\n\t\t\n\t\t$_rewardslist = RewardsList::model()->findAll(array(\n\t\t\t'select'=>'RewardId, Title', 'condition'=>'status=\\'ACTIVE\\''));\n\t\t$rewardslist = array();\n\t\tforeach($_rewardslist as $row) {\n\t\t\t$rewardslist[$row->RewardId] = $row->Title;\n\n\t\t}\n\n\t\tif(isset($_POST['Points']))\n\t\t{\n\t\t\t$model->attributes=$_POST['Points'];\n\t\t\t$model->setAttribute(\"DateUpdated\", new CDbExpression('NOW()'));\n\t\t\t$model->setAttribute(\"UpdatedBy\", Yii::app()->user->id);\n\t\t\tif($model->save())\n\t\t\t{\n\t\t\t\t$utilLog = new Utils;\n\t\t\t\t$utilLog->saveAuditLogs();\n\t\t\t\t$this->redirect(array('view','id'=>$model->PointsId));\n\t\t\t}\n\t\t}\n\n\t\t$this->render('update',array(\n\t\t\t'model'=>$model,\n\t\t\t'brand_id'=>$brands,\n\t\t\t'channel_id'=>$channels,\n\t\t\t'campaign_id'=>$campaigns,\n\t\t\t'rewardlist_id'=>$rewardslist,\n\t\t));\n\t}", "public function actionUpdate($id)\n\t{\n\t\tYii::import('ext.multimodelform.MultiModelForm');\n \n\t\t$model=$this->loadModel($id);\n\n\t\t$eventType=new EventType;\n\t\t$member=new EventAttribute;\n\t\t$validatedMembers = array(); // ensure an empty array\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t// $this->performAjaxValidation($model);\n\n\t\tif(isset($_POST['Event']))\n\t\t{\n\t\t\t$model->attributes=$_POST['Event'];\n\t\t\tif($model->save())\n\t\t\t\t$this->redirect(array('view','id'=>$model->idEvent));\n\t\t}\n\n\t\t$this->render('update',array(\n\t\t\t'model'=>$model,\n\t\t\t\t'eventType'=>$eventType,\n\t\t\t\t'member'=>$member,\n\t\t\t\t'validatedMembers'=>$validatedMembers,\n\t\t));\n\t}", "public function update(Request $request, $id)\n {\n $typeedit = ProductType::findOrFail($id);\n $typeedit = $typeedit->update($request->only('name', 'created_by', 'updated-by'));\n if($typeedit) return redirect()->route('product-type.index')->with('success','Saved');\n return redirect()->back()->with('failed','Failed');\n }", "public function update($type, $id = null);", "public function update(Request $request, $id)\n {\n $type=Trucktype::find($id);\n $type->trucktype=$request->trucktype;\n $type->avg_criteria=$request->avg_criteria;\n // $type->ipaddress=$request->getClientIp();\n // $type->createdby=auth()->user()->id;\n \n $type->save();\n return redirect(route('type.index'))->with('message','Truck Type Update Successfully.');\n }", "public function updating($model)\n\t{\n\t}", "public function update($id)\n\t{\n\t\t$gametype = Gametype::findOrFail($id);\n\n\t\t$validator = Validator::make($data = Input::all(), Gametype::$rules);\n\n\t\tif ($validator->fails())\n\t\t{\n\t\t\treturn Redirect::back()->withErrors($validator)->withInput();\n\t\t}\n\n\t\t$gametype->update($data);\n\n\t\treturn Redirect::route('gametypes.index');\n\t}", "public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n if($model->type == 'cards') {\n $dataProviderCards = new ActiveDataProvider([\n 'query' => InfoBlockCard::find()->where(['block_id' => $id])->orderBy('sort')\n ]);\n }\n \n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n $part = Structure::findOne($model->structure_id);\n if($part->type_id !== 2) {\n return $this->redirect($part->getAdminUrl());\n }\n return $this->redirect(['index', 'id' => $model->structure_id]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n 'dataProviderCards' => isset($dataProviderCards) ? $dataProviderCards : null\n ]);\n }\n }", "public function update()\r\n {\r\n if (isset($_POST[\"update\"])) {\r\n // Instance new Model (Song)\r\n $profile = new Profile();\r\n // do updateSong() from model/model.php\r\n $profile->breyta($_POST[\"nafn\"], $_POST[\"pass\"], $_POST[\"user\"]);\r\n }\r\n // where to go after song has been added\r\n header('location: ' . URL . 'profile/index');\r\n }", "public function actionUpdate($s,$ver,$t, $y)\n {\n $model = $this->findModel($s,$ver,$t,$y);\n\n if ($model->load(Yii::$app->request->post()) ) {\n //$model->person_id = $person_id;\n $doctorate = $model->degree_doctorate;\n $bachelor = $model->degree_bachelor;\n $master = $model->degree_master;\n $sum = $bachelor+$master+$doctorate;\n $model->amount_ta_all = $sum;\n $model->subject_id = $s;\n $model->udby = Yii::$app->user->id;\n $model->udtime = date('Y-m-d H:i:s');\n $model->save();\n $this->layout = \"main_modules\";\n return $this->redirect(['view',\n 's' => $model->subject_id,\n 'ver' => $model->subject_version,\n 't' => $model->term_id,\n 'y' => $model->year]);\n }\n $this->layout = \"main_modules\";\n return $this->render('update', [\n 'model' => $model,\n 's_id'=>$s, 't'=>$t,'y'=>$y,\n ]);\n }", "public function action_update()\n {\n\t $this->template = View::forge('template-admin');\n\n\t\t$get = Input::get();\n\t\t$id = $get[\"id\"];\n\t\t$data[\"update\"] = Model_Event::find_by('id',$id);\n\t\t$data[\"category\"] = Model_Category::find_all();\n\t\t$this->template->title = \"イベント更新\";\n\t\t$this->template->content = View::forge('event/update', $data);\n }", "public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['index', 'id' => $_SESSION['switch_id']]);\n }\n\n return $this->render('update', [\n 'model' => $model,\n ]);\n }", "public function update(Request $request, TypesConges $typesConges)\n {\n //\n }", "public function actionUpdate($id)\n\t{\n\t\t$model = $this->loadModel ( $id );\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t// $this->performAjaxValidation($model);\n\n\t\tif (isset ( $_POST ['Whitelist'] ))\n\t\t{\n\t\t\t$model->attributes = $_POST ['Whitelist'];\n\t\t\tif ($model->save ())\n\t\t\t\t$this->redirect ( array (\n\t\t\t\t\t\t'view',\n\t\t\t\t\t\t'id' => $model->id\n\t\t\t\t) );\n\t\t}\n\n\t\t$this->render ( 'update', array (\n\t\t\t\t'model' => $model\n\t\t) );\n\t}", "public function actionUpdate($id)\n\t{\n\t\t$model=$this->loadModel($id);\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t// $this->performAjaxValidation($model);\n\n\t\tif(isset($_POST['CollectionShop']))\n\t\t{\n\t\t\t$model->attributes=$_POST['CollectionShop'];\n\t\t\tif($model->save())\n\t\t\t\t$this->redirect(array('view','id'=>$model->id));\n\t\t}\n\n\t\t$this->render('update',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}", "function update()\n {\n $nim = $this->input->post('nim');\n $nama = $this->input->post('nama');\n $kota = $this->input->post('kota');\n $this->siswa_model->update($nim, $nama, $kota);\n redirect('siswa/page');\n }", "public function actionUpdate($id)\n\t{\n\t\t$model=$this->loadModel($id);\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t// $this->performAjaxValidation($model);\n\n\t\tif(isset($_POST['WuTjuserall']))\n\t\t{\n\t\t\t$model->attributes=$_POST['WuTjuserall'];\n\t\t\t$model->updatetime=time();\n\t\t\tif($model->save())\n\t\t\t $this->redirect(array('index'));\n\t\t}\n\n\t\t$this->render('update',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}", "public function update(ClassRequest $request, ClassModel $class)\n {\n $this -> authorize(\"update\", ClassModel::class);\n\n $class -> update($request -> all());\n\n return redirect()\n -> route(\"admin.class.edit\", $class -> id)\n -> with(\"success\", \"Class was updated successfully!\");\n }", "public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n $modelSpecialita=ArrayHelper::map(SfidaSpecialita::find()\n ->orderby('sfs_specialita')\n ->asArray()\n ->all(), 'sfs_id', 'sfs_specialita');\n $modelTipologia=ArrayHelper::map(TipologiaMzt::find()\n ->orderby('tmz_tipologia')\n ->asArray()\n ->all(), 'tmz_id', 'tmz_tipologia');\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->sfd_id]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n 'modelSpecialita' => $modelSpecialita,\n 'modelTipologia' => $modelTipologia,\n ]);\n }\n }", "public function actionUpdate($id) {\n $this->active_menu = \"mcms\";\n $this->open_class = \"category\";\n $this->active_class = \"piadmin\";\n $model = $this->loadModel($id);\n\n // Uncomment the following line if AJAX validation is needed\n // $this->performAjaxValidation($model);\n\n if (isset($_POST['Purchaseitem'])) {\n $model->attributes = $_POST['Purchaseitem'];\n $model->goods_service=$_POST['Purchaseitem']['goods_service'];\n if($_POST['Purchaseitem']['goods_service']==\"Good\"){\n $model->gst_code_type = 'HSN';\n }else{\n $model->gst_code_type = 'SAC';\n }\n $model->low_qty = $_POST['Purchaseitem']['low_qty'];\n $model->type = $_POST['Purchaseitem']['type'];\n $model->gst_code = $_POST['Purchaseitem']['gst_code']; \n $model->gst_percent = $_POST['Purchaseitem']['gst_percent'];\n $model->cess_tax = $_POST['Purchaseitem']['cess_tax'];\n $model->item_classification=$_POST['Purchaseitem']['item_classification'];\n $model->cess_percent=$_POST['Purchaseitem']['cess_percent'];\n if ($model->save()) {\n if (empty($model->barcode)) {\n $model->barcode = time() . $model->id;\n $model->save();\n }\n d21('Purchase Item updated by ' . Yii::app()->user->getUsername(), \"site.login\");\n $this->redirect(array('admin'));\n }\n }\n\n $this->render('update', array(\n 'model' => $model,\n ));\n }", "public function actionUpdate($id) {\n\t\t$model = $this->findModel ( $id );\n\t\t\n\t\tif ($model->load ( Yii::$app->request->post () ) && $model->save ()) {\n\t\t\treturn $this->redirect ( [ \n\t\t\t\t\t'view',\n\t\t\t\t\t'id' => $model->id \n\t\t\t] );\n\t\t}\n\t\t\n\t\treturn $this->render ( 'update', [ \n\t\t\t\t'model' => $model \n\t\t] );\n\t}" ]
[ "0.60754275", "0.5915391", "0.59011877", "0.58788633", "0.573481", "0.56977385", "0.5680974", "0.56350094", "0.56233704", "0.5614982", "0.56101143", "0.55369437", "0.55229217", "0.55017155", "0.5494542", "0.5480081", "0.5480007", "0.54778075", "0.5476052", "0.5469511", "0.5450234", "0.54496026", "0.5444619", "0.5439922", "0.5431937", "0.54173154", "0.54089236", "0.5393406", "0.5389206", "0.5383154", "0.5380099", "0.53787655", "0.53777087", "0.5352975", "0.53482455", "0.53464437", "0.5339288", "0.5339093", "0.5332906", "0.5329873", "0.5328849", "0.5327129", "0.5325526", "0.5318821", "0.52907205", "0.52898526", "0.52693534", "0.5258536", "0.5244783", "0.5244783", "0.52442557", "0.52406746", "0.52406067", "0.52293193", "0.52241397", "0.52237356", "0.52183104", "0.5214349", "0.52092797", "0.5208635", "0.5208478", "0.5206964", "0.51969343", "0.51956314", "0.5192073", "0.51849395", "0.51798373", "0.5178112", "0.5177415", "0.51767194", "0.5165391", "0.5162445", "0.51610243", "0.51601064", "0.5157281", "0.5156588", "0.515262", "0.5151721", "0.5150478", "0.5135404", "0.51315904", "0.51297605", "0.5128978", "0.51261127", "0.5119482", "0.5118938", "0.5117144", "0.51129645", "0.5110254", "0.5109747", "0.5107712", "0.51008356", "0.50986576", "0.50981975", "0.5095438", "0.50947386", "0.5093543", "0.50927204", "0.5087694", "0.50867516", "0.50784737" ]
0.0
-1
Deletes an existing StampCases model. If deletion is successful, the browser will be redirected to the 'index' page.
public function actionDelete($id) { $model = $this->findModel($id); // if($model->image){ // unlink(Yii::getAlias('@webroot').'/images/stamp/'.$model->image); // } $model->deleted = Stamp::DELETED; if($model->update()){ Yii::$app->getSession()->setFlash('', ['type'=>'success','message' => 'Информация удалена']); } return $this->redirect(['index']); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function actionDelete()\n {\n if ($post = Template::validateDeleteForm()) {\n $id = $post['id'];\n $this->findModel($id)->delete();\n }\n return $this->redirect(['index']);\n }", "public function deleteAction()\n\t{\n\t\t$message = 'Une erreur est survenue. Votre &eacute;cole n\\'a pas été supprimé.';\n\n\t\t$school = School::find( (int) $this->getRequest()->post('id') );\n\t\t$deleted = $school->delete();\n\n\t\tif ( $deleted ) {\n\t\t\t$message = 'Votre &eacute; a correctement été supprimé.';\n\t\t}\n\t\t$this->render( View::make( 'schools/index' , array(\n\t\t\t'status' => $deleted,\n\t\t\t'message' => $message,\n\t\t\t'title' => 'Mes &Eacute;coles',\n\t\t\t'entities' => School::all()\n\t\t) ) );\n\t}", "public function actionDelete()\n\t{\n\t\t// using the default layout 'protected/views/layouts/main.php'\n\t\t\n\t\t\n\t\t$this->checkUser();\n\t\t$this->checkActivation();\n\t//\t$model = new Estate;\n\t\t\n\t\tif($model===null)\n\t\t{\n\t\t\tif(isset($_GET['id']))\n\t\t\t\t$model=Estate::model()->findbyPk($_GET['id']);\n\t\t\tif($model===null)\n\t\t\t\tthrow new CHttpException(404, Yii::t('app', 'The requested page does not exist.'));\n\t\t}\n\t\t\n\t\tEstateImage::deleteAllImages($model->id);\t\n\t\t@unlink(dirname(Yii::app()->request->scriptFile).$model->tour);\n\t\t@unlink(dirname(Yii::app()->request->scriptFile).$model->image);\n\t\t\n\t\t$model->delete();\n\t\t\n\t\t\n\t\tModeratorLogHelper::AddToLog('deleted-estate-'.$model->id,'Удален объект #'.$model->id.' '.$model->title,null,$model->user_id);\n\t\t$this->redirect('/cabinet/index');\n\t\t\n\t}", "public function actionDelete()\n {\n $id = Yii::$app->request->post('id');\n try {\n $this->findModel($id)->delete();\n } catch (StaleObjectException $e) {\n } catch (NotFoundHttpException $e) {\n } catch (\\Throwable $e) {\n }\n\n return $this->redirect(['index']);\n }", "public function delete() {\n $flg = $this->Seatmodel->delete();\n\n if (!empty($flg)) {\n $this->session->set_flashdata('successmessage', 'Data deleted successfully');\n } else {\n $this->session->set_flashdata('errormessage', 'Oops! Something went wrong');\n }\n\n redirect(base_url('admin-seat-list'));\n }", "public function delete()\n {\n $this->model->deleteStations($_GET['id']);\n $this->model->deleteZone($_GET['id']);\n header(\"Location: /resabike/zone\");\n }", "public function actionDelete()\n {\n $id= @$_POST['id'];\n if($this->findModel($id)->delete()){\n echo 1;\n }\n else{\n echo 0;\n }\n\n return $this->redirect(['index']);\n }", "public function actionDelete($id)\n {\n\t\t$model = $this->findModel($id);\n\n\t\t$model->delete();\n\n return $this->redirect(['index']);\n }", "public function actionDelete($id){\n $this->findModel($id)->delete();\n\n return $this->redirect(['index']);\n }", "public function actionDelete($id)\n {\n $this->findModel($id)->delete();\n\n return $this->redirect(['index']); \n }", "public function actionDelete($id)\n {\n $this->findModel($id)->delete();\n\n return $this->redirect(['index']); \n }", "public function actionDelete()\n {\n $post = Yii::$app->request->post();\n\n InsightsContent::findOne($post['InsightsContent']['id'])->delete();\n $this->findModel($post['InsightsDef']['name'])->delete();\n\n return $this->redirect(['create']);\n }", "public function delete()\n {\n Contest::destroy($this->modelId);\n $this->modalConfirmDeleteVisible = false;\n $this->resetPage();\n }", "public function actionDelete($id)\n {\n $model = $this->findModel($id);\n $model->delete();\n\n\n return $this->redirect(['index']);\n }", "public function actionDelete($id)\n {\n $model = $this->findModel($id);\n $model->delete();\n return $this->redirect(['index']);\n }", "public function actionDelete($id)\n {\n $model = $this->findModel($id);\n $model->delete();\n return $this->redirect(['index']);\n }", "public function actionDelete($id)\n {\n \t//echo 'hello'; exit;\n \t$model = Courses::findOne($id);\n \t$sid = $model->sem_id ;\n $this->findModel($id)->delete();\n return $this->redirect(['/semisters/semisters/view', 'id' =>$model->sem_id]);\n\n //return $this->redirect(['index']);\n }", "public function actionDelete($id) {\r\n $this->findModel($id)->delete();\r\n\r\n return $this->redirect(['index']);\r\n }", "public function actionDelete($id) {\n $this->findModel($id)->delete();\n\n return $this->redirect(['index']);\n }", "public function actionDelete($id) {\n $this->findModel($id)->delete();\n\n return $this->redirect(['index']);\n }", "public function actionDelete($id) {\n\t\t$this->findModel($id)->delete();\n\t\treturn $this->redirect(['index']);\n\t}", "public function actionDelete()\r\n {\r\n $this->_userAutehntication();\r\n\r\n switch($_GET['model'])\r\n {\r\n /* Load the respective model */\r\n case 'posts': \r\n $model = Post::model()->findByPk($_GET['id']); \r\n break; \r\n default: \r\n $this->_sendResponse(501, sprintf('Error: Mode <b>delete</b> is not implemented for model <b>%s</b>',$_GET['model']) );\r\n exit; \r\n }\r\n /* Find the model */\r\n if(is_null($model)) {\r\n // Error : model not found\r\n $this->_sendResponse(400, sprintf(\"Error: Didn't find any model <b>%s</b> with ID <b>%s</b>.\",$_GET['model'], $_GET['id']) );\r\n }\r\n\r\n /* Delete the model */\r\n $response = $model->delete();\r\n if($response>0)\r\n $this->_sendResponse(200, sprintf(\"Model <b>%s</b> with ID <b>%s</b> has been deleted.\",$_GET['model'], $_GET['id']) );\r\n else\r\n $this->_sendResponse(500, sprintf(\"Error: Couldn't delete model <b>%s</b> with ID <b>%s</b>.\",$_GET['model'], $_GET['id']) );\r\n }", "public function actionDelete($id)\n {\n $model=$this->findModel ( $id );\n\t\t$model->is_delete=1;\n\t\t$model->save ();\n\n return $this->redirect(['index']);\n }", "public function actionDelete($id)\n {\n $model = $this->findModel($id);\n\n $model->delete();\n\n return $this->redirect(['index']);\n }", "public function actionDelete($id)\n {\n $model = $this->findModel($id);\n\n $model->delete();\n\n return $this->redirect(['index']);\n }", "public function actionDelete($id)\r\n {\r\n $this->findModel($id)->delete();\r\n return $this->redirect(['index']);\r\n }", "public function actionDelete($id)\n {\n // $this->findModel($id)->delete();\n\n return $this->redirect(['index']);\n }", "public function actionDelete($id)\n\t{\n\t\t$this->findModel($id)->delete();\n\n\t\treturn $this->redirect(['index']);\n\t}", "public function actionDelete($id)\n\t{\n\t\t$this->findModel($id)->delete();\n\n\t\treturn $this->redirect(['index']);\n\t}", "public function actionDelete($id)\n\t{\n\t\t$this->findModel($id)->delete();\n\n\t\treturn $this->redirect(['index']);\n\t}", "public function actionDelete($id)\n\t{\n\t\t$this->findModel($id)->delete();\n\n\t\treturn $this->redirect(['index']);\n\t}", "public function actionDelete($id) {\n $this->findModel($id)->delete();\n return $this->redirect(['index']);\n }", "public function actionDelete()\n {\n $id = Yii::$app->request->post('id');\n $this->findModel($id)->delete();\n }", "public function actionDelete()\n {\n if(isset($_POST['id'])){\n $id = $_POST['id'];\n $this->findModel($id)->delete();\n echo \"success\";\n }\n }", "public function actionDelete($id) {\n\t\t$this->findModel($id)->delete();\n\n\t\treturn $this->redirect(['index']);\n\t}", "public function actionDelete($id) {\n\t\t$this->findModel($id)->delete();\n\n\t\treturn $this->redirect(['index']);\n\t}", "public function actionDelete($id)\r\n {\r\n $this->findModel($id)->delete();\r\n\r\n return $this->redirect(['index']);\r\n }", "public function actionDelete($id)\r\n {\r\n $this->findModel($id)->delete();\r\n\r\n return $this->redirect(['index']);\r\n }", "public function actionDelete($id)\r\n {\r\n $this->findModel($id)->delete();\r\n\r\n return $this->redirect(['index']);\r\n }", "public function actionDelete($id)\r\n {\r\n $this->findModel($id)->delete();\r\n\r\n return $this->redirect(['index']);\r\n }", "public function actionDelete($id)\r\n {\r\n $this->findModel($id)->delete();\r\n\r\n return $this->redirect(['index']);\r\n }", "public function actionDelete($id)\r\n {\r\n $this->findModel($id)->delete();\r\n\r\n return $this->redirect(['index']);\r\n }", "public function actionDelete($id)\r\n {\r\n $this->findModel($id)->delete();\r\n\r\n return $this->redirect(['index']);\r\n }", "public function actionDelete($id) {\n\t\t$this->findModel ( $id )->delete ();\n\t\t\n\t\treturn $this->redirect ( [ \n\t\t\t\t'index' \n\t\t] );\n\t}", "public function actionDelete($id) {\n\t\t$this->findModel ( $id )->delete ();\n\t\t\n\t\treturn $this->redirect ( [ \n\t\t\t\t'index' \n\t\t] );\n\t}", "public function actionDelete($id)\n {\n $model = $this->findModel($id);\n \n $model->delete();\n return $this->redirect([\n 'index'\n ]);\n }", "public function actionDelete()\n\t{\n\t parent::actionDelete();\n\t\t$model=$this->loadModel($_POST['id']);\n\t\t $model->delete();\n\t\techo CJSON::encode(array(\n 'status'=>'success',\n 'div'=>'Data deleted'\n\t\t\t\t));\n Yii::app()->end();\n\t}", "public function actionDelete($id) {\n $this->findModel($id)->delete();\n\n return $this->redirect(['index']);\n }", "public function actionDelete($id) {\n $this->findModel($id)->delete();\n\n return $this->redirect(['index']);\n }", "public function actionDelete($id) {\n $this->findModel($id)->delete();\n\n return $this->redirect(['index']);\n }", "public function actionDelete($id) {\n $this->findModel($id)->delete();\n\n return $this->redirect(['index']);\n }", "public function actionDelete($id) {\n $this->findModel($id)->delete();\n\n return $this->redirect(['index']);\n }", "public function actionDelete($id) {\n $this->findModel($id)->delete();\n\n return $this->redirect(['index']);\n }", "public function actionDelete($id) {\n $this->findModel($id)->delete();\n\n return $this->redirect(['index']);\n }", "public function actionDelete($id) {\n $this->findModel($id)->delete();\n\n return $this->redirect(['index']);\n }", "public function actionDelete($id) {\n $this->findModel($id)->delete();\n\n return $this->redirect(['index']);\n }", "public function actionDelete($id) {\n $this->findModel($id)->delete();\n\n return $this->redirect(['index']);\n }", "public function actionDelete($id) {\n $this->findModel($id)->delete();\n\n return $this->redirect(['index']);\n }", "public function actionDelete($id) {\n $this->findModel($id)->delete();\n\n return $this->redirect(['index']);\n }", "public function actionDelete($id) {\n $this->findModel($id)->delete();\n\n return $this->redirect(['index']);\n }", "public function actionDelete($id) {\n $this->findModel($id)->delete();\n\n return $this->redirect(['index']);\n }", "public function actionDelete($id) {\n $this->findModel($id)->delete();\n\n return $this->redirect(['index']);\n }", "public function actionDelete($id) {\n $this->findModel($id)->delete();\n\n return $this->redirect(['index']);\n }", "public function actionDelete($id) {\n $this->findModel($id)->delete();\n\n return $this->redirect(['index']);\n }", "public function actionDelete($id) {\n $this->findModel($id)->delete();\n\n return $this->redirect(['index']);\n }", "public function actionDelete($id) {\n $this->findModel($id)->delete();\n\n return $this->redirect(['index']);\n }", "public function actionDelete($id) {\n $this->findModel($id)->delete();\n\n return $this->redirect(['index']);\n }", "public function actionDelete($id) {\n $this->findModel($id)->delete();\n\n return $this->redirect(['index']);\n }", "public function actionDelete($id) {\n $this->findModel($id)->delete();\n\n return $this->redirect(['index']);\n }", "public function actionDelete($id) {\n $this->findModel($id)->delete();\n\n return $this->redirect(['index']);\n }", "public function actionDelete($id) {\n $this->findModel($id)->delete();\n\n return $this->redirect(['index']);\n }", "public function actionDelete($id) {\n $this->findModel($id)->delete();\n\n return $this->redirect(['index']);\n }", "public function actionDelete($id)\n {\n if(Yii::$app->user->can('site-clerk'))\n {\n $this->findModel($id)->delete();\n return $this->redirect(['index']);\n }else \n {\n $this->redirect(\\Yii::$app->urlManager->createURL(\"site/login\"));\n }\n \n }", "public function actionDelete($id)\n {\n $this->_findModel($id)->delete();\n return $this->redirect(['index']);\n }", "public function actionDelete($id)\n { \n\t\t$model = $this->findModel($id); \n $model->isdel = 1;\n $model->save();\n //$model->delete(); //this will true delete\n \n return $this->redirect(['index']);\n }", "public function actionDelete($id)\n {\n $model = $this->findModel($id);\n $model->isDelete = 1;\n $model->save();\n return $this->redirect(['index']);\n }", "public function actionDelete($id)\n {\n $this->findModel($id)->delete();\n return $this->redirect(['index']);\n }", "public function actionDelete($id)\n {\n $this->findModel($id)->delete();\n return $this->redirect(['index']);\n }", "public function actionDelete($id)\n {\n $this->findModel($id)->delete();\n return $this->redirect(['index']);\n }", "public function actionDelete($id) {\r\n\t\t$this->findModel ( $id )->delete ();\r\n\t\t\r\n\t\treturn $this->redirect ( [ \r\n\t\t\t\t'index' \r\n\t\t] );\r\n\t}", "public function actionDelete($id)\n {\n\t$model = static::findModel($id);\n\n\t$this->processData($model, 'delete');\n\n\t$model->delete();\n\n \treturn $this->redirect(['index']);\n }", "public function actionDelete($id)\n {\n $this->findModel($id)->delete();\n\n return $this->redirect(['index']);\n }", "public function actionDelete($id)\n {\n $this->findModel($id)->delete();\n\n return $this->redirect(['index']);\n }", "public function actionDelete()\n {\n if (!$this->isAdmin()) {\n $this->getApp()->action403();\n }\n\n $request = $this->getApp()->getRequest();\n $id = $request->paramsNamed()->get('id');\n $model = $this->findModel($id);\n if (!$model) {\n $this->getApp()->action404();\n }\n\n $model->delete();\n\n return $this->back();\n }", "public function destroyAction() {\n $model = new Application_Model_Compromisso();\n //mando para a model o id de quem sera excluido\n $model->delete($this->_getParam('id'));\n //redireciono\n $this->_redirect('compromisso/index');\n }", "public function actionDelete( $id )\n {\n $this->findModel( $id )->delete();\n\n return $this->redirect( [ 'index' ] );\n }", "public function actionDelete($id)\n {\n $this->findModel($id)->delete();\n\n return $this->redirect(['site/verleih']);\n }", "public function actionDelete()\n\t{\n\t\t$id = intval($_GET['iId']);\n\t\t$this->loadModel($id)->delete();\n\t\t$this->redirect('/app/DayPush/index');\n\t}", "public function actionDelete($id)\n {\n $model = $this->findModel($id);\n $model->delete();\n\n return $this->redirect(['index' , 'goods_id' => $model->goods_id]);\n }", "public function delete_record()\n {\n $id = $this->input->get('tpid');\n\n $result = $this->PumpModel->delete_data(array('tpid'=>$id));\n // print_r($result);die;\n redirect(base_url(). 'Pump');\n }", "public function actionDelete($id)\n {\n $this->findModel($id)->delete();\n\n return $this->redirect(['index']);\n }", "public function actionDelete($id)\n {\n $this->findModel($id)->delete();\n\n return $this->redirect(['index']);\n }", "public function actionDelete($id)\n {\n $this->findModel($id)->delete();\n\n return $this->redirect(['index']);\n }", "public function actionDelete($id)\n {\n $this->findModel($id)->delete();\n\n return $this->redirect(['index']);\n }", "public function actionDelete($id)\n {\n $this->findModel($id)->delete();\n\n return $this->redirect(['index']);\n }", "public function actionDelete($id)\n {\n $this->findModel($id)->delete();\n\n return $this->redirect(['index']);\n }", "public function actionDelete($id)\n {\n $this->findModel($id)->delete();\n\n return $this->redirect(['index']);\n }", "public function actionDelete($id)\n {\n $this->findModel($id)->delete();\n\n return $this->redirect(['index']);\n }", "public function actionDelete($id)\n {\n $this->findModel($id)->delete();\n\n return $this->redirect(['index']);\n }", "public function actionDelete($id)\n {\n $this->findModel($id)->delete();\n\n return $this->redirect(['index']);\n }" ]
[ "0.67686564", "0.65571296", "0.6515525", "0.6482436", "0.64472526", "0.6426697", "0.63928956", "0.62546724", "0.6238079", "0.6211547", "0.6211547", "0.62002486", "0.62001675", "0.61876905", "0.61647266", "0.61647266", "0.6158437", "0.615395", "0.6152811", "0.6152811", "0.6140631", "0.61357915", "0.61222106", "0.61105996", "0.61105996", "0.6108633", "0.610529", "0.6099681", "0.6099681", "0.6099681", "0.6099681", "0.60966456", "0.6096163", "0.60861343", "0.608035", "0.608035", "0.60747737", "0.60747737", "0.60747737", "0.60747737", "0.60747737", "0.60747737", "0.60747737", "0.6058542", "0.6058542", "0.60569125", "0.60565364", "0.6052", "0.6052", "0.6052", "0.6052", "0.6052", "0.6052", "0.6052", "0.6052", "0.6052", "0.6052", "0.6052", "0.6052", "0.6052", "0.6052", "0.6052", "0.6052", "0.6052", "0.6052", "0.6052", "0.6052", "0.6052", "0.6052", "0.6052", "0.6052", "0.6052", "0.60429966", "0.6041533", "0.60405207", "0.6039794", "0.6038948", "0.6038948", "0.6038948", "0.6037694", "0.6033634", "0.6031417", "0.6031417", "0.6029023", "0.6026807", "0.6017069", "0.6005637", "0.60038275", "0.5999716", "0.5997663", "0.59947306", "0.59947306", "0.59947306", "0.59947306", "0.59947306", "0.59947306", "0.59947306", "0.59947306", "0.59947306", "0.59947306" ]
0.6137031
21
Finds the StampCases model based on its primary key value. If the model is not found, a 404 HTTP exception will be thrown.
protected function findModel($id) { if (($model = Stamp::findOne($id)) !== null) { return $model; } else { throw new NotFoundHttpException('The requested page does not exist.'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function loadModel($id)\n {\n $model=Seat::model()->findByPk($id);\n if($model===null)\n throw new CHttpException(404,'The requested page does not exist.');\n return $model;\n }", "protected function findModel($ClearByID, $ClearanceLevelCode, $Department, $StudentID)\n {\n if (($model = Clearanceentries::findOne(['Clear By ID' => $ClearByID, 'Clearance Level Code' => $ClearanceLevelCode, 'Department' => $Department, 'Student ID' => $StudentID])) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function findModel($id)\n\t{\n\t\tif (($model = Trailer::findOne($id)) !== null) {\n\t\t\treturn $model;\n\t\t} else {\n\t\t\tthrow new HttpException(404, 'The requested page does not exist.');\n\t\t}\n\t}", "public function loadModel($id) {\n $model = MissionCarers::model()->findByPk($id);\n if ($model === null)\n throw new CHttpException(404, Yii::t('texts', 'FLASH_ERROR_404_THE_REQUESTED_PAGE_DOES_NOT_EXIST'));\n return $model;\n }", "protected function findModel($id)\n {\n if (($model = Menu::findOne([ 'id' => $id ])) !== null)\n {\n return $model;\n }\n else\n {\n throw new HttpException(404, Yii::t('backend', 'The requested page does not exist.'));\n }\n }", "public function loadModel($id)\n\t{\n\t\t$model=Source::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}", "protected function findModel($id)\r\n {\r\n if (($model = CaseManagement::findOne($id)) !== null) {\r\n return $model;\r\n } else {\r\n throw new NotFoundHttpException('The requested page does not exist.');\r\n }\r\n }", "public function loadModel($id)\n\t{\n\t\t$model=Student::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,Yii::t('common','The requested page does not exist.'));\n\t\treturn $model;\n\t}", "public function findModel($class, $id)\n {\n $model = call_user_func([$class, 'findOne'], $id);\n if (!$model) {\n $this->raise404();\n }\n return $model;\n }", "public function loadModel($id)\r\n\t{\r\n\t\t$model=Study::model()->findByPk($id);\r\n\t\tif($model===null)\r\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\r\n\t\treturn $model;\r\n\t}", "public function loadModel($id)\n {\n $model = InfoSpares::model()->findByPk($id);\n if ($model === null)\n throw new CHttpException(404, 'The requested page does not exist.');\n return $model;\n }", "public function find($id){\n\t\t$db = static::getDatabaseConnection();\n\t\t//Create a select query\n\t\t$query = \"SELECT \" . implode(\",\" , static::$columns).\" FROM \" . static::$tableName . \" WHERE id = :id\";\n\t\t//prepare the query\n\t\t$statement = $db->prepare($query);\n\t\t//bind the column id with :id\n\t\t$statement->bindValue(\":id\", $id);\n\t\t//Run the query\n\t\t$statement->execute();\n\n\t\t//Put the associated row into a variable\n\t\t$record = $statement->fetch(PDO::FETCH_ASSOC);\n\n\t\t//If there is not a row in the database with that id\n\t\tif(! $record){\n\t\t\tthrow new ModelNotFoundException();\n\t\t}\n\n\t\t//put the record into the data variable\n\t\t$this->data = $record;\n\t}", "public function loadModel($id) {\r\n $model = Statements::model()->findByPk($id);\r\n if ($model === null)\r\n throw new CHttpException(404, 'The requested page does not exist.');\r\n return $model;\r\n }", "public abstract function find($primary_key, $model);", "protected function findModel($id)\n {\n if(Yii::$app->session->get('Rules')['comp_id'] ==1){\n if (($model = Customer::findOne(['id' => $id])) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }else{\n\n \n if (($model = Customer::findOne(['id' => $id,'comp_id' => Yii::$app->session->get('Rules')['comp_id']])) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }\n }", "protected function findModel($id)\n {\n if (($model = Offer::findOne($id)) !== null) {\n return $model;\n } else {\n throw new HttpException(404, 'The requested page does not exist.');\n }\n }", "protected function findModel($id)\n {\n if (($model = Creditortmp::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "public function loadModel($id)\n\t{\n\t\t$model=Student::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}", "public function loadModel($id) {\n $model = Schedule::model()->findByPk($id);\n if ($model === null)\n throw new CHttpException(404, 'The requested page does not exist.');\n return $model;\n }", "public function findModel($clz, $key);", "protected function findModel($id)\n {\n if (($model = CompPrep::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function findModel($id)\n {\n if (($model = StSpd::findOne($id)) !== null) {\n return $model;\n }\n\n throw new NotFoundHttpException('The requested page does not exist.');\n }", "protected function findModel($id) {\n $model = Sport::findOne($id);\n\n if ($model !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "public function loadModel($id)\r\n\t{\r\n\t\t$model=StudentDocument::model()->findByPk($id);\r\n\t\tif($model===null)\r\n\t\t\tthrow new CHttpException(404,Yii::t('app','The requested page does not exist.'));\r\n\t\treturn $model;\r\n\t}", "public function loadModel($id)\n {\n $model = Clinics::model()->findByPk($id);\n if ($model === null)\n throw new CHttpException(404, 'The requested page does not exist.');\n return $model;\n }", "public function find($pk)\r\n {\r\n $row = $this->getTable()->find($pk);\r\n if(!$row){\r\n return false;\r\n }\r\n $sampleModel = new SampleModel();\r\n $this->_map($sampleModel, $row);\r\n return $sampleModel;\r\n }", "public function loadModel($id)\n {\n $model=StudentReg::model()->findByPk($id);\n if($model===null)\n throw new CHttpException(404,'The requested page does not exist.');\n return $model;\n }", "public function loadModel($id)\n\t{\n\t\t$model=Clap::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}", "function find($id)\n{\n\t$model = $this->newModel(null);\n\treturn $model->find($id);\n}", "public function loadModel($id)\n\t{\n\t\t$model=CollectionShop::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}", "protected function findModel($id)\n {\n if (($model = StudentPackageDetails::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function findModel($id)\n {\n if (($model = WpIschoolSafecard::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "public function loadModel($id)\n\t{\n\t\t$model=Kzone::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}", "protected function findModel($id)\n\t{\n if (($model = CoreSettings::findOne($id)) !== null) {\n return $model;\n }\n\n\t\tthrow new \\yii\\web\\NotFoundHttpException(Yii::t('app', 'The requested page does not exist.'));\n\t}", "public function loadModel($id) {\r\n $model = ProductStockEntries::model()->findByPk($id);\r\n if ($model === null)\r\n throw new CHttpException(404, 'The requested page does not exist.');\r\n return $model;\r\n }", "public function findModel( $id ){\n $user = Yii::$app->user->identity;\n $school = $user->school;\n return Lesson::findOne([ 'id' => $id , 'school_id' => $school->id ] );\n }", "public function loadModel($id)\n\t{\n\t\t$model=Story::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}", "public function loadModel($id)\n\t{\n\t\t$model=Share::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}", "public function loadModel($id)\n\t{\n\t\t$model=Results::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}", "protected function findModel($id)\n {\n if (($model = SoSheet::findOne($id)) !== null) { \n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "public function loadModel($id)\n\t{\n\t\t$model=Campaign::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}", "public static function findModel($id='')\n {\n $model = static::find()->where(['id' => $id])->one();\n if ($model == null) {\n throw new \\yii\\web\\NotFoundHttpException(Yii::t('app',\"Page not found!\"));\n }\n return $model;\n }", "protected function findModel($id) {\n if (($model = ClientCampaigns::findOne($id)) !== null) {\n return $model;\n }\n\n throw new NotFoundHttpException('The requested page does not exist.');\n }", "public function loadModel($id)\n\t{\n\t\t$model=Stone::model()->findByPk((int)$id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}", "protected function findModel($id)\n {\n if (($model = WorksystemContentinfo::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function findModel($id)\n {\n if (($model = DataSiswa::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function findModel($masterlist_id)\n\t{\n\t\tif (($model = WiMasterlist::findOne($masterlist_id)) !== null) {\n\t\t\treturn $model;\n\t\t} else {\n\t\t\tthrow new HttpException(404, 'The requested page does not exist.');\n\t\t}\n\t}", "public function loadModel($id)\n\t{\n\t\t$model=Coordocs::model()->findByPk($id+0);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}", "protected function findModel($id)\n {\n if (($model = Cluster::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function findModel($id)\n {\n if (($model = PaidEmployment::findOne($id)) !== null) {\n return $model;\n } else {\n throw new HttpException(404);\n }\n }", "protected function findModel($id)\n {\n if (($model = SkepPenetapanBcf15::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "public function loadModel($id)\n\t{\n\t\t$model = Sucursales::model()->findByPk($id);\n\n\t\tif($model===null)\n\t\t{\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\t}\n\n\t\treturn $model;\n\t}", "protected function findModel($id)\n {\n if (($model = ProgramHasSumberDana::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function findModel($id)\n {\n if (($model = KhoSanPham::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function findModel($id)\n {\n if (($model = JackpotDetails::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "public function loadModel($id) {\n $model = Consultor::model()->findByPk($id);\n if ($model === null)\n throw new CHttpException(404, 'The requested page does not exist.');\n return $model;\n }", "public function findModel($id)\n {\n if (($model = Schedule::findOne($id)) !== null) {\n return $model;\n }\n throw new NotFoundHttpException('The requested page does not exist.');\n }", "public function loadModel($id)\r\n\t{\r\n\t\t$model=KqxsBac::model()->findByPk($id);\r\n\t\tif($model===null)\r\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\r\n\t\treturn $model;\r\n\t}", "public function loadModel($id)\n\t{\n\t\t$model=TestContext::model()->findByPk($id);\n\t\tif ($model===null) {\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\t}\n\t\treturn $model;\n\t}", "protected function findModel($id) {\n if (($model = Contestant::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "public function find($id){\n return $this->model->query()->findOrFail($id);\n }", "protected function findModel($id)\n {\n if (($model = DaftarSmk::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "public function loadModel($id)\n\t{\n\t\t$model=Providers::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}", "public function findById() {\n // TODO: Implement findById() method.\n }", "public function find($id)\n\t{\n\t\treturn $this->model->where(\"id\", \"=\", $id)->first();\n\t}", "protected function findModel($id)\n {\n if (($model = JetShopDetails::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function findModel($id) {\n if (($model = Credit::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "public function loadModel($id) {\n $model = GestionStock::model()->findByPk($id);\n if ($model === null)\n throw new CHttpException(404, 'The requested page does not exist.');\n return $model;\n }", "protected function findModel($id)\n {\n if (($model = Campaigns::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function findModel($id)\n {\n if (($model = Campaigns::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "public function loadModel($id) {\n $model = Carrer::model()->findByPk($id);\n if ($model === null)\n throw new CHttpException(404, 'The requested page does not exist.');\n return $model;\n }", "public function loadModel($id)\n\t{\n\t\t$model=Solicitudes::model()->findByPk((int)$id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}", "protected function findModel($id)\n {\n if (($model = Siteinfo::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "public function loadModel($id)\n\t{\n\t\t$model=AssetTemplate::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}", "protected function findModel($id)\n\t{\n if (($model = UserLevel::findOne($id)) !== null) {\n return $model;\n }\n\n\t\tthrow new \\yii\\web\\NotFoundHttpException(Yii::t('app', 'The requested page does not exist.'));\n\t}", "protected function findModel($id)\n {\n if (($model = Cash::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function findModel($id)\n {\n if (($model = StoreKasir::findOne($id)) !== null) {\n return $model;\n }\n\n throw new NotFoundHttpException('The requested page does not exist.');\n }", "public function loadModel($id)\r\n\t{\r\n\t\t$model=Tshirt::model()->findByPk($id);\r\n\t\tif($model===null)\r\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\r\n\t\treturn $model;\r\n\t}", "protected function findModel($id) {\n if (($model = Stakeholder::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function findModel($id)\n {\n if (($model = Sked::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function findModel($id)\n {\n if (($model = Was27Inspeksi::findOne(['id_was_27_inspeksi'=>$id])) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function findModel($id)\n {\n if (($model = CodeMember::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "public function loadModel($id){\n\t\t$model=Contact::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}", "public function loadModel($id) {\n $model = Customers::model()->findByPk($id);\n if ($model === null)\n throw new CHttpException(404, 'The requested page does not exist.');\n return $model;\n }", "protected function findModel($id)\n {\n if (($model = Conlist::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "public function loadModel($id) {\n $model = Calculatepayout::model()->findByPk($id);\n if ($model === null)\n throw new CHttpException(404, 'The requested page does not exist.');\n return $model;\n }", "protected function findModel($id) {\n if (($model = StaffInfo::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function findModel($id)\n {\n if (($model = Sponser::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "public function loadModel($id)\n\t{\n\t\t$model=Points::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}", "protected function findModel($id) {\n if (($model = learnerscoring::findOne($id)) !== null) {\n return $model;\n }\n\n throw new NotFoundHttpException('The requested page does not exist.');\n }", "public function actionFind()\n\t{\n\t\t$requestedId = craft()->request->getParam('id');\n\t\t// build criteria to find model\n\t\t$criteria = craft()->elements->getCriteria(ElementType::Entry);\n\t\t$criteria->id = $requestedId;\n\t\t$criteria->limit = 1;\n\t\t\n\t\t// fire !\n\t\t$entries = $criteria->find();\n\t\t$entry = count($entries) > 0 ? $entries[0] : null;\n\n\t\t// redirect if possible\n\t\tif($entry && $entry->url) {\n\n\t\t\t// build new query, but remove id from query path\n\t\t\t$newLocation = $entry->url . ( craft()->request->getParam('L') ? '?L='.craft()->request->getParam('L') : '');\n\n\t\t\theader(\"HTTP/1.1 302 Found\"); \n\t\t\theader(\"Location: \" . $newLocation); \n\t\t\texit();\n\t\t}else{\n\t\t\theader(\"HTTP/1.1 404 Not Found\");\n\t\t\theader(\"Location: /404.html\"); \n\t\t\texit();\n\t\t}\n\n\t\tcraft()->end();\n\t}", "public function loadModel($id)\n\t{\n\t\t$model=Sale::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}", "public function loadModel($id)\n\t{\n\t\t$model=Knowledgecatalogue::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}", "public function loadModel($id)\n {\n $model=Services::model()->findByPk($id);\n if($model===null)\n throw new CHttpException(404,'The requested page does not exist.');\n return $model;\n }", "protected function findModel($id)\n {\n$model = Reports::findOne($id);\n\t\tif ((isset(Yii::$app->params['ADMIN_CLIENT_ID']) and Yii::$app->user->identity->clientID == Yii::$app->params['ADMIN_CLIENT_ID']))\n\t\t{\n return $model;\n }\n\t\telse\n\t\t\tthrow new NotFoundHttpException('The requested page does not exist.');\n\t\t\n }", "protected function findModel($id)\n {\n if (($model = Switchboard::findOne($id)) !== null) {\n return $model;\n }\n\n throw new NotFoundHttpException('The requested page does not exist.');\n }", "protected function findModel($id)\n {\n if (($model = CounterData::findOne($id)) !== null) {\n return $model;\n }\n\n throw new NotFoundHttpException(Yii::t('app', 'The requested page does not exist.'));\n }", "public function find(int $id)\n {\n return $this->model->findOrFail($id);\n }", "protected function findModel($id)\n {\n if (($model = InsightsDef::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "public function find($id)\n {\n return $this->model->findOrFail($id);\n }" ]
[ "0.6242811", "0.61120594", "0.6080804", "0.5998509", "0.5977795", "0.5946457", "0.5938738", "0.5937587", "0.59326637", "0.5923042", "0.5919966", "0.5907154", "0.5904735", "0.59015954", "0.589339", "0.5889504", "0.5880755", "0.5880637", "0.58722955", "0.58583844", "0.58463794", "0.58425575", "0.5827111", "0.58260614", "0.58213645", "0.5821251", "0.5814679", "0.58097154", "0.5795477", "0.57901055", "0.57848424", "0.5782027", "0.5779664", "0.577786", "0.57776", "0.57735807", "0.5768691", "0.57675576", "0.5765608", "0.5762604", "0.576168", "0.5736039", "0.57203627", "0.57154953", "0.5707062", "0.570598", "0.57035106", "0.5702931", "0.56985945", "0.5697333", "0.56956464", "0.5694386", "0.569261", "0.56901234", "0.5688724", "0.56877375", "0.5686342", "0.5686215", "0.5685221", "0.568417", "0.5682744", "0.5679631", "0.56767964", "0.56761104", "0.5675468", "0.56700397", "0.5670001", "0.5668531", "0.56670314", "0.56670314", "0.5665775", "0.5659675", "0.5657669", "0.565704", "0.56546205", "0.5653062", "0.56519127", "0.56502146", "0.56428057", "0.56408006", "0.5635513", "0.56345695", "0.5634522", "0.5630837", "0.5628047", "0.5627881", "0.56255066", "0.5622614", "0.5617203", "0.5616129", "0.56161124", "0.5612188", "0.56118613", "0.5611804", "0.5609486", "0.56077266", "0.56057966", "0.5605658", "0.5603807", "0.5602674" ]
0.60946107
2
Run the database seeds.
public function run() { DB::table('setting')->delete(); DB::table('setting')->insert([ [ 'id'=>'1', 'logo' => 'no-img.jpg', 'slogan' => 'khau hieu 1', 'state'=>0 ], [ 'id'=>'2', 'logo' => 'no-img.jpg', 'slogan' => 'khau hieu 2', 'state'=>1 ], ]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function run()\n {\n // $this->call(UserTableSeeder::class);\n // $this->call(PostTableSeeder::class);\n // $this->call(TagTableSeeder::class);\n // $this->call(PostTagTableSeeder::class);\n\n /*AB - use faker to populate table see file ModelFactory.php */\n factory(App\\Editeur::class, 40) ->create();\n factory(App\\Auteur::class, 40) ->create();\n factory(App\\Livre::class, 80) ->create();\n\n for ($i = 1; $i < 41; $i++) {\n $number = rand(2, 8);\n for ($j = 1; $j <= $number; $j++) {\n DB::table('auteur_livre')->insert([\n 'livre_id' => rand(1, 40),\n 'auteur_id' => $i\n ]);\n }\n }\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n // Let's truncate our existing records to start from scratch.\n Assignation::truncate();\n\n $faker = \\Faker\\Factory::create();\n \n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 40; $i++) {\n Assignation::create([\n 'ad_id' => $faker->numberBetween(1,20),\n 'buyer_id' => $faker->numberBetween(1,6),\n 'seller_id' => $faker->numberBetween(6,11),\n 'state' => NULL,\n ]);\n }\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n \t$faker = Faker::create();\n\n \tfor($i=0; $i<20; $i++) {\n \t\t$post = new Post;\n \t\t$post->title = $faker->sentence();\n \t\t$post->body = $faker->paragraph();\n \t\t$post->category_id = rand(1, 5);\n \t\t$post->save();\n \t}\n\n \t$list = ['General', 'Technology', 'News', 'Internet', 'Mobile'];\n \tforeach($list as $name) {\n \t\t$category = new Category;\n \t\t$category->name = $name;\n \t\t$category->save();\n \t}\n\n \tfor($i=0; $i<20; $i++) {\n \t\t$comment = new Comment;\n \t\t$comment->comment = $faker->paragraph();\n \t\t$comment->post_id = rand(1,20);\n \t\t$comment->save();\n \t}\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n $this->call(RoleTableSeeder::class);\n $this->call(UserTableSeeder::class);\n \n factory('App\\Cat', 5)->create();\n $tags = factory('App\\Tag', 8)->create();\n\n factory(Post::class, 15)->create()->each(function($post) use ($tags){\n $post->comments()->save(factory(Comment::class)->make());\n $post->tags()->attach( $tags->random(mt_rand(1,4))->pluck('id')->toArray() );\n });\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::table('post')->insert(\n [\n 'title' => 'Test Post1',\n 'desc' => str_random(100).\" post1\",\n 'alias' => 'test1',\n 'keywords' => 'test1',\n ]\n );\n DB::table('post')->insert(\n [\n 'title' => 'Test Post2',\n 'desc' => str_random(100).\" post2\",\n 'alias' => 'test2',\n 'keywords' => 'test2',\n ]\n );\n DB::table('post')->insert(\n [\n 'title' => 'Test Post3',\n 'desc' => str_random(100).\" post3\",\n 'alias' => 'test3',\n 'keywords' => 'test3',\n ]\n );\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n \t$faker = Factory::create();\n \t\n \tforeach ($this->departments as $key => $department) {\n \t\tDepartment::create([\n \t\t\t'name' => $department\n \t\t]);\n \t}\n \tforeach ($this->collections as $key => $collection) {\n \t\tCollection::create([\n \t\t\t'name' => $collection\n \t\t]);\n \t}\n \t\n \t\n \tfor ($i=0; $i < 40; $i++) {\n \t\tUser::create([\n \t\t\t'name' \t=>\t$faker->name,\n \t\t\t'email' \t=>\t$faker->email,\n \t\t\t'password' \t=>\tbcrypt('123456'),\n \t\t]);\n \t} \n \t\n \t\n \tforeach ($this->departments as $key => $department) {\n \t\t//echo ($key + 1) . PHP_EOL;\n \t\t\n \t\tfor ($i=0; $i < 10; $i++) { \n \t\t\techo $faker->name . PHP_EOL;\n\n \t\t\tArt::create([\n \t\t\t\t'name'\t\t\t=> $faker->sentence(2),\n \t\t\t\t'img'\t\t\t=> $this->filenames[$i],\n \t\t\t\t'medium'\t\t=> 'canvas',\n \t\t\t\t'department_id'\t=> $key + 1,\n \t\t\t\t'user_id'\t\t=> $this->userIndex,\n \t\t\t\t'dimension'\t\t=> '18.0 x 24.0',\n\t\t\t\t]);\n \t\t\t\t\n \t\t\t\t$this->userIndex ++;\n \t\t}\n \t}\n \t\n \tdd(\"END\");\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // $this->dataCategory();\n factory(App\\Model\\Category::class, 70)->create();\n factory(App\\Model\\Producer::class, rand(5,10))->create();\n factory(App\\Model\\Provider::class, rand(5,10))->create();\n factory(App\\Model\\Product::class, 100)->create();\n factory(App\\Model\\Album::class, 300)->create();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n\n factory('App\\User', 10 )->create();\n\n $users= \\App\\User::all();\n $users->each(function($user){ factory('App\\Category', 1)->create(['user_id'=>$user->id]); });\n $users->each(function($user){ factory('App\\Tag', 3)->create(['user_id'=>$user->id]); });\n\n\n $users->each(function($user){\n factory('App\\Post', 10)->create([\n 'user_id'=>$user->id,\n 'category_id'=>rand(1,20)\n ]\n );\n });\n\n $posts= \\App\\Post::all();\n $posts->each(function ($post){\n\n $post->tags()->attach(array_unique([rand(1,20),rand(1,20),rand(1,20)]));\n });\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $types = factory(\\App\\Models\\Type::class, 5)->create();\n\n $cities = factory(\\App\\Models\\City::class, 10)->create();\n\n $cities->each(function ($city) {\n $districts = factory(\\App\\Models\\District::class, rand(2, 5))->create([\n 'city_id' => $city->id,\n ]);\n\n $districts->each(function ($district) {\n $properties = factory(\\App\\Models\\Property::class, rand(2, 5))->create([\n 'type_id' => rand(1, 5),\n 'district_id' => $district->id\n ]);\n\n $properties->each(function ($property) {\n $galleries = factory(\\App\\Models\\Gallery::class, rand(3, 10))->create([\n 'property_id' => $property->id\n ]);\n });\n });\n });\n }", "public function run()\n {\n $this->call(UsersTableSeeder::class);\n\n $categories = factory(App\\Models\\Category::class, 10)->create();\n\n $categories->each(function ($category) {\n $category\n ->posts()\n ->saveMany(\n factory(App\\Models\\Post::class, 3)->make()\n );\n });\n }", "public function run()\n {\n $this->call(CategoriesTableSeeder::class);\n\n $users = factory(App\\User::class, 5)->create();\n $recipes = factory(App\\Recipe::class, 30)->create();\n $preparations = factory(App\\Preparation::class, 70)->create();\n $photos = factory(App\\Photo::class, 90)->create();\n $comments = factory(App\\Comment::class, 200)->create();\n $flavours = factory(App\\Flavour::class, 25)->create();\n $flavour_recipe = factory(App\\FlavourRecipe::class, 50)->create();\n $tags = factory(App\\Tag::class, 25)->create();\n $recipe_tag = factory(App\\RecipeTag::class, 50)->create();\n $ingredients = factory(App\\Ingredient::class, 25)->create();\n $ingredient_preparation = factory(App\\IngredientPreparation::class, 300)->create();\n \n \n \n DB::table('users')->insert(['name' => 'SimpleUtilisateur', 'email' => 'simpleadressemail@mail.com', 'password' => bcrypt('SimpleMotDePasse')]);\n \n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n // Sample::truncate();\n // TestItem::truncate();\n // UOM::truncate();\n Role::truncate();\n User::truncate();\n\n // factory(Role::class, 4)->create();\n Role::create([\n 'name'=> 'Director',\n 'description'=> 'Director type'\n ]);\n\n Role::create([\n 'name'=> 'Admin',\n 'description'=> 'Admin type'\n ]);\n Role::create([\n 'name'=> 'Employee',\n 'description'=> 'Employee type'\n ]);\n Role::create([\n 'name'=> 'Technician',\n 'description'=> 'Technician type'\n ]);\n \n factory(User::class, 20)->create()->each(\n function ($user){\n $roles = \\App\\Role::all()->random(mt_rand(1, 2))->pluck('id');\n $user->roles()->attach($roles);\n }\n );\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n UsersLevel::create([\n 'name' => 'Administrator'\n ]);\n\n UsersLevel::create([\n 'name' => 'User'\n ]);\n\n User::create([\n 'username' => 'admin',\n 'password' => bcrypt('admin123'),\n 'level_id' => 1,\n 'fullname' => \"Super Admin\",\n 'email'=> \"admin@admin.com\"\n ]);\n\n\n \\App\\CategoryPosts::create([\n 'name' =>'Paket Trip'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' =>'Destinasi Kuliner'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' => 'Event'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' => 'Profil'\n ]);\n }", "public function run()\n {\n DB::table('users')->insert([\n 'name' => 'Admin',\n 'email' => 'admin@petstore.com',\n 'avatar' => \"avatar\",\n 'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi',\n ]);\n $this->call(CategorySeeder::class);\n // \\App\\Models\\Admin::factory(1)->create();\n \\App\\Models\\User::factory(10)->create();\n // \\App\\Models\\Category::factory(50)->create();\n \\App\\Models\\PetComment::factory(50)->create();\n $pets = \\App\\Models\\Pet::factory(50)->create();\n foreach ($pets as $pet) {\n \\App\\Models\\PetTag::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\PetPhotoUrl::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\Order::factory(1)->create(['pet_id' => $pet->id]);\n };\n }", "public function run()\n { \n\n $this->call(RoleSeeder::class);\n \n $this->call(UserSeeder::class);\n\n Storage::deleteDirectory('socials-icon');\n Storage::makeDirectory('socials-icon');\n $socials = Social::factory(7)->create();\n\n Storage::deleteDirectory('countries-flag');\n Storage::deleteDirectory('countries-firm');\n Storage::makeDirectory('countries-flag');\n Storage::makeDirectory('countries-firm');\n $countries = Country::factory(18)->create();\n\n // Se llenan datos de la tabla muchos a muchos - social_country\n foreach ($countries as $country) {\n foreach ($socials as $social) {\n\n $country->socials()->attach($social->id, [\n 'link' => 'https://www.facebook.com/ministeriopalabrayespiritu/'\n ]);\n }\n }\n\n Person::factory(50)->create();\n\n Category::factory(7)->create();\n\n Video::factory(25)->create(); \n\n $this->call(PostSeeder::class);\n\n Storage::deleteDirectory('documents');\n Storage::makeDirectory('documents');\n Document::factory(25)->create();\n\n }", "public function run()\n {\n $faker = Faker::create('id_ID');\n /**\n * Generate fake author data\n */\n for ($i=1; $i<=50; $i++) { \n DB::table('author')->insert([\n 'name' => $faker->name\n ]);\n }\n /**\n * Generate fake publisher data\n */\n for ($i=1; $i<=50; $i++) { \n DB::table('publisher')->insert([\n 'name' => $faker->name\n ]);\n }\n /**\n * Seeding payment method\n */\n DB::table('payment')->insert([\n ['name' => 'Mandiri'],\n ['name' => 'BCA'],\n ['name' => 'BRI'],\n ['name' => 'BNI'],\n ['name' => 'Pos Indonesia'],\n ['name' => 'BTN'],\n ['name' => 'Indomaret'],\n ['name' => 'Alfamart'],\n ['name' => 'OVO'],\n ['name' => 'Cash On Delivery']\n ]);\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n // MyList::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 3; $i++) {\n MyList::create([\n 'title' => 'List-'.($i+1),\n 'color' => $faker->sentence,\n 'icon' => $faker->randomDigitNotNull,\n 'index' => $faker->randomDigitNotNull,\n 'user_id' => 1,\n ]);\n }\n }", "public function run()\n {\n DatabaseSeeder::seedLearningStylesProbs();\n DatabaseSeeder::seedCampusProbs();\n DatabaseSeeder::seedGenderProbs();\n DatabaseSeeder::seedTypeStudentProbs();\n DatabaseSeeder::seedTypeProfessorProbs();\n DatabaseSeeder::seedNetworkProbs();\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n Products::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few products in our database:\n for ($i = 0; $i < 50; $i++) {\n Products::create([\n 'name' => $faker->word,\n 'sku' => $faker->randomNumber(7, false),\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n User::create([\n 'name' => 'Pablo Rosales',\n 'email' => 'prosales@researchmobile.co',\n 'password' => bcrypt('admin'),\n 'status' => 1,\n 'role_id' => 1,\n 'movil' => 0\n ]);\n\n User::create([\n 'name' => 'Usuario Movil',\n 'email' => 'movil@researchmobile.co',\n 'password' => bcrypt('secret'),\n 'status' => 1,\n 'role_id' => 3,\n 'movil' => 1\n ]);\n\n Roles::create([\n 'name' => 'Administrador'\n ]);\n Roles::create([\n 'name' => 'Operaciones'\n ]);\n Roles::create([\n 'name' => 'Comercial'\n ]);\n Roles::create([\n 'name' => 'Aseguramiento'\n ]);\n Roles::create([\n 'name' => 'Facturación'\n ]);\n Roles::create([\n 'name' => 'Creditos y Cobros'\n ]);\n\n factory(App\\Customers::class, 100)->create();\n }", "public function run()\n {\n // php artisan db:seed --class=StoreTableSeeder\n\n foreach(range(1,20) as $i){\n $faker = Faker::create();\n Store::create([\n 'name' => $faker->name,\n 'desc' => $faker->text,\n 'tags' => $faker->word,\n 'address' => $faker->address,\n 'longitude' => $faker->longitude($min = -180, $max = 180),\n 'latitude' => $faker->latitude($min = -90, $max = 90),\n 'created_by' => '1'\n ]);\n }\n\n }", "public function run()\n {\n DB::table('users')->insert([\n 'name'=>\"test\",\n 'password' => Hash::make('123'),\n 'email'=>'test@yandex.ru'\n ]);\n DB::table('tags')->insert(['name'=>'tags']);\n $this->call(UserSeed::class);\n $this->call(CategoriesSeed::class);\n $this->call(TopicsSeed::class);\n $this->call(CommentariesSeed::class);\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n echo 'seeding permission...', PHP_EOL;\n $permissions = [\n 'role-list',\n 'role-create',\n 'role-edit',\n 'role-delete',\n 'formation-list',\n 'formation-create',\n 'formation-edit',\n 'formation-delete',\n 'user-list',\n 'user-create',\n 'user-edit',\n 'user-delete'\n ];\n foreach ($permissions as $permission) {\n Permission::create(['name' => $permission]);\n }\n echo 'seeding users...', PHP_EOL;\n\n $user= User::create(\n [\n 'name' => 'Mr. admin',\n 'email' => 'admin@yahoo.com',\n 'password' => bcrypt('admin'),\n 'remember_token' => null,\n ]\n );\n echo 'Create Roles...', PHP_EOL;\n Role::create(['name' => 'former']);\n Role::create(['name' => 'learner']);\n Role::create(['name' => 'admin']);\n Role::create(['name' => 'manager']);\n Role::create(['name' => 'user']);\n\n echo 'seeding Role User...', PHP_EOL;\n $user->assignRole('admin');\n $role = $user->assignRole('admin');\n $role->givepermissionTo(Permission::all());\n\n \\DB::table('languages')->insert(['name' => 'English', 'code' => 'en']);\n \\DB::table('languages')->insert(['name' => 'Français', 'code' => 'fr']);\n }", "public function run()\n {\n $this->call(UsersTableSeeder::class);\n $this->call(PermissionsSeeder::class);\n $this->call(RolesSeeder::class);\n $this->call(ThemeSeeder::class);\n\n //\n\n DB::table('paypal_info')->insert([\n 'client_id' => '',\n 'client_secret' => '',\n 'currency' => '',\n ]);\n DB::table('contact_us')->insert([\n 'content' => '',\n ]);\n DB::table('setting')->insert([\n 'site_name' => ' ',\n ]);\n DB::table('terms_and_conditions')->insert(['terms_and_condition' => 'text']);\n }", "public function run()\n {\n $this->call([\n UserSeeder::class,\n ]);\n\n User::factory(20)->create();\n Author::factory(20)->create();\n Book::factory(60)->create();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // DB::table('roles')->insert(\n // [\n // ['name' => 'admin', 'description' => 'Administrator'],\n // ['name' => 'student', 'description' => 'Student'],\n // ['name' => 'lab_tech', 'description' => 'Lab Tech'],\n // ['name' => 'it_staff', 'description' => 'IT Staff Member'],\n // ['name' => 'it_manager', 'description' => 'IT Manager'],\n // ['name' => 'lab_manager', 'description' => 'Lab Manager'],\n // ]\n // );\n\n // DB::table('users')->insert(\n // [\n // 'username' => 'admin', \n // 'password' => Hash::make('password'), \n // 'active' => 1,\n // 'name' => 'Administrator',\n // 'email' => 'programmerlemar@gmail.com',\n // 'role_id' => \\App\\Role::where('name', 'admin')->first()->id\n // ]\n // );\n\n DB::table('status')->insert([\n // ['name' => 'Active'],\n // ['name' => 'Cancel'],\n // ['name' => 'Disable'],\n // ['name' => 'Open'],\n // ['name' => 'Closed'],\n // ['name' => 'Resolved'],\n ['name' => 'Used'],\n ]);\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(UserSeeder::class);\n $this->call(RolePermissionSeeder::class);\n $this->call(AppmodeSeeder::class);\n\n // \\App\\Models\\Appmode::factory(3)->create();\n \\App\\Models\\Doctor::factory(100)->create();\n \\App\\Models\\Unit::factory(50)->create();\n \\App\\Models\\Broker::factory(100)->create();\n \\App\\Models\\Patient::factory(100)->create();\n \\App\\Models\\Expence::factory(100)->create();\n \\App\\Models\\Testcategory::factory(100)->create();\n \\App\\Models\\Test::factory(50)->create();\n \\App\\Models\\Parameter::factory(50)->create();\n \\App\\Models\\Sale::factory(50)->create();\n \\App\\Models\\SaleItem::factory(100)->create();\n \\App\\Models\\Goption::factory(1)->create();\n \\App\\Models\\Pararesult::factory(50)->create();\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n factory(User::class)->create([\n 'name' => 'Qwerty',\n 'email' => 'qwerty@gmail.com',\n 'password' => bcrypt('secretpassw'),\n ]);\n\n factory(User::class, 59)->create([\n 'password' => bcrypt('secretpassw'),\n ]);\n\n for ($i = 1; $i < 11; $i++) {\n factory(Category::class)->create([\n 'name' => 'Category ' . $i,\n ]);\n }\n\n for ($i = 1; $i < 101; $i++) {\n factory(Product::class)->create([\n 'name' => 'Product ' . $i,\n ]);\n }\n }", "public function run()\n {\n\n \t// Making main admin role\n \tDB::table('roles')->insert([\n 'name' => 'Admin',\n ]);\n\n // Making main category\n \tDB::table('categories')->insert([\n 'name' => 'Other',\n ]);\n\n \t// Making main admin account for testing\n \tDB::table('users')->insert([\n 'name' \t\t=> 'Admin',\n 'email' \t=> 'admin@example.com',\n 'password' => bcrypt('12345'),\n 'role_id' => 1,\n 'created_at' => date('Y-m-d H:i:s' ,time()),\n 'updated_at' => date('Y-m-d H:i:s' ,time())\n ]);\n\n \t// Making random users and posts\n factory(App\\User::class, 10)->create();\n factory(App\\Post::class, 35)->create();\n }", "public function run()\n {\n $faker = Faker::create();\n\n \\DB::table('positions')->insert(array (\n 'codigo' => strtoupper($faker->randomLetter).$faker->postcode,\n 'nombre' => 'Chef',\n 'salario' => '15000.00'\n ));\n\n\t\t \\DB::table('positions')->insert(array (\n 'codigo' => strtoupper($faker->randomLetter).$faker->postcode,\n 'nombre' => 'Mesonero',\n 'salario' => '12000.00'\n ));\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker = \\Faker\\Factory::create();\n\n foreach (range(1,5) as $index) {\n Lista::create([\n 'name' => $faker->sentence(2),\n 'description' => $faker->sentence(10), \n ]);\n } \n\n foreach (range(1,20) as $index) {\n $n = $faker->sentence(2);\n \tTarea::create([\n \t\t'name' => $n,\n \t\t'description' => $faker->sentence(10),\n 'lista_id' => $faker->numberBetween(1,5),\n 'slug' => Str::slug($n),\n \t\t]);\n } \n }", "public function run()\n {\n $faker = Faker::create('lt_LT');\n\n DB::table('users')->insert([\n 'name' => 'user',\n 'email' => 'briedis@aa.bb',\n 'password' => Hash::make('123')\n ]);\n DB::table('users')->insert([\n 'name' => 'user2',\n 'email' => 'briedis2@aa.bb',\n 'password' => Hash::make('123')\n ]);\n\n foreach (range(1,100) as $val)\n DB::table('authors')->insert([\n 'name' => $faker->firstName(),\n 'surname' => $faker->lastName(),\n \n ]);\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(UsersTableSeeder::class);\n\n // DB::table('users')->insert([\n // 'name' => 'User1',\n // 'email' => 'admin@admin.com',\n // 'password' => bcrypt('password'),\n // ]);\n\n\n $faker = Faker::create();\n \n foreach (range(1,10) as $index){\n DB::table('companies')->insert([\n 'name' => $faker->company(),\n 'email' => $faker->email(10).'@gmail.com',\n 'logo' => $faker->image($dir = '/tmp', $width = 640, $height = 480),\n 'webiste' => $faker->domainName(),\n \n ]);\n }\n \n \n foreach (range(1,10) as $index){\n DB::table('employees')->insert([\n 'first_name' => $faker->firstName(),\n 'last_name' => $faker->lastName(),\n 'company' => $faker->company(),\n 'email' => $faker->str_random(10).'@gmail.com',\n 'phone' => $faker->e164PhoneNumber(),\n \n ]);\n }\n\n\n\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n Flight::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 100; $i++) {\n\n\n Flight::create([\n 'flightNumber' => $faker->randomNumber(5),\n 'depAirport' => $faker->city,\n 'destAirport' => $faker->city,\n 'reservedWeight' => $faker->numberBetween(1000 - 10000),\n 'deptTime' => $faker->dateTime('now'),\n 'arrivalTime' => $faker->dateTime('now'),\n 'reservedVolume' => $faker->numberBetween(1000 - 10000),\n 'airlineName' => $faker->colorName,\n ]);\n }\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->truncteTables([\n 'users',\n 'products'\n ]);\n\n $this->call(UsersSeeder::class);\n $this->call(ProductsSeeder::class);\n\n }", "public function run()\n {\n /**\n * Dummy seeds\n */\n DB::table('metas')->truncate();\n $faker = Faker::create();\n\n for ($i=0; $i < 10; $i++) { \n DB::table('metas')->insert([\n 'id_rel' => $faker->randomNumber(),\n 'titulo' => $faker->sentence,\n 'descricao' => $faker->paragraph,\n 'justificativa' => $faker->paragraph,\n 'valor_inicial' => $faker->numberBetween(0,100),\n 'valor_atual' => $faker->numberBetween(0,100),\n 'valor_final' => $faker->numberBetween(0,10),\n 'regras' => json_encode([$i => [\"values\" => $faker->words(3)]]),\n 'types' => json_encode([$i => [\"values\" => $faker->words(2)]]),\n 'categorias' => json_encode([$i => [\"values\" => $faker->words(4)]]),\n 'tags' => json_encode([$i => [\"values\" => $faker->words(5)]]),\n 'active' => true,\n ]);\n }\n\n\n }", "public function run()\n {\n // $this->call(UserTableSeeder::class);\n\n $faker = Faker::create();\n\n $lessonIds = Lesson::lists('id')->all(); // An array of ID's in that table [1, 2, 3, 4, 5, 7]\n $tagIds = Tag::lists('id')->all();\n\n foreach(range(1, 30) as $index)\n {\n // a real lesson id\n // a real tag id\n DB::table('lesson_tag')->insert([\n 'lesson_id' => $faker->randomElement($lessonIds),\n 'tag_id' => $faker->randomElement($tagIds),\n ]);\n }\n }", "public function run()\n {\n // \\DB::statement('SET_FOREIGN_KEY_CHECKS=0');\n \\DB::table('users')->truncate();\n \\DB::table('posts')->truncate();\n // \\DB::table('category')->truncate();\n \\DB::table('photos')->truncate();\n \\DB::table('comments')->truncate();\n \\DB::table('comment_replies')->truncate();\n\n \\App\\Models\\User::factory()->times(10)->hasPosts(1)->create();\n \\App\\Models\\Role::factory()->times(10)->create();\n \\App\\Models\\Category::factory()->times(10)->create();\n \\App\\Models\\Comment::factory()->times(10)->hasReplies(1)->create();\n \\App\\Models\\Photo::factory()->times(10)->create();\n\n \n // \\App\\Models\\User::factory(10)->create([\n // 'role_id'=>2,\n // 'is_active'=>1\n // ]);\n\n // factory(App\\Models\\Post::class, 10)->create();\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n Language::truncate();\n Reason::truncate();\n Report::truncate();\n Category::truncate();\n Position::truncate();\n\n $languageQuantity = 10;\n $reasonQuantity = 10;\n $reportQuantity = 10;\n $categoryQuantity = 10;\n $positionQuantity = 10;\n\n factory(Language::class,$languageQuantity)->create();\n factory(Reason::class,$reasonQuantity)->create();\n \n factory(Report::class,$reportQuantity)->create();\n \n factory(Category::class,$categoryQuantity)->create();\n \n factory(Position::class,$positionQuantity)->create();\n\n }", "public function run()\n {\n $this->call(CategoriasTableSeeder::class);\n $this->call(UfsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n $this->call(UserTiposTableSeeder::class);\n factory(App\\User::class, 2)->create();\n/* factory(App\\Models\\Categoria::class, 20)->create();*/\n/* factory(App\\Models\\Anuncio::class, 50)->create();*/\n }", "public function run()\n {\n $this->call([\n ArticleSeeder::class, \n TagSeeder::class,\n Arttagrel::class\n ]);\n // \\App\\Models\\User::factory(10)->create();\n \\App\\Models\\Article::factory()->count(7)->create();\n \\App\\Models\\Tag::factory()->count(15)->create(); \n \\App\\Models\\Arttagrel::factory()->count(15)->create(); \n }", "public function run()\n {\n $this->call(ArticulosTableSeeder::class);\n /*DB::table('articulos')->insert([\n 'titulo' => str_random(50),\n 'cuerpo' => str_random(200),\n ]);*/\n }", "public function run()\n {\n $this->call(CategoryTableSeeder::class);\n $this->call(ProductTableSeeder::class);\n\n \t\t\n\t\t\tDB::table('users')->insert([\n 'first_name' => 'Ignacio',\n 'last_name' => 'Garcia',\n 'email' => 'ignacio@dh.com',\n 'password' => bcrypt('123456'),\n 'role' => '1',\n 'avatar' => 'CGnABxNYYn8N23RWlvTTP6C2nRjOLTf8IJcbLqRP.jpeg',\n ]);\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(RoleSeeder::class);\n $this->call(UserSeeder::class);\n\n Medicamento::factory(50)->create();\n Reporte::factory(5)->create();\n Cliente::factory(200)->create();\n Asigna_valor::factory(200)->create();\n Carga::factory(200)->create();\n }", "public function run()\n {\n \\App\\Models\\Article::factory(20)->create();\n \\App\\Models\\Category::factory(5)->create();\n \\App\\Models\\Comment::factory(40)->create();\n\n \\App\\Models\\User::create([\n \"name\"=>\"Alice\",\n \"email\"=>'alice@gmail.com',\n 'password' => Hash::make('password'),\n ]);\n \\App\\Models\\User::create([\n \"name\"=>\"Bob\",\n \"email\"=>'bob@gmail.com',\n 'password' => Hash::make('password'),\n ]);\n }", "public function run()\n {\n $this->call([\n RoleSeeder::class,\n TicketSeeder::class\n ]);\n\n DB::table('departments')->insert([\n 'abbr' => 'IT',\n 'name' => 'Information Technologies',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ]);\n\n DB::table('users')->insert([\n 'name' => 'admin',\n 'email' => 'admin@gmail.com',\n 'email_verified_at' => Carbon::now(),\n 'password' => Hash::make('admin'),\n 'department_id' => 1,\n 'avatar' => 'default.png',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ]);\n\n DB::table('role_user')->insert([\n 'role_id' => 1,\n 'user_id' => 1\n ]);\n }", "public function run()\n {\n /** \n * Note: You must add these lines to your .env file for this Seeder to work (replace the values, obviously):\n SEEDER_USER_FIRST_NAME = 'Firstname'\n SEEDER_USER_LAST_NAME = 'Lastname'\n\t\tSEEDER_USER_DISPLAY_NAME = 'Firstname Lastname'\n\t\tSEEDER_USER_EMAIL = your.email@domain.com\n SEEDER_USER_PASSWORD = yourpassword\n */\n\t\tDB::table('users')->insert([\n 'user_first_name' => env('SEEDER_USER_FIRST_NAME'),\n 'user_last_name' => env('SEEDER_USER_LAST_NAME'),\n 'user_name' => env('SEEDER_USER_DISPLAY_NAME'),\n\t\t\t'user_email' => env('SEEDER_USER_EMAIL'),\n 'user_status' => 1,\n \t'password' => Hash::make((env('SEEDER_USER_PASSWORD'))),\n 'permission_fk' => 1,\n 'created_at' => Carbon::now()->format('Y-m-d H:i:s'),\n 'updated_at' => Carbon::now()->format('Y-m-d H:i:s')\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class,3)->create()->each(\n \tfunction($user)\n \t{\n \t\t$user->questions()\n \t\t->saveMany(\n \t\t\tfactory(App\\Question::class, rand(2,6))->make()\n \t\t)\n ->each(function ($q) {\n $q->answers()->saveMany(factory(App\\Answer::class, rand(1,5))->make());\n })\n \t}\n );\n }\n}", "public function run()\n {\n $faker = Faker::create();\n\n // $this->call(UsersTableSeeder::class);\n\n DB::table('posts')->insert([\n 'id'=>str_random(1),\n 'user_id'=> str_random(1),\n 'title' => $faker->name,\n 'body' => $faker->safeEmail,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ]);\n }", "public function run()\n\t{\n\t\tDB::table(self::TABLE_NAME)->delete();\n\n\t\tforeach (seed(self::TABLE_NAME) as $row)\n\t\t\t$records[] = [\n\t\t\t\t'id'\t\t\t\t=> $row->id,\n\t\t\t\t'created_at'\t\t=> $row->created_at ?? Carbon::now(),\n\t\t\t\t'updated_at'\t\t=> $row->updated_at ?? Carbon::now(),\n\n\t\t\t\t'sport_id'\t\t\t=> $row->sport_id,\n\t\t\t\t'gender_id'\t\t\t=> $row->gender_id,\n\t\t\t\t'tournamenttype_id'\t=> $row->tournamenttype_id ?? null,\n\n\t\t\t\t'name'\t\t\t\t=> $row->name,\n\t\t\t\t'external_id'\t\t=> $row->external_id ?? null,\n\t\t\t\t'is_top'\t\t\t=> $row->is_top ?? null,\n\t\t\t\t'logo'\t\t\t\t=> $row->logo ?? null,\n\t\t\t\t'position'\t\t\t=> $row->position ?? null,\n\t\t\t];\n\n\t\tinsert(self::TABLE_NAME, $records ?? []);\n\t}", "public function run()\n\t{\n\t\tDB::table('libros')->truncate();\n\n\t\t$faker = Faker\\Factory::create();\n\n\t\tfor ($i=0; $i < 10; $i++) { \n\t\t\tLibro::create([\n\n\t\t\t\t'titulo'\t\t=> $faker->text(40),\n\t\t\t\t'isbn'\t\t\t=> $faker->numberBetween(100,999),\n\t\t\t\t'precio'\t\t=> $faker->randomFloat(2,3,150),\n\t\t\t\t'publicado'\t\t=> $faker->numberBetween(0,1),\n\t\t\t\t'descripcion'\t=> $faker->text(400),\n\t\t\t\t'autor_id'\t\t=> $faker->numberBetween(1,3),\n\t\t\t\t'categoria_id'\t=> $faker->numberBetween(1,3)\n\n\t\t\t]);\n\t\t}\n\n\t\t// Uncomment the below to run the seeder\n\t\t// DB::table('libros')->insert($libros);\n\t}", "public function run()\n {\n // for($i=1;$i<11;$i++){\n // DB::table('post')->insert(\n // ['title' => 'Title'.$i,\n // 'post' => 'Post'.$i,\n // 'slug' => 'Slug'.$i]\n // );\n // }\n $faker = Faker\\Factory::create();\n \n for($i=1;$i<20;$i++){\n $dname = $faker->name;\n DB::table('post')->insert(\n ['title' => $dname,\n 'post' => $faker->text($maxNbChars = 200),\n 'slug' => str_slug($dname)]\n );\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class, 10)->create()->each(function ($user) {\n // Seed the relation with 5 purchases\n // $videos = factory(App\\Video::class, 5)->make();\n // $user->videos()->saveMany($videos);\n // $user->videos()->each(function ($video){\n // \t$video->videometa()->save(factory(App\\VideoMeta::class)->make());\n // \t// :( \n // });\n factory(App\\User::class, 10)->create()->each(function ($user) {\n\t\t\t factory(App\\Video::class, 5)->create(['user_id' => $user->id])->each(function ($video) {\n\t\t\t \tfactory(App\\VideoMeta::class, 1)->create(['video_id' => $video->id]);\n\t\t\t // $video->videometa()->save(factory(App\\VideoMeta::class)->create(['video_id' => $video->id]));\n\t\t\t });\n\t\t\t});\n\n });\n }", "public function run()\n {\n $this->call([\n CountryTableSeeder::class,\n ProvinceTableSeeder::class,\n TagTableSeeder::class\n ]);\n\n User::factory()->count(10)->create();\n Category::factory()->count(5)->create();\n Product::factory()->count(20)->create();\n Section::factory()->count(5)->create();\n Bundle::factory()->count(20)->create();\n\n $bundles = Bundle::all();\n // populate bundle-product table (morph many-to-many)\n Product::all()->each(function ($product) use ($bundles) {\n $product->bundles()->attach(\n $bundles->random(2)->pluck('id')->toArray(),\n ['default_quantity' => rand(1, 10)]\n );\n });\n // populate bundle-tags table (morph many-to-many)\n Tag::all()->each(function ($tag) use ($bundles) {\n $tag->bundles()->attach(\n $bundles->random(2)->pluck('id')->toArray()\n );\n });\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n Contract::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 50; $i++) {\n Contract::create([\n 'serialnumbers' => $faker->numberBetween($min = 1000000, $max = 2000000),\n 'address' => $faker->address,\n 'landholder' => $faker->lastName,\n 'renter' => $faker->lastName,\n 'price' => $faker->numberBetween($min = 10000, $max = 50000),\n 'rent_start' => $faker->date($format = 'Y-m-d', $max = 'now'),\n 'rent_end' => $faker->date($format = 'Y-m-d', $max = 'now'),\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker=Faker\\Factory::create();\n\n for($i=0;$i<100;$i++){\n \tApp\\Blog::create([\n \t\t'title' => $faker->catchPhrase,\n 'description' => $faker->text,\n 'showns' =>true\n \t\t]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0'); // TO PREVENT CHECKS FOR foreien key in seeding\n\n User::truncate();\n Category::truncate();\n Product::truncate();\n Transaction::truncate();\n\n DB::table('category_product')->truncate();\n\n User::flushEventListeners();\n Category::flushEventListeners();\n Product::flushEventListeners();\n Transaction::flushEventListeners();\n\n $usersQuantities = 1000;\n $categoriesQuantities = 30;\n $productsQuantities = 1000;\n $transactionsQuantities = 1000;\n\n factory(User::class, $usersQuantities)->create();\n factory(Category::class, $categoriesQuantities)->create();\n\n factory(Product::class, $productsQuantities)->create()->each(\n function ($product) {\n $categories = Category::all()->random(mt_rand(1, 5))->pluck('id');\n $product->categories()->attach($categories);\n });\n\n factory(Transaction::class, $transactionsQuantities)->create();\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n $this->call(PermissionsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n\n $this->call(BusinessTableSeeder::class);\n $this->call(PrinterTableSeeder::class);\n factory(App\\Tag::class,10)->create();\n factory(App\\Category::class,10)->create();\n factory(App\\Subcategory::class,50)->create();\n factory(App\\Provider::class,10)->create();\n factory(App\\Product::class,24)->create()->each(function($product){\n\n $product->images()->saveMany(factory(App\\Image::class, 4)->make());\n\n });\n\n\n factory(App\\Client::class,10)->create();\n }", "public function run()\n {\n Article::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 50; $i++) {\n Article::create([\n 'name' => $faker->sentence,\n 'sku' => $faker->paragraph,\n 'price' => $faker->number,\n ]);\n }\n }", "public function run()\n {\n Storage::deleteDirectory('public/products');\n Storage::makeDirectory('public/products');\n\n $this->call(UserSeeder::class);\n Category::factory(4)->create();\n $this->call(ProductSeeder::class);\n Order::factory(4)->create();\n Order_Detail::factory(4)->create();\n Size::factory(100)->create();\n }", "public function run()\n\t{\n\t\t\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n\t\t$faker = \\Faker\\Factory::create();\n\n\t\tTodolist::truncate();\n\n\t\tforeach(range(1, 50) as $index)\n\t\t{\n\n\t\t\t$user = User::create([\n\t\t\t\t'name' => $faker->name,\n\t\t\t\t'email' => $faker->email,\n\t\t\t\t'password' => 'password',\n\t\t\t\t'confirmation_code' => mt_rand(0, 9),\n\t\t\t\t'confirmation' => rand(0,1) == 1\n\t\t\t]);\n\n\t\t\t$list = Todolist::create([\n\t\t\t\t'name' => $faker->sentence(2),\n\t\t\t\t'description' => $faker->sentence(4),\n\t\t\t]);\n\n\t\t\t// BUILD SOME TASKS FOR EACH LIST ITEM\n\t\t\tforeach(range(1, 10) as $index) \n\t\t\t{\n\t\t\t\t$task = new Task;\n\t\t\t\t$task->name = $faker->sentence(2);\n\t\t\t\t$task->description = $faker->sentence(4);\n\t\t\t\t$list->tasks()->save($task);\n\t\t\t}\n\n\t\t}\n\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS = 1'); \n\n\t}", "public function run()\n {\n $this->call(RolSeeder::class);\n\n $this->call(UserSeeder::class);\n Category::factory(4)->create();\n Doctor::factory(25)->create();\n Patient::factory(50)->create();\n Status::factory(3)->create();\n Appointment::factory(100)->create();\n }", "public function run()\n {\n Campus::truncate();\n Canteen::truncate();\n Dorm::truncate();\n\n $faker = Faker\\Factory::create();\n $schools = School::all();\n foreach ($schools as $school) {\n \tforeach (range(1, 2) as $index) {\n\t \t$campus = Campus::create([\n\t \t\t'school_id' => $school->id,\n\t \t\t'name' => $faker->word . '校区',\n\t \t\t]);\n\n \t$campus->canteens()->saveMany(factory(Canteen::class, mt_rand(2,3))->make());\n $campus->dorms()->saveMany(factory(Dorm::class, mt_rand(2,3))->make());\n\n }\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::table('users')->insert([\n 'name' => 'admin',\n 'email' => 'admin@gmail.com',\n 'password' => bcrypt('admin'),\n 'seq_q'=>'1',\n 'seq_a'=>'admin'\n ]);\n\n // DB::table('bloods')->insert([\n // ['name' => 'A+'],\n // ['name' => 'A-'],\n // ['name' => 'B+'],\n // ['name' => 'B-'],\n // ['name' => 'AB+'],\n // ['name' => 'AB-'],\n // ['name' => 'O+'],\n // ['name' => 'O-'],\n // ]);\n\n \n }", "public function run()\n {\n //\n DB::table('foods')->delete();\n\n Foods::create(array(\n 'name' => 'Chicken Wing',\n 'author' => 'Bambang',\n 'overview' => 'a deep-fried chicken wing, not in spicy sauce'\n ));\n\n Foods::create(array(\n 'name' => 'Beef ribs',\n 'author' => 'Frank',\n 'overview' => 'Slow baked beef ribs rubbed in spices'\n ));\n\n Foods::create(array(\n 'name' => 'Ice cream',\n 'author' => 'Lou',\n 'overview' => ' A sweetened frozen food typically eaten as a snack or dessert.'\n ));\n\n }", "public function run()\n {\n // $this->call(UserTableSeeder::class);\n \\App\\User::create([\n 'name'=>'PAPE SAMBA NDOUR',\n 'email'=>'papesambandour@hotmail.com',\n 'password'=>bcrypt('Admin1122'),\n ]);\n\n $faker = Faker::create();\n\n for ($i = 0; $i < 100 ; $i++)\n {\n $firstName = $faker->firstName;\n $lastName = $faker->lastName;\n $niveau = \\App\\Niveau::inRandomOrder()->first();\n \\App\\Etudiant::create([\n 'prenom'=>$firstName,\n 'nom'=>$lastName,\n 'niveau_id'=>$niveau->id\n ]);\n }\n\n\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n News::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 10; $i++) {\n News::create([\n 'title' => $faker->sentence,\n 'summary' => $faker->sentence,\n 'content' => $faker->paragraph,\n 'imagePath' => '/img/exclamation_mark.png'\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class, 3)->create();\n factory(App\\Models\\Category::class, 3)\n ->create()\n ->each(function ($u) {\n $u->courses()->saveMany(factory(App\\Models\\Course::class,3)->make())->each(function ($c){\n $c->exams()->saveMany(factory(\\App\\Models\\Exam::class,3)->make())->each(function ($e){\n $e->questions()->saveMany(factory(\\App\\Models\\Question::class,4)->make())->each(function ($q){\n $q->answers()->saveMany(factory(\\App\\Models\\Answer::class,4)->make())->each(function ($a){\n $a->correctAnswer()->save(factory(\\App\\Models\\Correct_answer::class)->make());\n });\n });\n });\n });\n\n });\n\n }", "public function run()\n {\n \\DB::table('employees')->delete();\n\n $faker = \\Faker\\Factory::create('ja_JP');\n\n $role_id = ['1','2','3'];\n\n for ($i = 0; $i < 10; $i++) {\n \\App\\Models\\Employee::create([\n 'last_name' =>$faker->lastName() ,\n 'first_name' => $faker->firstName(),\n 'mail' => $faker->email(),\n 'password' => Hash::make( \"password.$i\"),\n 'birthday' => $faker->date($format='Y-m-d',$max='now'),\n 'role_id' => $faker->randomElement($role_id)\n ]);\n }\n }", "public function run()\n {\n\n DB::table('clients')->delete();\n DB::table('trips')->delete();\n error_log('empty tables done.');\n\n $random_cities = City::inRandomOrder()->select('ar_name')->limit(5)->get();\n $GLOBALS[\"random_cities\"] = $random_cities->pluck('ar_name')->toArray();\n\n $random_airlines = Airline::inRandomOrder()->select('code')->limit(5)->get();\n $GLOBALS[\"random_airlines\"] = $random_airlines->pluck('code')->toArray();\n\n factory(App\\Client::class, 5)->create();\n error_log('Client seed done.');\n\n\n factory(App\\Trip::class, 50)->create();\n error_log('Trip seed done.');\n\n\n factory(App\\Quicksearch::class, 10)->create();\n error_log('Quicksearch seed done.');\n }", "public function run()\n {\n // Admins\n User::factory()->create([\n 'name' => 'Zaiman Noris',\n 'username' => 'rognales',\n 'email' => 'rognales@gmail.com',\n 'active' => true,\n ]);\n\n User::factory()->create([\n 'name' => 'Affiq Rashid',\n 'username' => 'affiqr',\n 'email' => 'sonic21danger@gmail.com',\n 'active' => true,\n ]);\n\n // Only seed test data in non-prod\n if (! app()->isProduction()) {\n Member::factory()->count(1000)->create();\n Staff::factory()->count(1000)->create();\n\n Participant::factory()\n ->addSpouse()\n ->addChildren()\n ->addInfant()\n ->addOthers()\n ->count(500)\n ->hasUploads(2)\n ->create();\n }\n }", "public function run()\n {\n $this->call([\n RoleSeeder::class,\n UserSeeder::class,\n ]);\n\n \\App\\Models\\Category::factory(4)->create();\n \\App\\Models\\View::factory(6)->create();\n \\App\\Models\\Room::factory(8)->create();\n \n $rooms = \\App\\Models\\Room::all();\n // \\App\\Models\\User::all()->each(function ($user) use ($rooms) { \n // $user->rooms()->attach(\n // $rooms->random(rand(1, \\App\\Models\\Room::max('id')))->pluck('id')->toArray()\n // ); \n // });\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n Employee::factory()->create(['email' => 'sovon.kucse@gmail.com']);\n Brand::factory()->count(3)->create();\n $this->call([\n TagSeeder::class,\n AttributeSeeder::class,\n AttributeValueSeeder::class,\n ProductSeeder::class,\n ]);\n }", "public function run()\n {\n $this->call(RolesTableSeeder::class); // crée les rôles\n $this->call(PermissionsTableSeeder::class); // crée les permissions\n\n factory(Employee::class,3)->create();\n factory(Provider::class,1)->create();\n\n $user = User::create([\n 'name'=>'Alioune Bada Ndoye',\n 'email'=>'abada@gmail.com',\n 'phone'=>'773012470',\n 'password'=>bcrypt('123'),\n ]);\n Employee::create([\n 'job'=>'Informaticien',\n 'user_id'=>User::where('email','abada@gmail.com')->first()->id,\n 'point_id'=>Point::find(1)->id,\n ]);\n $user->assignRole('admin');\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n factory(User::class, 1)\n \t->create(['email' => 'eddyjaair@gmail.com']);\n\n factory(Category::class, 5)->create();\n }", "public function run()\n {\n //$this->call(UsersTableSeeder::class);\n $this->call(rootSeed::class);\n factory(App\\Models\\Egresado::class,'hombre',15)->create();\n factory(App\\Models\\Egresado::class,'mujer',15)->create();\n factory(App\\Models\\Administrador::class,5)->create();\n factory(App\\Models\\Notificacion::class,'post',10)->create();\n factory(App\\Models\\Notificacion::class,'mensaje',5)->create();\n factory(App\\Models\\Egresado::class,'bajaM',5)->create();\n factory(App\\Models\\Egresado::class,'bajaF',5)->create();\n factory(App\\Models\\Egresado::class,'suscritam',5)->create();\n factory(App\\Models\\Egresado::class,'suscritaf',5)->create();\n }", "public function run()\n {\n // $faker=Faker::create();\n // foreach(range(1,100) as $index)\n // {\n // DB::table('products')->insert([\n // 'name' => $faker->name,\n // 'price' => rand(10,100000)/100\n // ]);\n // }\n }", "public function run()\n {\n \n User::factory(1)->create([\n 'rol'=>'EPS'\n ]);\n Person::factory(10)->create();\n $this->call(EPSSeeder::class);\n $this->call(OfficialSeeder::class);\n $this->call(VVCSeeder::class);\n $this->call(VaccineSeeder::class);\n }", "public function run()\n {\n $this->call([\n LanguagesTableSeeder::class,\n ListingAvailabilitiesTableSeeder::class,\n ListingTypesTableSeeder::class,\n RoomTypesTableSeeder::class,\n AmenitiesTableSeeder::class,\n UsersTableSeeder::class,\n UserLanguagesTableSeeder::class,\n ListingsTableSeeder::class,\n WishlistsTableSeeder::class,\n StaysTableSeeder::class,\n GuestsTableSeeder::class,\n TripsTableSeeder::class,\n ReviewsTableSeeder::class,\n RatingsTableSeeder::class,\n PopularDestinationsTableSeeder::class,\n ImagesTableSeeder::class,\n ]);\n\n // factory(App\\User::class, 5)->states('host')->create();\n // factory(App\\User::class, 10)->states('hostee')->create();\n\n // factory(App\\User::class, 10)->create();\n // factory(App\\Models\\Listing::class, 30)->create();\n }", "public function run()\n {\n Schema::disableForeignKeyConstraints();\n Grade::truncate();\n Schema::enableForeignKeyConstraints();\n\n $faker = \\Faker\\Factory::create();\n\n for ($i = 0; $i < 10; $i++) {\n Grade::create([\n 'letter' => $faker->randomElement(['а', 'б', 'в']),\n 'school_id' => $faker->unique()->numberBetween(1, School::count()),\n 'level' => 1\n ]);\n }\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n factory(App\\User::class,5)->create();//5 User created\n factory(App\\Model\\Genre::class,5)->create();//5 genres\n factory(App\\Model\\Film::class,6)->create();//6 films\n factory(App\\Model\\Comment::class, 20)->create();// 20 comments\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n User::create([\n 'name' => 'jose luis',\n 'email' => 'barbozagonzalesjose@gmail.com',\n 'password' => bcrypt('xxxxxx'),\n 'role' => 'admin',\n ]);\n\n Category::create([\n 'name' => 'inpods',\n 'description' => 'auriculares inalambricos que funcionan con blouthue genial'\n ]);\n\n Category::create([\n 'name' => 'other',\n 'description' => 'otra cosa diferente a un inpods'\n ]);\n\n\n /* Create 10 products */\n Product::factory(10)->create();\n }", "public function run()\n {\n\n $this->call(UserSeeder::class);\n factory(Empresa::class,10)->create();\n factory(Empleado::class,50)->create();\n }", "public function run()\n {\n $user_ids = [1,2,3];\n $faker = app(\\Faker\\Generator::class);\n $posts = factory(\\App\\Post::class)->times(50)->make()->each(function($post) use ($user_ids,$faker){\n $post->user_id = $faker->randomElement($user_ids);\n });\n \\App\\Post::insert($posts->toArray());\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(User::class)->create([\n 'email' => 'russell@gmail.com',\n 'name' => 'Russell'\n ]);\n\n factory(User::class)->create([\n 'email' => 'bitfumes@gmail.com',\n 'name' => 'Bitfumes'\n ]);\n\n factory(User::class)->create([\n 'email' => 'paul@gmail.com',\n 'name' => 'Paul'\n ]);\n }", "public function run()\n {\n // Vaciar la tabla.\n Favorite::truncate();\n $faker = \\Faker\\Factory::create();\n // Crear artículos ficticios en la tabla\n\n // factory(App\\Models\\User::class, 2)->create()->each(function ($user) {\n // $user->users()->saveMany(factory(App\\Models\\User::class, 25)->make());\n //});\n }", "public function run()\n\t{\n\t\t$this->call(ProductsTableSeeder::class);\n\t\t$this->call(CategoriesTableSeeder::class);\n\t\t$this->call(BrandsTableSeeder::class);\n\t\t$this->call(ColorsTableSeeder::class);\n\n\t\t$products = \\App\\Product::all();\n \t$categories = \\App\\Category::all();\n \t$brands = \\App\\Brand::all();\n \t$colors = \\App\\Color::all();\n\n\t\tforeach ($products as $product) {\n\t\t\t$product->colors()->sync($colors->random(3));\n\n\t\t\t$product->category()->associate($categories->random(1)->first());\n\t\t\t$product->brand()->associate($brands->random(1)->first());\n\n\t\t\t$product->save();\n\t\t}\n\n\t\t// for ($i = 0; $i < count($products); $i++) {\n\t\t// \t$cat = $categories[rand(0,5)];\n\t\t// \t$bra = $brands[rand(0,7)];\n\t\t// \t$cat->products()->save($products[$i]);\n\t\t// \t$bra->products()->save($products[$i]);\n\t\t// }\n\n\t\t// $products = factory(App\\Product::class)->times(20)->create();\n\t\t// $categories = factory(App\\Category::class)->times(6)->create();\n\t\t// $brands = factory(App\\Brand::class)->times(8)->create();\n\t\t// $colors = factory(App\\Color::class)->times(15)->create();\n\t}", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker = Faker::create();\n foreach (range(1,200) as $index) {\n DB::table('users')->insert([\n 'name' => $faker->name,\n 'email' => $faker->email,\n 'phone' => $faker->randomDigitNotNull,\n 'address'=> $faker->streetAddress,\n 'password' => bcrypt('secret'),\n ]);\n }\n }", "public function run()\n {\n /*$this->call(UsersTableSeeder::class);\n $this->call(GroupsTableSeeder::class);\n $this->call(TopicsTableSeeder::class);\n $this->call(CommentsTableSeeder::class);*/\n DB::table('users')->insert([\n 'name' => 'pkw',\n 'email' => 'pkw@pkw.com',\n 'password' => bcrypt('secret'),\n 'type' => '1'\n ]);\n }", "public function run()\n {\n $this->call(UsersSeeder::class);\n User::factory(2)->create();\n Company::factory(2)->create();\n\n }", "public function run()\n {\n echo PHP_EOL , 'seeding roles...';\n\n Role::create(\n [\n 'name' => 'Admin',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Principal',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Teacher',\n 'deletable' => false,\n ]\n );\n\n Role::create(\n [\n 'name' => 'Student',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Parents',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Accountant',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Librarian',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Receptionist',\n 'deletable' => false,\n ]\n );\n\n\n }", "public function run()\n {\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 5; $i++) {\n Runner::create([\n 'external_id' => $faker->uuid,\n 'name' => $faker->name,\n 'race_id' =>rand(1,5),\n 'age' => rand(30, 45),\n 'sex' => $faker->randomElement(['male', 'female']),\n 'color' => $faker->randomElement(['#ecbcb4', '#d1a3a4']),\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // $this->call(QuestionTableSeed::class);\n\n $this->call([\n QuestionTableSeed::class,\n AlternativeTableSeed::class,\n ScheduleActionTableSeeder::class,\n UserTableSeeder::class,\n CompanyClassificationTableSeed::class,\n ]);\n // DB::table('clients')->insert([\n // 'name' => 'Empresa-02',\n // 'email' => 'empresa02@gmail.com',\n // 'password' => bcrypt('07.052.477/0001-60'),\n // ]);\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n\n User::factory()->create([\n 'name' => 'Carlos',\n 'email' => 'carlos@email.com',\n 'email_verified_at' => now(),\n 'password' => bcrypt('123456'), // password\n 'remember_token' => Str::random(10),\n ]);\n \n $this->call([PostsTableSeeder::class]);\n $this->call([TagTableSeeder::class]);\n\n }", "public function run()\n {\n $this->call(AlumnoSeeder::class);\n //Alumnos::factory()->count(30)->create();\n //DB::table('alumnos')->insert([\n // 'dni_al' => '13189079',\n // 'nom_al' => 'Jose',\n // 'ape_al' => 'Araujo',\n // 'rep_al' => 'Principal',\n // 'esp_al' => 'Tecnologia',\n // 'lnac_al' => 'Valencia'\n //]);\n }", "public function run()\n {\n Eloquent::unguard();\n\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n\n // $this->call([\n // CountriesTableSeeder::class,\n // ]);\n\n factory(App\\User::class, 100)->create();\n factory(App\\Type::class, 10)->create();\n factory(App\\Item::class, 100)->create();\n factory(App\\Order::class, 1000)->create();\n\n $items = App\\Item::all();\n\n App\\Order::all()->each(function($order) use ($items) {\n\n $n = rand(1, 10);\n\n $order->items()->attach(\n $items->random($n)->pluck('id')->toArray()\n , ['quantity' => $n]);\n\n $order->total = $order->items->sum(function($item) {\n return $item->price * $item->pivot->quantity;\n });\n\n $order->save();\n\n });\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n factory(User::class)->create(\n [\n 'email'=>'izzanniroshlei@gmail.com',\n 'name'=>'izzanni',\n \n ]\n );\n factory(User::class)->create(\n [\n 'email'=>'aina@gmail.com',\n 'name'=>'aina',\n\n ]\n );\n factory(User::class)->create(\n [\n 'email'=>'sab@gmail.com',\n 'name'=>'sab',\n\n ]\n );\n }", "public function run()\n {\n\n factory('App\\Models\\Pessoa', 60)->create();\n factory('App\\Models\\Profissional', 10)->create();\n factory('App\\Models\\Paciente', 50)->create();\n $this->call(UsersTableSeeder::class);\n $this->call(ProcedimentoTableSeeder::class);\n // $this->call(PessoaTableSeeder::class);\n // $this->call(ProfissionalTableSeeder::class);\n // $this->call(PacienteTableSeeder::class);\n // $this->call(AgendaProfissionalTableSeeder::class);\n }", "public function run()\n {\n \t// DB::table('categories')->truncate();\n // factory(App\\Models\\Category::class, 10)->create();\n Schema::disableForeignKeyConstraints();\n Category::truncate();\n $faker = Faker\\Factory::create();\n\n $categories = ['SAMSUNG','NOKIA','APPLE','BLACK BERRY'];\n foreach ($categories as $key => $value) {\n Category::create([\n 'name'=>$value,\n 'description'=> 'This is '.$value,\n 'markup'=> rand(10,100),\n 'category_id'=> null,\n 'UUID' => $faker->uuid,\n ]);\n }\n }", "public function run()\n {\n \t$roles = DB::table('roles')->pluck('id');\n \t$sexes = DB::table('sexes')->pluck('id');\n \t$faker = \\Faker\\Factory::create();\n\n \tforeach (range(1,20) as $item) {\n \t\tDB::table('users')->insert([\n \t\t\t'role_id' => $faker->randomElement($roles),\n \t\t\t'sex_id' => $faker->randomElement($sexes),\n \t\t\t'name' => $faker->firstName . ' ' . $faker->lastName,\n \t\t\t'dob' => $faker->date,\n \t\t\t'bio' => $faker->text,\n \t\t\t'created_at' => now(),\n \t\t\t'updated_at' => now()\n \t\t]);\n \t} \n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n //nhập liệu mẫu cho bảng users\n DB::table('users')->insert([\n \t['id'=>'1001', 'name'=>'Phan Thị Hiền', 'email'=>'hienphan18112015@gmail.com', 'password'=>'123456', 'isadmin'=>1],\n \t['id'=>'1002', 'name'=>'Phan Thị Hà', 'email'=>'haphan@gmail.com', 'password'=>'111111', 'isadmin'=>0]\n ]);\n\n\n //nhập liệu mẫu cho bảng suppliers\n DB::table('suppliers')->insert([\n \t['name'=>'FPT', 'address'=>'151 Hùng Vương, TP. Đà Nẵng', 'phonenum'=>'0971455395'],\n \t['name'=>'Điện Máy Xanh', 'address'=>'169 Phan Châu Trinh, TP. Đà Nẵng', 'phonenum'=>'0379456011']\n ]);\n\n\n //Bảng phiếu bảo hành\n }" ]
[ "0.80138505", "0.79804975", "0.7977927", "0.7954003", "0.7951511", "0.79507065", "0.79449123", "0.794312", "0.7938865", "0.79372203", "0.79340154", "0.7892169", "0.7881411", "0.7879766", "0.78787434", "0.7875771", "0.7870809", "0.7870481", "0.7852045", "0.7851101", "0.784159", "0.78346395", "0.7827439", "0.7818506", "0.78085804", "0.7803168", "0.7803112", "0.7800874", "0.78000623", "0.77964896", "0.7790986", "0.77893186", "0.7786942", "0.7779508", "0.77773196", "0.7766297", "0.7762858", "0.77619725", "0.7761802", "0.77617735", "0.7760563", "0.77588934", "0.7757106", "0.77538526", "0.7750399", "0.7749764", "0.77460176", "0.7729847", "0.77295387", "0.77283424", "0.7717115", "0.7715115", "0.77147174", "0.77134794", "0.7713354", "0.7712908", "0.77113235", "0.7711319", "0.77109134", "0.7710318", "0.77056116", "0.770521", "0.77040505", "0.7704028", "0.7702745", "0.7702163", "0.77015257", "0.7699154", "0.76988846", "0.7698059", "0.76972497", "0.76941127", "0.7692912", "0.76910675", "0.7690705", "0.7687825", "0.7687763", "0.76870334", "0.76862305", "0.7684728", "0.76843387", "0.7680029", "0.76790416", "0.7678002", "0.76777124", "0.76734155", "0.7670605", "0.7669205", "0.7668748", "0.766868", "0.7666607", "0.76631796", "0.7662515", "0.7661419", "0.76591927", "0.7656439", "0.7654022", "0.76532", "0.76526594", "0.7652528", "0.765247" ]
0.0
-1
Make an instance of a validator either by name, string of the class or a closure
public function make($validator) { if ($validator instanceof Closure) { $validator = new ClosureValidator($validator, $this->request, $this->validatorFactory, $this->router); return array($validator->getInput(), $validator->getRules(), $validator->getFailedMessages()); } if (is_string($validator) AND ! isset($this->validators[$validator])) { $this->validators[$validator] = $validator; } if (isset($this->validators[$validator])) { if ($this->validators[$validator] instanceof Closure) { return new ClosureValidator($this->validators[$validator], $this->request, $this->validatorFactory); } return new $this->validators[$validator]($this->request, $this->validatorFactory); } throw new \InvalidArgumentException('Invalid input validator.'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getValidator($name = 'default') {\n\t\t\t//\n\t\t\tif ($name == 'default') { return new Validator();}\n\t\t\trequire (VALIDATORS . $name . '_validator.php');\n\t\t\t$name = $name . '_Validator';\n\t\t\treturn new $name();\n\t\t}", "public function createValidator();", "public function makeValidator()\r\n {\r\n if (10 == $this->countDigits($this->string)) {\r\n return new Validator10($this->string);\r\n }\r\n\r\n if (13 == $this->countDigits($this->string)) {\r\n return new Validator13($this->string);\r\n } \r\n }", "public static function getValidator($name, array $options = []);", "protected function getValidator($name, $options, $message)\n {\n $name = strtolower($name);\n $validator = '\\\\Best\\\\Driver\\\\Validator\\\\' . ucfirst($name);\n return new $validator($options, $message);\n }", "public function __call(string $ruleName, array $arguments): ValidatorInterface;", "private function createValidator()\n {\n // add custom validation rules\n \\Validator::extend('contains_caps',\n function($field, $value, $params)\n {\n return preg_match('#[A-Z]#', $value);\n }\n );\n\n \\Validator::extend('contains_digit',\n function($field, $value, $params)\n {\n return preg_match('#[0-9]#', $value);\n }\n );\n\n // set array of messages for custom rules\n $messages = array(\n 'contains_caps' => ':attribute must contain at least one capital letter.',\n 'contains_digit' => ':attribute must contain at least one numeric digit.'\n );\n\n // set array of rules to use for validation (many are Laravel's built-ins)\n $rules = array(\n 'email' => 'required|email|max:255',\n 'password' => 'required|between:8,50|contains_caps|contains_digit', // password has some \"strength\" requirements\n 'first_name' => 'required|max:50',\n 'last_name' => 'required|max:50',\n 'city' => 'required|max:100',\n 'state' => 'required|max:2',\n 'zip' => 'required|max:20',\n 'biography' => 'required',\n );\n\n $validator = \\Validator::make(\\Input::all(), $rules, $messages);\n\n return $validator;\n }", "private function createValidator($validatorName, $options = array()) { \n $mergedOptions = array_merge($this->defaults, $options); \n $key = strtolower($validatorName);\n if (! array_key_exists($key, $this->validators)) {\n switch ($validatorName) {\n case self::NOT_EMPTY:\n $validator = new Zend_Validate_NotEmpty();\n break;\n case self::STRING_LENGTH:\n $validator = new Zend_Validate_StringLength($mergedOptions['min'], $mergedOptions['max'], $mergedOptions['encoding']); \n break;\n case self::EMAIL_ADDRESS :\n $validator = new Zend_Validate_EmailAddress();\n break; \n case self::EMAIL_ADDRESS_ALLOW_EMPTY :\n $validator = new Miqo_Validation_EmailAddressAllowEmpty();\n break; \n case self::BETWEEN:\n $validator = new Zend_Validate_Between($mergedOptions['min'], $mergedOptions['max'], $mergedOptions['inclusive']);\n break;\n case self::GREATER_THAN:\n $validator = new Zend_Validate_GreaterThan($mergedOptions['min']);\n break;\n case self::LESS_THAN:\n $validator = new Zend_Validate_LessThan($mergedOptions['max']);\n break;\n case self::LESS_THAN_OR_EQUAL:\n $validator = new Miqo_Validation_LessThanOrEqual($mergedOptions['max']);\n break;\n case self::ALNUM: \n $validator = new Zend_Validate_Alnum($mergedOptions['allowWhiteSpace']);\n break;\n case self::ALNUM_ALLOW_EMPTY :\n $validator = new Miqo_Validation_AlnumAllowEmpty();\n break;\n case self::REGEX:\n $validator = new Zend_Validate_Regex($mergedOptions['pattern']);\n break;\n case self::DB_NO_RECORD_EXISTS: \n $validator = new Zend_Validate_Db_NoRecordExists($mergedOptions['table'], $mergedOptions['field']); \n break;\n case self::DIGITS :\n $validator = new Zend_Validate_Digits();\n break; \n case self::DIGITS_ALLOW_EMPTY :\n $validator = new Miqo_Validation_DigitsAllowEmpty();\n break;\n case self::FLOAT :\n \t$validator = new Zend_Validate_Float();\n \tbreak;\n \tcase self::FLOAT_ALLOW_EMPTY :\n \t\t$validator = new Miqo_Validation_FloatAllowEmpty();\n \t\tbreak;\n case self::PASSWORD:\n $validator = new Miqo_Validation_Password();\n break;\n case self::DATE_GREATER_THAN_OR_EQUAL:\n $validator = new Miqo_Validation_Date_GreaterThanOrEqual($mergedOptions['minDate']);\n break;\n case self::UPLOADED:\n $validator = new Miqo_Validation_Uploaded();\n break;\n default: \n $validatorName = 'Zend_Validate_'.$validatorName;\n $validator = new $validatorName($mergedOptions['table']);\n break;\n }\n $this->validators [$key] = $validator;\n }\n $validator = $this->validators [$key];\n\n if ($validatorName != self::DB_NO_RECORD_EXISTS){\n foreach ($options as $key => $value){\n $methodSet = 'set'.ucfirst($key);\n $validator->$methodSet($value);\n }\n } \n return $validator;\n }", "public static function __callStatic(string $ruleName, array $arguments): ValidatorInterface;", "public function setCustomRule(string $name, Validatable $rule): ValidatorInterface;", "public function getValidator();", "public function getValidator();", "public static function createOrExisting(): ValidatorInterface;", "protected function getValidatorInstance()\n {\n return app(ValidationFactory::class);\n }", "final public static function getInstance($type, array $params = [])\n {\n $class = 'Aleph\\Data\\Validators\\\\' . $type;\n if (!\\Aleph::loadClass($class)) throw new Core\\Exception('Aleph\\Data\\Validators\\Validator::ERR_VALIDATOR_1', $type);\n $validator = new $class;\n foreach ($params as $k => $v) $validator->{$k} = $v;\n return $validator;\n }", "public function getValidatorService();", "public function add($type, $codename, $name='') {\n\t\tif(is_string($type) && array_key_exists($type, $this->types)) {\n\t\t\t$class = $this->types[$type];\n\t\t\t$v = new $class($codename, $name);\n\t\t\t$this->validators[$codename] = $v;\n\t\t\treturn $v;\n\t\t}\n\t\telseif(class_exists($type)) {\n\t\t\tif(!is_subclass_of($type, 'Phpiv\\Validator')) {\n\t\t\t\tthrow new InvalidArgumentException(\n\t\t\t\t\t'The class must be a validator');\n\t\t\t}\n\t\t\t$v = new $type($codename, $name);\n\t\t\t$this->validators[$codename] = $v;\n\t\t\treturn $v;\n\t\t}\n\t\tthrow new InvalidArgumentException(\n\t\t\t'You must pas a validator class or its alias');\n\t}", "protected function createValidator() {\n return $this->validator;\n }", "abstract function validator();", "public static function getClosureValidation(): Closure;", "protected function makeValidator()\n {\n $rules = $this->expandUniqueRules($this->rules);\n\n $validator = static::$validator->make($this->getAttributes(), $rules);\n\n event(new ModelValidator($this, $validator));\n\n return $validator;\n }", "public function createValidator()\n {\n $validator = Validation::createValidatorBuilder()\n ->setMetadataFactory(new ClassMetadataFactory(new StaticMethodLoader()))\n ->setConstraintValidatorFactory(new ConstraintValidatorFactory($this->app))\n ->setTranslator($this->getTranslator())\n ->setApiVersion(Validation::API_VERSION_2_5)\n ->getValidator();\n\n return $validator;\n }", "public function getValidator() {}", "public function __construct(\\Closure $func)\n {\n $params = (new \\ReflectionFunction($func))->getParameters();\n\n // Must have exactly 2 params\n if (2 != count($params)) {\n throw new \\Exception('Closure passed to Validator::__construct() is invalid: Must have exactly 2 parameters.');\n }\n\n // First must be 'input' and be of type pointybeard\\Helpers\\Cli\\Input\\AbstractInputType\n if ('input' != $params[0]->getName() || __NAMESPACE__.'\\AbstractInputType' != (string) $params[0]->getType()) {\n throw new \\Exception('Closure passed to Validator::__construct() is invalid: First parameter must match '.__NAMESPACE__.\"\\AbstractInputType \\$input. Provided with \".(string) $params[0]->getType().\" \\${$params[0]->getName()}\");\n }\n\n // Second must be 'context' and be of type pointybeard\\Helpers\\Cli\\Input\\AbstractInputHandler\n if ('context' != $params[1]->getName() || __NAMESPACE__.'\\AbstractInputHandler' != (string) $params[1]->getType()) {\n throw new \\Exception('Closure passed to Validator::__construct() is invalid: Second parameter must match '.__NAMESPACE__.\"\\AbstractInputHandler \\$context. Provided with \".(string) $params[1]->getType().\" \\${$params[1]->getName()}\");\n }\n\n $this->func = $func;\n }", "protected function get9c2345652e8ae3f87ba009d0f8fedee27bb751398014908e9ab2fb6d5bf1300f(): \\Viserio\\Component\\Validation\\Validator\n {\n return $this->services[\\Viserio\\Contract\\Validation\\Validator::class] = new \\Viserio\\Component\\Validation\\Validator();\n }", "private function getValidator()\n {\n $v = new Validator();\n $v->addRules([\n ['label', 'Label', 'required'],\n ['num_value', 'Number', 'exists type=number'],\n ['comment', 'Comment', 'exists'],\n ]);\n return $v;\n }", "public function newValidator($userid) {\n $validator = $this->createValidator();\n\n // Write to the table\n $sql =<<<SQL\nINSERT INTO $this->tableName(userid, validator)\nVALUES (?, ?)\nSQL;\n $pdo = $this->pdo();\n $statement = $pdo->prepare($sql);\n\n try {\n if($statement->execute(array($userid,\n $validator)\n ) === false) {\n return null;\n }\n } catch(\\PDOException $e) {\n return null;\n }\n\n return $validator;\n }", "protected function _createValidator($base, $options = array()) {\n\t\tif (null == $this->_validationLoader) {\n\t\t\t$this->_validationLoader = new Zend_Loader_PluginLoader(\n\t\t\t\tarray('Zend_Validate_' => 'Zend/Validate/')\n\t\t\t);\n\t\t\tforeach ($this->getElement()->getValidatorNamespaces() as $namespace) {\n\t\t\t\t$prefix = $namespace . '_';\n\t\t\t\t$this->_validationLoader->addPrefixPath($prefix, str_replace('_', '/', $prefix));\n\t\t\t}\n\t\t}\n\n\t\t$name = $this->_validationLoader->load($base);\n\t\tif (empty($options)) {\n\t\t\treturn new $name;\n\t\t} else {\n\t\t\t//return new $name($options);\n\t\t\t$r = new ReflectionClass($name);\n\t\t\tif ($r->hasMethod('__construct')) {\n\t\t\t\treturn $r->newInstanceArgs($options);\n\t\t\t} else {\n\t\t\t\treturn new $name;\n\t\t\t}\n\t\t}\n\t}", "protected function validator(array $data)\n {\n return self::getValidator($data);\n }", "protected function getValidationFactory()\n {\n return app('validator');\n }", "public function createFooResponseValidator(): ResponseValidatorInterface\n {\n return new AcmeFooResponseValidator();\n }", "protected function getValidatorInstance()\n {\n $factory = $this->container->make('Illuminate\\Validation\\Factory');\n if (method_exists($this, 'validator')) {\n return $this->container->call([$this, 'validator'], compact('factory'));\n }\n\n $rules = $this->container->call([$this, 'rules']);\n $attributes = $this->attributes();\n $messages = [];\n\n $translationsAttributesKey = $this->getTranslationsAttributesKey();\n\n foreach ($this->requiredLocales() as $localeKey => $locale) {\n $this->localeKey = $localeKey;\n foreach ($this->container->call([$this, 'translationRules']) as $attribute => $rule) {\n $key = $localeKey . '.' . $attribute;\n $rules[$key] = $rule;\n $attributes[$key] = trans($translationsAttributesKey . $attribute);\n }\n\n foreach ($this->container->call([$this, 'translationMessages']) as $attributeAndRule => $message) {\n $messages[$localeKey . '.' . $attributeAndRule] = $message;\n }\n }\n\n return $factory->make(\n $this->all(),\n $rules,\n array_merge($this->messages(), $messages),\n $attributes\n );\n }", "public static function parseFromValidation(string $name, $rule): self\n {\n $param = new self($name);\n $rule = !is_string($rule) ? $rule->__toString() : $rule; \n $parsedRules = explode('|', $rule);\n\n foreach ($parsedRules as $concreteRule) { \n try {\n $value = explode(':', $concreteRule)[1];\n } catch (Exception $e) {\n $value = null;\n }\n \n try {\n $param->{$concreteRule}($value);\n } catch (Error $e) {\n continue;\n } catch (BadMethodCallException $e) {\n continue;\n }\n }\n \n return $param;\n }", "public static function create()\r\n\t{\r\n\t\t$validator = Validation::forge('callback');\r\n\t\t\r\n\t\t$validator->add('event', 'Event Name')->add_rule('trim')->add_rule('required')->add_rule(array('invalid_event_name' => function ($event_name) {\r\n\t\t\t$event = Service_Event::find_one(array('name' => $event_name));\r\n\t\t\tif (!$event) {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\treturn true;\r\n\t\t}));\r\n\t\t\r\n\t\t$validator->add('url', 'Callback URL')->add_rule('trim')->add_rule('valid_url')->add_rule('required');\r\n\t\t\r\n\t\treturn $validator;\r\n\t}", "public function addValidator(callable $callable, $name)\n {\n $name = trim($name);\n $this->validators[$name] = $callable;\n\n return $this;\n }", "public function validator(string $ormClass) : ValidatorContract\n {\n\n $rules = $this->detectRules($ormClass);\n return $this->createObject(Validator::class, [\n 'rules' => $rules,\n 'ormClass' => $ormClass,\n 'baseValidator' => $this->createObject(IlluminateBaseValidator::class)\n ]);\n\n }", "protected function createValidator(string $validatorClass): ValidatorInterface\n {\n if (! is_subclass_of($validatorClass, ValidatorInterface::class)) {\n throw new LogicException(\n sprintf('The class %s is not a subclass of %s', $validatorClass, ValidatorInterface::class)\n );\n }\n $validator = call_user_func([$validatorClass, 'create']);\n $this->hydrater->hydrate($validator);\n return $validator;\n }", "public function validator()\n {\n\n return AvaliacoeValidator::class;\n }", "public function withData(array|object $data): ValidatorInterface;", "public function withContext(mixed $context): ValidatorInterface;", "protected function getValidatorInstance()\n {\n // cause comes json, we need to change it to array to validate it\n $this->request->set('categories_names', json_decode($this->input()['categories_names'], true));\n // clean alias from unnecessary symbols\n $this->request->set('category_alias', Helpers::cleanToOnlyLettersNumbers($this->input()['category_alias']));\n\n return parent::getValidatorInstance();\n }", "public static function assert($value, $name = 'value')\n {\n if (is_object($value)) {\n throw new InvalidNotObjectException($name);\n }\n\n if (!is_string($name)) {\n throw new InvalidStringException('name', $name);\n }\n\n if (empty(self::$validator)) {\n self::$validator = new static;\n }\n\n self::$validator->name = $name;\n self::$validator->value = $value;\n\n return self::$validator;\n }", "protected function getValidatorInstance()\n {\n // cause comes json, we need to change it to array to validate it\n $this->request->set('postHashtag', json_decode($this->input()['postHashtag'], true));\n $this->request->set('activeLocales', json_decode($this->input()['activeLocales'], true));\n // clean alias from unnecessary symbols\n $this->request->set('postAlias', Helpers::cleanToOnlyLettersNumbers($this->input()['postAlias']));\n\n\n return parent::getValidatorInstance();\n }", "protected function createValidatorMock()\n {\n $validator = $this->getMockForAbstractClass(\n 'Symfony\\Component\\Validator\\Validator\\ValidatorInterface',\n [],\n '',\n false\n );\n\n return $validator;\n }", "protected function getValidatorInstance()\n {\n $validator = parent::getValidatorInstance();\n\n $validator->sometimes('family_member_id.*', 'distinct', function($input)\n {\n return $input->family_member == 1;\n });\n\n $validator->sometimes('family_member_id.*', 'not_in:'. $this->request->get('patriarch'), function($input)\n {\n return $input->family_member == 1;\n });\n\n return $validator;\n }", "public function getValidator()\n\t{\n\t\tif (!is_object($this->_validator)) {\n\t\t\t$validatorClass = $this->xpdo->loadClass('validation.xPDOValidator', XPDO_CORE_PATH, true, true);\n\t\t\tif ($derivedClass = $this->getOption(xPDO::OPT_VALIDATOR_CLASS, null, '')) {\n\t\t\t\tif ($derivedClass = $this->xpdo->loadClass($derivedClass, '', false, true)) {\n\t\t\t\t\t$validatorClass = $derivedClass;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($profitClass = $this->getOption('mlmsystem_handler_class_profit_validator', null, '')) {\n\t\t\t\tif ($profitClass = $this->xpdo->loadClass($profitClass, $this->getOption('mlmsystem_core_path', null, MODX_CORE_PATH . 'components/mlmsystem/') . 'handlers/validations/', false, true)) {\n\t\t\t\t\t$validatorClass = $profitClass;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($validatorClass) {\n\t\t\t\t$this->_validator = new $validatorClass($this);\n\t\t\t}\n\t\t}\n\t\treturn $this->_validator;\n\t}", "public function getCreateTaskValidator()\n : Validators\\ValidatorInterface\n {\n return $this->app->make(\n Validators\\CreateTaskValidator::class\n );\n }", "public static function factory(array $array)\n\t{\n\t\treturn new Validation($array);\n\t}", "public function validator()\n {\n\n return AnggotaKeluargaValidator::class;\n }", "public function validator()\n {\n return UserValidator::class;\n }", "protected function parseValidatorClass($path)\n {\n $parts = explode('::', $path);\n $entity = ucwords($parts[0]);\n $method = $this->parseRuleMethod($parts[1]);\n\n $class = \"{$this->rootNamespace}$entity\\\\$method\";\n\n if (class_exists($class)) {\n return new $class();\n }\n\n throw new ValidationRulesetException(\n \"The ruleset for {$entity}\\\\{$method} doesn't exist.\"\n );\n }", "public function validator()\n {\n\n return UserValidator::class;\n }", "public function validator()\n {\n\n return UserValidator::class;\n }", "public function validator()\n {\n\n return UserValidator::class;\n }", "public function validator()\n {\n\n return UserValidator::class;\n }", "public function validator()\n {\n\n return UserValidator::class;\n }", "public function makeCustomValidator(func $validator): Closure\n {\n return function ($value) {\n try {\n $validator($value);\n return [\n 'result' => true\n ];\n } catch (\\Throwable $th) {\n return [\n 'result' => false,\n 'message' => $th->getMessage()\n ];\n }\n };\n }", "public function validator()\n {\n\n return PescariaValidator::class;\n }", "public function validator()\n {\n\n return EmpreValidator::class;\n }", "public function validator()\n {\n\n return TipoContratoValidator::class;\n }", "public function validator()\n {\n return ZhuanTiValidator::class;\n }", "public function validator()\n {\n\n return BabyInfoValidator::class;\n }", "protected function getValidator(array $options = [])\n {\n $type = '\\\\marvin255\\\\serviform\\\\validators\\\\Regexp';\n\n return FactoryValidators::initElement($type, $options);\n }", "public static function register(string $name, Validator $validator) {\n if(array_key_exists($name, self::$validators)) {\n throw new InvalidArgumentException(\"Validator '\".$name.\"' already existst\");\n }\n self::$validators[$name] = $validator;\n }", "public\n function buildValidator(Event $event, Validator $validator, string $name) {\n\n if ($this->manager) {\n $this->manager->validation($validator);\n }\n }", "public function addValidator(ValidatorInterface $validator, $name = '*')\n {\n $this->hooks[$name][self::ARGUMENT_VALIDATOR][] = $validator;\n return $this;\n }", "public function addValidator(\\Closure $v)\n {\n $this->validators[] = $v;\n return $this;\n }", "public function validator(array $data)\n {\n return $this->validation->make($data, $this->rules());\n }", "protected function resolveValidator(array $data): ?AddValidator {\n switch ($data['type']) {\n case MtInterceptor::STATIC :\n return new StaticMtInterceptorValidator();\n case MtInterceptor::DEFAULT:\n return new DefaultMtInterceptorValidator();\n default:\n return null;\n }\n }", "function validate($validateThis) {}", "public function byPass(bool $status = true): ValidatorInterface;", "static function get_validation_method($ruleName, $field = null) {\n\t\tif (count(self::$validation_classes) == 0) {\n\t\t\tself::get_validation_classes();\n\t\t}\n\t\tif (isset(self::$validation_classes[$ruleName])) {\n\t\t\t$className = self::$validation_classes[$ruleName];\n\t\t\t$method = new $className();\n\t\t\tif ($field) {\n\t\t\t\t$method->setField($field);\n\t\t\t}\n\t\t\treturn $method;\n\t\t} else {\n\t\t\ttrigger_error(\"Couldn't find an FMValidationMethod with ruleName \\\"$ruleName\\\"\", E_USER_WARNING);\n\t\t}\n\t}", "final protected static function getValidator(array $input)\n {\n return new \\FeM\\sPof\\InvalidParameterCheck($input);\n }", "function instance_of($className)\n{\n return function ($element) use ($className) {\n return $element instanceof $className;\n };\n}", "protected function getAjaxValidationFactory()\n {\n return app()->make('validator');\n }", "public function check_validity($_classname);", "public function mapValidatorClass($resource, $validatorClass)\n {\n $this->validators[$resource] = $validatorClass;\n return $this;\n }", "public static function getValidatorInstance()\n {\n if (static::$validator === null)\n {\n static::$validator = new Validator();\n }\n\n return static::$validator;\n }", "public function __construct(Factory $validator)\r\n {\r\n $this->validator = $validator;\r\n }", "public function createValidator($data = [], $rules = [])\n {\n\n // We make an instance of the wished validator-rule,\n // using the nic.at translation files for messages and field names.\n return Validator::make(\n $data,\n $rules,\n $this->getMessages(),\n $this->getAttributes(null, true)\n );\n\n }", "public function addValidator($validator)\n {\n if (is_callable($validator)) {\n $this->_validators[] = array('callable', $validator);\n } elseif (is_object($validator) && method_exists($validator, 'isValid')) {\n $this->_validators[] = array('validator', $validator);\n }\n return $this;\n }", "public static function __callStatic($name, $args)\n {\n $validation = new Validation('en', APPDIR .'/lang');\n // Adding a database connection is optional. Only used for\n // the Exists and Unique rules.\n $db_config = require APPDIR . 'config/database.php';\n $validation->setConnection($db_config);\n $validator = $validation->getValidator();\n\n return call_user_func_array(array($validator, $name), $args);\n }", "public function validator()\n {\n\n return GrupoServicosValidator::class;\n }", "protected function validator(array $data) {\n \n return Validator::make($data, [\n 'name' => 'required'\n ]);\n }", "protected function validator(array $data) {\n $validator = Validator::make($data, [\n 'name' => 'required|string|alpha|max:255',\n 'last_name' => 'required|string|alpha|max:255',\n 'document' => 'required|string|max:255|min:6',\n 'email' => 'required|string|email|max:255|unique:users',\n 'phone_contact' => 'required|string|min:10',\n 'verification' => [\"required\", \"integer\", \"digits:1\", function($attribute, $value, $fail) use ($data) {\n $number = $this->numberVerification($data[\"document\"]);\n\n if ($value != $number) {\n $fail(\"El Digito de Verificación no es valido.\");\n }\n }],\n ]);\n\n// $validator::extend('verification', function ($attribute, $value, $parameters) {\n// // ...\n// }, 'my custom validation rule message');\n\n $niceNames = [\n \"name\" => \"Nombres\",\n \"last_name\" => \"apellidos\",\n \"document\" => \"Documento\",\n \"phone_contact\" => \"Celular de Contacto\",\n \"verification\" => \"Digito de Verificación\",\n ];\n\n\n// $validator->setAttributeNames($niceNames)->validate();\n $validator->setAttributeNames($niceNames);\n return $validator;\n// ]);\n }", "public function registerValidators(array $validators): IValidatorManager;", "public function __construct(Validator $validator)\n {\n $this->validator = $validator;\n }", "public function validator()\n {\n\n return ProvidersValidator::class;\n }", "public function maker()\n {\n $name = $this->_name;\n return function ($class) use ($name) {\n $table = TableRegistry::get($name);\n return $table->newEntity();\n };\n }", "function getValidator() {\n\t\tif ( !$this->_Validator instanceof utilityValidator ) {\n\t\t\t$this->_Validator = new utilityValidator();\n\t\t}\n\t\treturn $this->_Validator;\n\t}", "function getValidator() {\n\t\tif ( !$this->_Validator instanceof utilityValidator ) {\n\t\t\t$this->_Validator = new utilityValidator();\n\t\t}\n\t\treturn $this->_Validator;\n\t}", "function getValidator() {\n\t\tif ( !$this->_Validator instanceof utilityValidator ) {\n\t\t\t$this->_Validator = new utilityValidator();\n\t\t}\n\t\treturn $this->_Validator;\n\t}", "public function getValidator()\n {\n if ($this->_validator === null) {\n\n if (class_exists('\\Atezate\\\\Validator\\Cubos')) {\n\n $this->setValidator(new \\Atezate\\Validator\\Cubos);\n }\n }\n\n return $this->_validator;\n }", "abstract protected function buildValidator(ArrayValidator $desc);", "public function build(Bank $bank)\n {\n $class = sprintf('%s\\Validator%s', __NAMESPACE__, $bank->getValidationType());\n return new $class($bank);\n }", "public function getMockDataTypeValidatorFactory() {\n\t\t// consider \"INVALID\" to be invalid\n\t\t$topValidator = new DataValueValidator(\n\t\t\tnew CompositeValidator( array(\n\t\t\t\tnew TypeValidator( 'string' ),\n\t\t\t\tnew RegexValidator( '/INVALID/', true ),\n\t\t\t), true )\n\t\t);\n\n\t\t$validators = array( new TypeValidator( 'DataValues\\DataValue' ), $topValidator );\n\n\t\t$mock = $this->getMock( 'Wikibase\\Repo\\DataTypeValidatorFactory' );\n\t\t$mock->expects( PHPUnit_Framework_TestCase::any() )\n\t\t\t->method( 'getValidators' )\n\t\t\t->will( PHPUnit_Framework_TestCase::returnCallback( function( $id ) use ( $validators ) {\n\t\t\t\treturn $validators;\n\t\t\t} ) );\n\n\t\treturn $mock;\n\t}", "public static function createRule(string $name, array $filters, bool $traverse)\n {\n $rules = self::getRules();\n\n $ruleClass = isset($rules[$name]) ? $rules[$name] : null;\n\n if (is_null($ruleClass)) {\n throw new \\Exception(\"No Rule class to handle rule {$name}\");\n }\n\n return new $ruleClass($filters, $traverse);\n }", "protected function getValidatorInstance()\n {\n $validator = parent::getValidatorInstance();\n $validator->setAttributeNames(trans('mconsole::personal.form'));\n\n return $validator;\n }", "public function validate($string, $err = null)\r\n {\r\n return new Validator($string, $err);\r\n }", "public function validator()\n {\n\n return OccupationValidator::class;\n }" ]
[ "0.7099156", "0.707022", "0.6853655", "0.6701427", "0.6537665", "0.6495451", "0.6373149", "0.635157", "0.634545", "0.6259881", "0.62474656", "0.62474656", "0.6176186", "0.61554307", "0.6016047", "0.60059494", "0.6004531", "0.6004223", "0.5992679", "0.5983895", "0.5971014", "0.5935501", "0.5924349", "0.592254", "0.5910197", "0.5894198", "0.5892943", "0.58749187", "0.5817912", "0.576389", "0.5762407", "0.5754241", "0.5738311", "0.5737894", "0.5737845", "0.5728482", "0.570514", "0.5702392", "0.5700404", "0.5698022", "0.5665605", "0.5664425", "0.56473535", "0.5644763", "0.5634006", "0.56171733", "0.5596268", "0.55885965", "0.5561257", "0.5543128", "0.5541168", "0.55351675", "0.55351675", "0.55351675", "0.55351675", "0.55351675", "0.54961056", "0.5491372", "0.54908633", "0.54872495", "0.5467212", "0.54459107", "0.54200274", "0.53662217", "0.53636074", "0.5346062", "0.53323275", "0.5330687", "0.53242356", "0.53089535", "0.5308501", "0.52971464", "0.52865994", "0.5276962", "0.5273216", "0.52709067", "0.527052", "0.52669376", "0.5254744", "0.5248467", "0.52479017", "0.5220604", "0.52194226", "0.5214146", "0.52139693", "0.52098846", "0.5207385", "0.51966864", "0.5195021", "0.5182002", "0.5182002", "0.5182002", "0.51734954", "0.51710176", "0.51685536", "0.51569295", "0.5147318", "0.51466745", "0.51322013", "0.51310974" ]
0.6441767
6
Name a validator for later use, also creates a filter if applicable.
public function add($name, $validator, $filterFailResponse = null) { $this->validators[$name] = $validator; $this->addFilter($name, $filterFailResponse); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function createValidator();", "public function getValidator($name = 'default') {\n\t\t\t//\n\t\t\tif ($name == 'default') { return new Validator();}\n\t\t\trequire (VALIDATORS . $name . '_validator.php');\n\t\t\t$name = $name . '_Validator';\n\t\t\treturn new $name();\n\t\t}", "public function getValidator();", "public function getValidator();", "public function getValidator() {}", "public function setCustomRule(string $name, Validatable $rule): ValidatorInterface;", "public static function getValidator($name, array $options = []);", "private function createValidator($validatorName, $options = array()) { \n $mergedOptions = array_merge($this->defaults, $options); \n $key = strtolower($validatorName);\n if (! array_key_exists($key, $this->validators)) {\n switch ($validatorName) {\n case self::NOT_EMPTY:\n $validator = new Zend_Validate_NotEmpty();\n break;\n case self::STRING_LENGTH:\n $validator = new Zend_Validate_StringLength($mergedOptions['min'], $mergedOptions['max'], $mergedOptions['encoding']); \n break;\n case self::EMAIL_ADDRESS :\n $validator = new Zend_Validate_EmailAddress();\n break; \n case self::EMAIL_ADDRESS_ALLOW_EMPTY :\n $validator = new Miqo_Validation_EmailAddressAllowEmpty();\n break; \n case self::BETWEEN:\n $validator = new Zend_Validate_Between($mergedOptions['min'], $mergedOptions['max'], $mergedOptions['inclusive']);\n break;\n case self::GREATER_THAN:\n $validator = new Zend_Validate_GreaterThan($mergedOptions['min']);\n break;\n case self::LESS_THAN:\n $validator = new Zend_Validate_LessThan($mergedOptions['max']);\n break;\n case self::LESS_THAN_OR_EQUAL:\n $validator = new Miqo_Validation_LessThanOrEqual($mergedOptions['max']);\n break;\n case self::ALNUM: \n $validator = new Zend_Validate_Alnum($mergedOptions['allowWhiteSpace']);\n break;\n case self::ALNUM_ALLOW_EMPTY :\n $validator = new Miqo_Validation_AlnumAllowEmpty();\n break;\n case self::REGEX:\n $validator = new Zend_Validate_Regex($mergedOptions['pattern']);\n break;\n case self::DB_NO_RECORD_EXISTS: \n $validator = new Zend_Validate_Db_NoRecordExists($mergedOptions['table'], $mergedOptions['field']); \n break;\n case self::DIGITS :\n $validator = new Zend_Validate_Digits();\n break; \n case self::DIGITS_ALLOW_EMPTY :\n $validator = new Miqo_Validation_DigitsAllowEmpty();\n break;\n case self::FLOAT :\n \t$validator = new Zend_Validate_Float();\n \tbreak;\n \tcase self::FLOAT_ALLOW_EMPTY :\n \t\t$validator = new Miqo_Validation_FloatAllowEmpty();\n \t\tbreak;\n case self::PASSWORD:\n $validator = new Miqo_Validation_Password();\n break;\n case self::DATE_GREATER_THAN_OR_EQUAL:\n $validator = new Miqo_Validation_Date_GreaterThanOrEqual($mergedOptions['minDate']);\n break;\n case self::UPLOADED:\n $validator = new Miqo_Validation_Uploaded();\n break;\n default: \n $validatorName = 'Zend_Validate_'.$validatorName;\n $validator = new $validatorName($mergedOptions['table']);\n break;\n }\n $this->validators [$key] = $validator;\n }\n $validator = $this->validators [$key];\n\n if ($validatorName != self::DB_NO_RECORD_EXISTS){\n foreach ($options as $key => $value){\n $methodSet = 'set'.ucfirst($key);\n $validator->$methodSet($value);\n }\n } \n return $validator;\n }", "public static function register(string $name, Validator $validator) {\n if(array_key_exists($name, self::$validators)) {\n throw new InvalidArgumentException(\"Validator '\".$name.\"' already existst\");\n }\n self::$validators[$name] = $validator;\n }", "public function buildValidator(EventInterface $event, Validator $validator, string $name)\n {\n foreach ((array)$this->getConfig('displayField') as $field) {\n if (strpos($field, '.') === false) {\n $validator->requirePresence($field, 'create')\n ->notEmptyString($field);\n }\n }\n }", "public function addPreValidator(ValidatorInterface $validator, $name = '*')\n {\n $this->hooks[$name][self::PRE_ARGUMENT_VALIDATOR][] = $validator;\n return $this;\n }", "public\n function buildValidator(Event $event, Validator $validator, string $name) {\n\n if ($this->manager) {\n $this->manager->validation($validator);\n }\n }", "protected function addName()\n {\n $this->add(array(\n 'name' => 'name',\n 'required' => true,\n 'validators' => array(\n array(\n 'name' => 'Zend\\Validator\\StringLength',\n 'options' => array(\n 'min' => 4,\n 'max' => 128,\n ),\n ),\n ),\n 'filters' => array(\n array('name' => 'Zend\\Filter\\HtmlEntities'),\n array('name' => 'Zend\\Filter\\StringTrim'),\n array('name' => 'Zend\\Filter\\StripTags'),\n ),\n ));\n \n return $this;\n }", "public function injectValidator(\\Symfony\\Component\\Validator\\ValidatorInterface $filterValidator) {\n\t\t$this->filterValidator = $filterValidator;\n\t}", "protected function createValidator() {\n return $this->validator;\n }", "public function getValidatorService();", "abstract public function getFilterName();", "protected function getValidatorTitle()\n {\n }", "private function createValidator()\n {\n // add custom validation rules\n \\Validator::extend('contains_caps',\n function($field, $value, $params)\n {\n return preg_match('#[A-Z]#', $value);\n }\n );\n\n \\Validator::extend('contains_digit',\n function($field, $value, $params)\n {\n return preg_match('#[0-9]#', $value);\n }\n );\n\n // set array of messages for custom rules\n $messages = array(\n 'contains_caps' => ':attribute must contain at least one capital letter.',\n 'contains_digit' => ':attribute must contain at least one numeric digit.'\n );\n\n // set array of rules to use for validation (many are Laravel's built-ins)\n $rules = array(\n 'email' => 'required|email|max:255',\n 'password' => 'required|between:8,50|contains_caps|contains_digit', // password has some \"strength\" requirements\n 'first_name' => 'required|max:50',\n 'last_name' => 'required|max:50',\n 'city' => 'required|max:100',\n 'state' => 'required|max:2',\n 'zip' => 'required|max:20',\n 'biography' => 'required',\n );\n\n $validator = \\Validator::make(\\Input::all(), $rules, $messages);\n\n return $validator;\n }", "public function validator()\n {\n return UserValidator::class;\n }", "public function __construct() {\n //$inputFilter = $this->getInputFilter(); \n\n // Add input for \"nombre\" field\n $this->add([\n 'name' => 'nombre',\n 'required' => true,\n 'filters' => [\n ['name' => 'StringTrim'], \n ], \n 'validators' => [\n [\n 'name' => 'StringLength',\n 'options' => [\n 'min' => 1,\n 'max' => 128\n ],\n ], \n ],\n ]); \n \n $this->add([\n 'name' => 'rut',\n 'required' => true,\n 'filters' => [\n ['name' => 'StringTrim'], \n ], \n 'validators' => [\n [\n 'name' => 'StringLength',\n 'options' => [\n 'min' => 1,\n 'max' => 128\n ],\n ], \n ],\n ]);\n }", "public function validator()\n {\n\n return BabyInfoValidator::class;\n }", "final public static function register()\n {\n $ruleName = self::getRuleName();\n ValidatorValidator::extend($ruleName, static::class . '@performValidation');\n\n if (method_exists(static::class, 'replacer')) {\n ValidatorValidator::replacer($ruleName, static::class . '@replacer');\n }\n }", "public function addValidator(ValidatorInterface $validator, $name = '*')\n {\n $this->hooks[$name][self::ARGUMENT_VALIDATOR][] = $validator;\n return $this;\n }", "public function validator()\n {\n }", "public function validator()\n {\n\n return UserValidator::class;\n }", "public function validator()\n {\n\n return UserValidator::class;\n }", "public function validator()\n {\n\n return UserValidator::class;\n }", "public function validator()\n {\n\n return UserValidator::class;\n }", "public function validator()\n {\n\n return UserValidator::class;\n }", "protected function getValidatorInstance()\n {\n $validator = parent::getValidatorInstance();\n $validator->setAttributeNames(trans('mconsole::personal.form'));\n\n return $validator;\n }", "public static function __callStatic(string $ruleName, array $arguments): ValidatorInterface;", "protected function addFilter($name, $response = null)\n\t{\n\t\t$me = $this;\n\t\t$this->router->addFilter('validator.'.$name, function() use ($me, $name, $response) \n\t\t{\n\t\t\t$validator = $me->make($name);\n\n\t\t\tif ($validator->fails())\n\t\t\t{\n\t\t\t\tif (is_null($response))\n\t\t\t\t{\n\t\t\t\t\t$response = $validator->filterFailResponse();\n\t\t\t\t}\n\n\t\t\t\tif ($response instanceof Closure)\n\t\t\t\t{\n\t\t\t\t\treturn call_user_func($response);\n\t\t\t\t}\n\n\t\t\t\treturn $response;\n\t\t\t}\n\n\t\t\t$me->addFilterInput($name, $validator->getInput());\n\t\t});\n\t}", "public function getCreateFormFilter()\n\t{\n\n\t\t$inputFilter = new InputFilter\\InputFilter();\n\t\t$factory = new InputFilter\\Factory();\n\n\t\t# filter and validate username input field\n\t\t$inputFilter->add(\n\t\t\t$factory->createInput(\n\t\t\t\t[\n\t\t\t\t\t'name' => 'username',\n\t\t\t\t\t'required' => true,\n\t\t\t\t\t'filters' => [\n\t\t\t\t\t\t['name' => Filter\\StripTags::class], # stips html tags\n\t\t\t\t\t\t['name' => Filter\\StringTrim::class], # removes empty spaces\n\t\t\t\t\t\t['name' => I18n\\Filter\\Alnum::class], # allows only [a-zA-Z0-9] characters\n\t\t\t\t\t],\n\t\t\t\t\t'validators' => [\n\t\t\t\t\t\t['name' => Validator\\NotEmpty::class],\n\t\t\t\t\t\t[\n\t\t\t\t\t\t\t'name' => Validator\\StringLength::class,\n\t\t\t\t\t\t\t'options' => [\n\t\t\t\t\t\t\t\t'min' => 2,\n\t\t\t\t\t\t\t\t'max' => 25,\n\t\t\t\t\t\t\t\t'messages' => [\n\t\t\t\t\t\t\t\t\tValidator\\StringLength::TOO_SHORT => 'Tên người dùng phải có ít nhất 2 ký tự',\n\t\t\t\t\t\t\t\t\tValidator\\StringLength::TOO_LONG => 'Tên người dùng phải có tối đa 25 ký tự',\n\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t],\n\t\t\t\t\t\t], \n\t\t\t\t\t\t[\n\t\t\t\t\t\t\t'name' => I18n\\Validator\\Alnum::class,\n\t\t\t\t\t\t\t'options' => [\n\t\t\t\t\t\t\t\t'messages' => [\n\t\t\t\t\t\t\t\t\tI18n\\Validator\\Alnum::NOT_ALNUM => 'Tên người dùng chỉ được bao gồm các ký tự chữ và số',\n\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t],\n\t\t\t\t\t\t],\n\t\t\t\t\t\t[\n\t\t\t\t\t\t\t'name' => Validator\\Db\\NoRecordExists::class,\n\t\t\t\t\t\t\t'options' => [\n\t\t\t\t\t\t\t\t'table' => $this->table, \n\t\t\t\t\t\t\t\t'field' => 'username',\n\t\t\t\t\t\t\t\t'adapter' => $this->adapter,\n\t\t\t\t\t\t\t],\n\t\t\t\t\t\t],\n\t\t\t\t\t],\n\t\t\t\t]\n\t\t\t)\n\t\t);\n\t\t# filter and validate gender select field\n\t\t$inputFilter->add(\n\t\t\t$factory->createInput(\n\t\t\t\t[\n\t\t\t\t\t'name' => 'gender',\n\t\t\t\t\t'required' => true,\n\t\t\t\t\t'filters' => [\n\t\t\t\t\t\t['name' => Filter\\StripTags::class], # stips html tags\n\t\t\t\t\t\t['name' => Filter\\StringTrim::class], # removes empty spaces\n\t\t\t\t\t],\n\t\t\t\t\t'validators' => [\n\t\t\t\t\t\t['name' => Validator\\NotEmpty::class], \n\t\t\t\t\t\t[\n\t\t\t\t\t\t\t'name' => Validator\\InArray::class,\n\t\t\t\t\t\t\t'options' => [\n\t\t\t\t\t\t\t\t'haystack' => ['Female', 'Male', 'Other'],\n\t\t\t\t\t\t\t],\n\t\t\t\t\t\t],\n\t\t\t\t\t],\n\t\t\t\t]\n\t\t\t)\n\t\t);\n\t\t# filter and validate email input field\n\t\t$inputFilter->add(\n\t\t\t$factory->createInput(\n\t\t\t\t[\n\t\t\t\t\t'name' => 'email',\n\t\t\t\t\t'required' => true,\n\t\t\t\t\t'filters' => [\n\t\t\t\t\t\t['name' => Filter\\StripTags::class],\n\t\t\t\t\t\t['name' => Filter\\StringTrim::class], \n\t\t\t\t\t\t#['name' => Filter\\StringToLower::class], comment this line out\n\t\t\t\t\t],\n\t\t\t\t\t'validators' => [\n\t\t\t\t\t\t['name' => Validator\\NotEmpty::class],\n\t\t\t\t\t\t['name' => Validator\\EmailAddress::class],\n\t\t\t\t\t\t[\n\t\t\t\t\t\t\t'name' => Validator\\StringLength::class,\n\t\t\t\t\t\t\t'options' => [\n\t\t\t\t\t\t\t\t'min' => 6,\n\t\t\t\t\t\t\t\t'max' => 128,\n\t\t\t\t\t\t\t\t'messages' => [\n\t\t\t\t\t\t\t\t\tValidator\\StringLength::TOO_SHORT => 'Địa chỉ email phải có ít nhất 6 ký tự',\n\t\t\t\t\t\t\t\t\tValidator\\StringLength::TOO_LONG => 'Địa chỉ email phải có tối đa 128 ký tự',\n\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t],\n\t\t\t\t\t\t],\n\t\t\t\t\t\t[\n\t\t\t\t\t\t\t'name' => Validator\\Db\\NoRecordExists::class,\n\t\t\t\t\t\t\t'options' => [\n\t\t\t\t\t\t\t\t'table' => $this->table,\n\t\t\t\t\t\t\t\t'field' => 'email',\n\t\t\t\t\t\t\t\t'adapter' => $this->adapter,\n\t\t\t\t\t\t\t],\n\t\t\t\t\t\t],\n\t\t\t\t\t],\n\t\t\t\t]\n\t\t\t)\n\t\t);\n\n\t\t# filter and validate confirm_email input field\n\t\t$inputFilter->add(\n\t\t\t$factory->createInput(\n\t\t\t\t[\n\t\t\t\t\t'name' => 'confirm_email',\n\t\t\t\t\t'required' => true,\n\t\t\t\t\t'filters' => [\n\t\t\t\t\t\t['name' => Filter\\StripTags::class], # stips html tags\n\t\t\t\t\t\t['name' => Filter\\StringTrim::class], # removes empty spaces\n\t\t\t\t\t\t#['name' => Filter\\StringToLower::class], as well as this one\n\t\t\t\t\t],\n\t\t\t\t\t'validators' => [\n\t\t\t\t\t\t['name' => Validator\\NotEmpty::class],\n\t\t\t\t\t\t['name' => Validator\\EmailAddress::class],\n\t\t\t\t\t\t[\n\t\t\t\t\t\t\t'name' => Validator\\StringLength::class,\n\t\t\t\t\t\t\t'options' => [\n\t\t\t\t\t\t\t\t'min' => 6,\n\t\t\t\t\t\t\t\t'max' => 128,\n\t\t\t\t\t\t\t\t'messages' => [\n\t\t\t\t\t\t\t\t\tValidator\\StringLength::TOO_SHORT => 'Địa chỉ email phải có ít nhất 6 ký tự',\n\t\t\t\t\t\t\t\t\tValidator\\StringLength::TOO_LONG => 'Địa chỉ email phải có tối đa 128 ký tự',\n\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t],\n\t\t\t\t\t\t],\n\t\t\t\t\t\t[\n\t\t\t\t\t\t\t'name' => Validator\\Db\\NoRecordExists::class,\n\t\t\t\t\t\t\t'options' => [\n\t\t\t\t\t\t\t\t'table' => $this->table,\n\t\t\t\t\t\t\t\t'field' => 'email',\n\t\t\t\t\t\t\t\t'adapter' => $this->adapter,\n\t\t\t\t\t\t\t],\n\t\t\t\t\t\t],\n\t\t\t\t\t\t[\n\t\t\t\t\t\t\t'name' => Validator\\Identical::class,\n\t\t\t\t\t\t\t'options' => [\n\t\t\t\t\t\t\t\t'token' => 'email', # field to compare against\n\t\t\t\t\t\t\t\t'messages' => [ \n\t\t\t\t\t\t\t\t\tValidator\\Identical::NOT_SAME => 'Email không trùng!',\n\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t],\n\t\t\t\t\t\t],\n\t\t\t\t\t],\n\t\t\t\t]\n\t\t\t)\n\t\t);\n\n\t\t# filter and validate birthday dateselect field\n\t\t$inputFilter->add(\n\t\t\t$factory->createInput(\n\t\t\t\t[\n\t\t\t\t\t'name' => 'birthday',\n\t\t\t\t\t'required' => true,\n\t\t\t\t\t'filters' => [\n\t\t\t\t\t\t['name' => Filter\\StripTags::class], # stips html tags\n\t\t\t\t\t\t['name' => Filter\\StringTrim::class], # removes empty spaces\n\t\t\t\t\t],\n\t\t\t\t\t'validators' => [\n\t\t\t\t\t\t['name' => Validator\\NotEmpty::class],\n\t\t\t\t\t\t[\n\t\t\t\t\t\t\t'name' => Validator\\Date::class,\n\t\t\t\t\t\t\t'options' => [\n\t\t\t\t\t\t\t\t'format' => 'Y-m-d',\n\t\t\t\t\t\t\t],\n\t\t\t\t\t\t],\n\t\t\t\t\t],\t\n\t\t\t\t]\n\t\t\t)\n\t\t);\n\t\t# filter and validate password input field\n\t\t$inputFilter->add(\n\t\t\t$factory->createInput(\n\t\t\t\t[\n\t\t\t\t\t'name' => 'password',\n\t\t\t\t\t'required' => true,\n\t\t\t\t\t'filters' => [\n\t\t\t\t\t\t['name' => Filter\\StripTags::class], # stips html tags\n\t\t\t\t\t\t['name' => Filter\\StringTrim::class], # removes empty spaces\n\t\t\t\t\t],\n\t\t\t\t\t'validators' => [\n\t\t\t\t\t\t['name' => Validator\\NotEmpty::class],\n\t\t\t\t\t\t[\n\t\t\t\t\t\t\t'name' => Validator\\StringLength::class,\n\t\t\t\t\t\t\t'options' => [\n\t\t\t\t\t\t\t\t'min' => 8,\n\t\t\t\t\t\t\t\t'max' => 25,\n\t\t\t\t\t\t\t\t'messages' => [\n\t\t\t\t\t\t\t\t\tValidator\\StringLength::TOO_SHORT => 'Mật khẩu phải có ít nhất 8 ký tự',\n\t\t\t\t\t\t\t\t\tValidator\\StringLength::TOO_LONG => 'Mật khẩu phải có nhiều nhất 25 ký tự',\n\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t],\n\t\t\t\t\t\t],\n\t\t\t\t\t],\n\t\t\t\t]\n\t\t\t)\n\t\t);\n\n\t\t# filter and validate confirm_password field\n\t\t$inputFilter->add(\n\t\t\t$factory->createInput(\n\t\t\t\t[\n\t\t\t\t\t'name' => 'confirm_password',\n\t\t\t\t\t'required' => true,\n\t\t\t\t\t'filters' => [\n\t\t\t\t\t\t['name' => Filter\\StripTags::class], # stips html tags\n\t\t\t\t\t\t['name' => Filter\\StringTrim::class], # removes empty spaces\n\t\t\t\t\t],\n\t\t\t\t\t'validators' => [\n\t\t\t\t\t\t['name' => Validator\\NotEmpty::class], \n\t\t\t\t\t\t[\n\t\t\t\t\t\t\t'name' => Validator\\StringLength::class,\n\t\t\t\t\t\t\t'options' => [\n\t\t\t\t\t\t\t\t'min' => 8,\n\t\t\t\t\t\t\t\t'max' => 25,\n\t\t\t\t\t\t\t\t'messages' => [\n\t\t\t\t\t\t\t\t\tValidator\\StringLength::TOO_SHORT => 'Mật khẩu phải có ít nhất 8 ký tự',\n\t\t\t\t\t\t\t\t\tValidator\\StringLength::TOO_LONG => 'Mật khẩu phải có nhiều nhất 25 ký tự',\n\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t],\n\t\t\t\t\t\t],\n\t\t\t\t\t\t[\n\t\t\t\t\t\t\t'name' => Validator\\Identical::class,\n\t\t\t\t\t\t\t'options' => [\n\t\t\t\t\t\t\t\t'token' => 'password',\n\t\t\t\t\t\t\t\t'messages' => [\n\t\t\t\t\t\t\t\t\tValidator\\Identical::NOT_SAME => 'Mật khẩu không hợp lệ!',\n\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t],\n\t\t\t\t\t\t],\n\t\t\t\t\t],\n\t\t\t\t]\n\t\t\t)\n\t\t);\t\n\t\t# csrf field\n\t\t$inputFilter->add(\n\t\t\t$factory->createInput(\n\t\t\t\t[\n\t\t\t\t\t'name' => 'csrf',\n\t\t\t\t\t'required' => true,\n\t\t\t\t\t'filters' => [\n\t\t\t\t\t\t['name' => Filter\\StripTags::class], # stips html tags\n\t\t\t\t\t\t['name' => Filter\\StringTrim::class], # removes empty spaces\n\t\t\t\t\t],\n\t\t\t\t\t'validators' => [\n\t\t\t\t\t\t['name' => Validator\\NotEmpty::class],\n\t\t\t\t\t\t[\n\t\t\t\t\t\t\t'name' => Validator\\Csrf::class,\n\t\t\t\t\t\t\t'options' => [\n\t\t\t\t\t\t\t\t'messages' => [\n\t\t\t\t\t\t\t\t\tValidator\\Csrf::NOT_SAME => 'Oops! Hãy điền vào nào.',\n\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t],\n\t\t\t\t\t\t],\n\t\t\t\t\t],\n\t\t\t\t]\n\t\t\t)\n\t\t);\n\n\t\treturn $inputFilter;\t\n\t}", "protected function getRouteNameFilter()\n {\n if ($this->routeNameFilter instanceof FilterChain) {\n return $this->routeNameFilter;\n }\n\n $this->routeNameFilter = new FilterChain();\n $this->routeNameFilter->attachByName('WordCamelCaseToDash')\n ->attachByName('StringToLower');\n return $this->routeNameFilter;\n }", "private function addInputFilter() \n {\n // Create main input filter\n $inputFilter = new InputFilter(); \n $this->setInputFilter($inputFilter);\n \n // Add input for \"email\" field\n $inputFilter->add([\n 'name' => 'title',\n 'required' => true,\n 'filters' => [\n ['name' => 'StringTrim'], \n ], \n 'validators' => [\n [\n 'name' => 'StringLength',\n 'options' => [\n 'min' => 1,\n 'max' => 128\n ],\n ],\n \n \n ],\n ]); \n\n\n \n // Add input for \"status\" field\n $inputFilter->add([\n 'name' => 'status',\n 'required' => true,\n 'filters' => [ \n ['name' => 'ToInt'],\n ], \n 'validators' => [\n ['name'=>'InArray', 'options'=>['haystack'=>[1, 2]]]\n ],\n ]); \n }", "public function __construct($inName, $inIsMandatory=true, $inCanBeNull=true, callable $inValidator=null) {\n $this->__name = $inName;\n $this->__isMandatory = $inIsMandatory;\n $this->__isNullAllowed = $inCanBeNull;\n $this->__validator = $inValidator;\n }", "public function __call(string $ruleName, array $arguments): ValidatorInterface;", "public function createFilter();", "public function validator(){\n\t\t$this->runValidation(new ReqValidator($this, ['field'=>'material_name', 'msg' => 'Material name is required.']));\n\t\t$this->runValidation(new MaxValidator($this, ['field'=>'material_name', 'rule'=>60, 'msg' => 'Material name must be less than 60 characters']));\n\t\t$this->runValidation(new AlphaNumValidator($this, ['field'=>'material_name', 'msg' => 'Material name can only contain letters, numbers and spaces']));\n\t}", "public function getFilter(string $name);", "public function registerValidator ($name, $validator, $parent = null)\n {\n\n if ($parent != null)\n {\n\n // this parameter has a parent\n $this->names[$parent][$name]['validators'][] = $validator;\n\n } else\n {\n\n // no parent\n $this->names[$name]['validators'][] = $validator;\n\n }\n\n }", "public function validator()\n {\n\n return EmpreValidator::class;\n }", "public function __construct(Validator $validator)\n {\n $this->validator = $validator;\n }", "protected function getValidationFactory()\n {\n return app('validator');\n }", "function nameValidator() {\n\t\tglobal $firstname;\n\t\treturn ctype_alpha($firstname);\n\t}", "public function validator()\n {\n\n return AvaliacoeValidator::class;\n }", "public static function validators() {\n return [\n 'status' => 'validateStatus',\n 'quota' => 'validateQuota'\n ];\n }", "public function validateFilter(): ValidateFilterRequestBuilder {\n return new ValidateFilterRequestBuilder($this->pathParameters, $this->requestAdapter);\n }", "public static function getFiltername(): string\n {\n return self::FILTERNAME;\n }", "private function _createNameField()\n {\n $name = new Zend_Form_Element_Text('name');\n $name->setLabel('bankName')\n ->addFilter(new Zend_Filter_StringTrim())\n ->addFilter(new Zend_Filter_StripTags())\n ->addValidator(new Zend_Validate_StringLength(array(2, 60)))\n ->setRequired();\n\n return $name;\n }", "public function validator()\n {\n return ZhuanTiValidator::class;\n }", "public function addValidator(BLW_PSP_Validator $validator);", "public function setValidator($validator)\n {\n $this->validator = $validator;\n }", "public function validator()\n {\n\n return ProvidersValidator::class;\n }", "private function addInputFilter() \n {\n \n $inputFilter = new InputFilter(); \n $this->setInputFilter($inputFilter);\n \n $inputFilter->add([\n 'name' => 'nom_parent',\n 'required' => true,\n 'filters' => [\n ['name' => 'StringTrim'],\n ['name' => 'StripTags'],\n ['name' => 'StripNewlines'],\n ], \n 'validators' => [\n [\n 'name' => 'StringLength',\n 'options' => [\n 'min' => 2,\n 'max' => 100\n ],\n ],\n ],\n ]);\n \n $inputFilter->add([\n 'name' => 'prenom_parent',\n 'required' => true,\n 'filters' => [\n ['name' => 'StringTrim'],\n ['name' => 'StripTags'],\n ['name' => 'StripNewlines'],\n ], \n 'validators' => [\n [\n 'name' => 'StringLength',\n 'options' => [\n 'min' => 2,\n 'max' => 100\n ],\n ],\n ],\n ]);\n \n $inputFilter->add([\n 'name' => 'email_parent',\n 'required' => true,\n 'filters' => [\n ['name' => 'StringTrim'], \n ], \n 'validators' => [\n [\n 'name' => 'EmailAddress',\n 'options' => [\n 'allow' => \\Zend\\Validator\\Hostname::ALLOW_DNS,\n 'useMxCheck' => false, \n ],\n ],\n ],\n ]);\n \n }", "public function validator()\n {\n\n return AudioValidator::class;\n }", "protected function getValidatorInstance()\n {\n return app(ValidationFactory::class);\n }", "public function validator()\n {\n\n return TaxrateValidator::class;\n }", "public function validator()\n {\n\n return ProducerValidator::class;\n }", "public function add(Validators $validator);", "public function getValidators() {}", "public function validator()\n {\n\n return TipoContratoValidator::class;\n }", "protected function getValidatorInstance()\n {\n // cause comes json, we need to change it to array to validate it\n $this->request->set('categories_names', json_decode($this->input()['categories_names'], true));\n // clean alias from unnecessary symbols\n $this->request->set('category_alias', Helpers::cleanToOnlyLettersNumbers($this->input()['category_alias']));\n\n return parent::getValidatorInstance();\n }", "public function validator()\n {\n\n return AnggotaKeluargaValidator::class;\n }", "abstract function validator();", "public function getInputFilter() {\n\n if (!$this->inputFilter) {\n\n $inputFilter = new InputFilter();\n $factory = new Factory();\n\n $inputFilter->add($factory->createInput(array(\n 'name' => 'id',\n 'required' => true,\n 'filter' => array(\n array('name' => 'Int')\n )\n )\n )\n );\n\n $inputFilter->add($factory->createInput(array(\n 'name' => 'username',\n 'required' => true,\n 'filters' => array(\n array('name' => 'StripTags'),\n array('name' => 'StringTrim'),\n ),\n 'validators' => array(\n array(\n 'name' => 'StringLength',\n 'options' => array(\n 'encoding' => 'UTF-8',\n 'min' => 1,\n 'max' => 100,\n ),\n ),\n )\n )\n )\n );\n\n $inputFilter->add($factory->createInput(array(\n 'name' => 'name',\n 'required' => true,\n 'filters' => array(\n array('name' => 'StripTags'),\n array('name' => 'StringTrim'),\n ),\n 'validators' => array(\n array(\n 'name' => 'StringLength',\n 'options' => array(\n 'encoding' => 'UTF-8',\n 'min' => 1,\n 'max' => 100,\n ),\n ),\n )\n )\n )\n );\n\n $inputFilter->add($factory->createInput(array(\n 'name' => 'token',\n 'required' => false,\n 'validators' => array(\n array(\n 'name' => 'StringLength',\n 'options' => array(\n 'encoding' => 'UTF-8',\n 'min' => 1,\n 'max' => 100,\n ),\n ),\n )\n )\n )\n );\n\n $this->inputFilter = $inputFilter;\n }\n\n return $this->inputFilter;\n }", "public static function validators() {\n return [\n 'status' => 'validateStatus',\n 'time' => 'validateTime'\n ];\n }", "private function addInputFilter() \n {\n // Create main input filter\n \n //$inputFilter = new InputFilter(); \n \n $inputFilter = $this->getInputFilter(); \n $this->setInputFilter($inputFilter);\n \n // Add input for \"usuario\" field\n $inputFilter->add([\n 'name' => 'nombre',\n 'required' => true,\n 'filters' => [ \n ['name' => 'StringTrim'],\n ], \n 'validators' => [\n [\n 'name' => 'StringLength',\n 'options' => [\n 'min' => 1,\n 'max' => 512\n ],\n ],\n ],\n ]);\n \n // Add input for \"telefono\" field\n $inputFilter->add([\n 'name' => 'telefono',\n 'required' => false,\n 'filters' => [ \n ['name' => 'StringTrim'],\n ], \n 'validators' => [\n [\n 'name' => 'StringLength',\n 'options' => [\n 'min' => 1,\n 'max' => 512\n ],\n ],\n ],\n ]);\n \n // Add input for \"email\" field\n $inputFilter->add([\n 'name' => 'email',\n 'required' => false,\n 'filters' => [ \n ['name' => 'StringTrim'],\n ], \n 'validators' => [\n [\n 'name' => 'StringLength',\n 'options' => [\n 'min' => 1,\n 'max' => 512\n ],\n ],\n ],\n ]);\n \n // Add input for \"email\" field\n $inputFilter->add([\n 'name' => 'skype',\n 'required' => false,\n 'filters' => [ \n ['name' => 'StringTrim'],\n ], \n 'validators' => [\n [\n 'name' => 'StringLength',\n 'options' => [\n 'min' => 1,\n 'max' => 512\n ],\n ],\n ],\n ]);\n \n }", "protected function getValidator(): void\n {\n // TODO: Implement getValidator() method.\n }", "public static function validateName()\n\t{\n\t\treturn array(\n\t\t\tnew Main\\Entity\\Validator\\Length(null, 255),\n\t\t);\n\t}", "public function makeValidator()\r\n {\r\n if (10 == $this->countDigits($this->string)) {\r\n return new Validator10($this->string);\r\n }\r\n\r\n if (13 == $this->countDigits($this->string)) {\r\n return new Validator13($this->string);\r\n } \r\n }", "public function setupValidatorRules()\n { }", "protected function buildModuleNameValidator()\n {\n $this->validator = Validator::getService();\n $contraintBuilder = new ConstraintBuilder();\n $this->moduleNameConstraints = $contraintBuilder->build(['Assert\\Bean\\ModuleName',]);\n }", "protected static function getFacadeAccessor() { return 'input_validator'; }", "public function withValidator($validator) {\n $validator->after(function($validator) {\n $inputs = Input::all();\n\n // further validation of first name\n if(isset($inputs['first_name']) && !empty($inputs['first_name'])) {\n if(!preg_match('/(^[a-zA-Z ]+$)/', $inputs['first_name'])\n || preg_match('/( {2,})/', $inputs['first_name'])\n || strlen($inputs['first_name']) <= 2\n || strlen($inputs['first_name']) > 75) {\n $validator->errors()->add('first_name', 'First name is invalid.');\n }\n }\n\n if(isset($inputs['middle_name']) && !empty($inputs['middle_name'])) {\n if(!preg_match('/(^[a-zA-Z ]+$)/', $inputs['middle_name'])\n || preg_match('/( {2,})/', $inputs['middle_name'])\n || strlen($inputs['middle_name']) <= 2\n || strlen($inputs['middle_name']) > 75) {\n $validator->errors()->add('middle_name', 'Middle name is invalid.');\n }\n }\n\n if(isset($inputs['surname']) && !empty($inputs['surname'])) {\n if(!preg_match('/(^[a-zA-Z ]+$)/', $inputs['surname'])\n || preg_match('/( {2,})/', $inputs['surname'])\n || strlen($inputs['surname']) <= 2\n || strlen($inputs['surname']) > 75) {\n $validator->errors()->add('surname', 'Surname is invalid.');\n }\n }\n });\n }", "public function validator()\n {\n\n return PescariaValidator::class;\n }", "public static function validateName()\n {\n return array(\n new Main\\Entity\\Validator\\Length(null, 255),\n );\n }", "public function validator()\n {\n return $this->validator;\n }", "public function addValidators() {\n\t\t$this->getElement('username')->addValidators(array(array('isUnique', true, array('options' => array('table' => 'Users', 'field' => 'username', 'match' => 'id', 'key' => $this->_account['id']), 'messages' => array('notUnique' => 'User name is used.')))));\n\t\t$this->getElement('screenname')->addValidators(array(array('isUnique', true, array('options' => array('table' => 'Users', 'field' => 'screenname', 'match' => 'id', 'key' => $this->_account['id']), 'messages' => array('notUnique' => 'Screen name is used.')))));\n\t\t$this->getElement('authenticatepassword')->addValidators(array(array('Password', true, array('options' => array('id' => $this->_user->id)))));\n\t}", "public function validator()\n {\n\n return DistribuidorValidator::class;\n }", "public function validator()\n {\n\n return OrderItemValidator::class;\n }", "public function validator()\n {\n return LanguageValidator::class;\n }", "public function validator()\n {\n\n return CategoriesValidator::class;\n }", "public static function setValidator(Factory $validator)\n {\n static::$validator = $validator;\n }", "function getJsValidatorName($name) \n{\t\n\tswitch ($name) \n\t{\n\t\tcase \"Number\":\n\t\t\treturn \"IsNumeric\";\n\t\t\tbreak;\n\t\tcase \"Password\":\n\t\t\treturn \"IsPassword\";\n\t\t\tbreak;\n\t\tcase \"Email\":\n\t\t\treturn \"IsEmail\";\n\t\t\tbreak;\n\t\tcase \"Currency\":\n\t\t\treturn \"IsMoney\";\n\t\t\tbreak;\n\t\tcase \"US ZIP Code\":\n\t\t\treturn \"IsZipCode\";\n\t\t\tbreak;\n\t\tcase \"US Phone Number\":\n\t\t\treturn \"IsPhoneNumber\";\n\t\t\tbreak;\n\t\tcase \"US State\":\n\t\t\treturn \"IsState\";\n\t\t\tbreak;\n\t\tcase \"US SSN\":\n\t\t\treturn \"IsSSN\";\n\t\t\tbreak;\n\t\tcase \"Credit Card\":\n\t\t\treturn \"IsCC\";\n\t\t\tbreak;\n\t\tcase \"Time\":\n\t\t\treturn \"IsTime\";\n\t\t\tbreak;\n\t\tcase \"Regular expression\":\n\t\t\treturn \"RegExp\";\n\t\t\tbreak;\t\t\t\t\t\t\n\t\tdefault:\n\t\t\treturn $name;\n\t\t\tbreak;\n\t}\n}", "protected function getValidator($name, $options, $message)\n {\n $name = strtolower($name);\n $validator = '\\\\Best\\\\Driver\\\\Validator\\\\' . ucfirst($name);\n return new $validator($options, $message);\n }", "public function __construct(Factory $validator)\r\n {\r\n $this->validator = $validator;\r\n }", "public function createValidator()\n {\n $validator = Validation::createValidatorBuilder()\n ->setMetadataFactory(new ClassMetadataFactory(new StaticMethodLoader()))\n ->setConstraintValidatorFactory(new ConstraintValidatorFactory($this->app))\n ->setTranslator($this->getTranslator())\n ->setApiVersion(Validation::API_VERSION_2_5)\n ->getValidator();\n\n return $validator;\n }", "public function validator()\n {\n\n return FormInfoValidator::class;\n }", "private function getValidator()\n {\n $v = new Validator();\n $v->addRules([\n ['label', 'Label', 'required'],\n ['num_value', 'Number', 'exists type=number'],\n ['comment', 'Comment', 'exists'],\n ]);\n return $v;\n }", "public function validator()\n {\n\n return DateValidator::class;\n }", "public function validator()\n {\n return NewsValidator::class;\n }", "public function validator()\n {\n\n return WhitelistedNumberValidator::class;\n }", "public function getValidators();", "public function getValidators();", "public function getValidators();", "public function validator()\n {\n\n return PermissionValidator::class;\n }", "public function setValidator($validator)\n {\n $this->validator = $validator;\n return $this;\n }", "public function addValidator(callable $callable, $name)\n {\n $name = trim($name);\n $this->validators[$name] = $callable;\n\n return $this;\n }" ]
[ "0.656694", "0.6196173", "0.6177232", "0.6177232", "0.6109914", "0.6099648", "0.5952478", "0.59322363", "0.5916034", "0.5892976", "0.5817484", "0.5770571", "0.56635135", "0.56566954", "0.56499285", "0.562276", "0.5605761", "0.5604274", "0.5588422", "0.5522811", "0.55029756", "0.54987735", "0.54894614", "0.5484616", "0.5482358", "0.5472638", "0.5472638", "0.5472638", "0.5472638", "0.5472638", "0.54704547", "0.5459703", "0.5452985", "0.5445487", "0.5438435", "0.54335856", "0.5431131", "0.5422079", "0.5420176", "0.5419894", "0.5417116", "0.5411764", "0.54075897", "0.5397488", "0.539018", "0.5388499", "0.5387833", "0.5386218", "0.53836375", "0.53711516", "0.53641903", "0.5341888", "0.533015", "0.53294355", "0.53282106", "0.5327058", "0.5321052", "0.5312942", "0.530432", "0.5303604", "0.53035814", "0.5294845", "0.5290922", "0.5277148", "0.5276628", "0.5273726", "0.52674305", "0.5262874", "0.5261481", "0.5256788", "0.525189", "0.5248573", "0.52454287", "0.5239742", "0.52322954", "0.52288485", "0.5223765", "0.52117693", "0.52115077", "0.51916164", "0.5178023", "0.5172695", "0.5168534", "0.5168449", "0.51619285", "0.5159982", "0.51599604", "0.5153419", "0.51500314", "0.5145909", "0.51374286", "0.5132664", "0.5128899", "0.5120458", "0.51192576", "0.51192576", "0.51192576", "0.51168066", "0.5105775", "0.5103403" ]
0.59227383
8
Add a filter for an alternative way to validate your application.
protected function addFilter($name, $response = null) { $me = $this; $this->router->addFilter('validator.'.$name, function() use ($me, $name, $response) { $validator = $me->make($name); if ($validator->fails()) { if (is_null($response)) { $response = $validator->filterFailResponse(); } if ($response instanceof Closure) { return call_user_func($response); } return $response; } $me->addFilterInput($name, $validator->getInput()); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function addFilters() {\n\t\t\tadd_filter( 'muut_validate_setting', array( $this, 'validateSettings' ), 10, 2 );\n\t\t}", "private function addInputFilter() \n {\n // Create main input filter\n $inputFilter = new InputFilter(); \n $this->setInputFilter($inputFilter);\n \n // Add input for \"email\" field\n $inputFilter->add([\n 'name' => 'title',\n 'required' => true,\n 'filters' => [\n ['name' => 'StringTrim'], \n ], \n 'validators' => [\n [\n 'name' => 'StringLength',\n 'options' => [\n 'min' => 1,\n 'max' => 128\n ],\n ],\n \n \n ],\n ]); \n\n\n \n // Add input for \"status\" field\n $inputFilter->add([\n 'name' => 'status',\n 'required' => true,\n 'filters' => [ \n ['name' => 'ToInt'],\n ], \n 'validators' => [\n ['name'=>'InArray', 'options'=>['haystack'=>[1, 2]]]\n ],\n ]); \n }", "protected function preValidate()\n {\n $this->setFilter( preg_quote($this->getFilter()) );\n }", "public function setupFilterRules()\n { }", "public function addFilters()\n {\n }", "private function addInputFilter() \n {\n // Create main input filter\n \n //$inputFilter = new InputFilter(); \n \n $inputFilter = $this->getInputFilter(); \n $this->setInputFilter($inputFilter);\n \n // Add input for \"usuario\" field\n $inputFilter->add([\n 'name' => 'nombre',\n 'required' => true,\n 'filters' => [ \n ['name' => 'StringTrim'],\n ], \n 'validators' => [\n [\n 'name' => 'StringLength',\n 'options' => [\n 'min' => 1,\n 'max' => 512\n ],\n ],\n ],\n ]);\n \n // Add input for \"telefono\" field\n $inputFilter->add([\n 'name' => 'telefono',\n 'required' => false,\n 'filters' => [ \n ['name' => 'StringTrim'],\n ], \n 'validators' => [\n [\n 'name' => 'StringLength',\n 'options' => [\n 'min' => 1,\n 'max' => 512\n ],\n ],\n ],\n ]);\n \n // Add input for \"email\" field\n $inputFilter->add([\n 'name' => 'email',\n 'required' => false,\n 'filters' => [ \n ['name' => 'StringTrim'],\n ], \n 'validators' => [\n [\n 'name' => 'StringLength',\n 'options' => [\n 'min' => 1,\n 'max' => 512\n ],\n ],\n ],\n ]);\n \n // Add input for \"email\" field\n $inputFilter->add([\n 'name' => 'skype',\n 'required' => false,\n 'filters' => [ \n ['name' => 'StringTrim'],\n ], \n 'validators' => [\n [\n 'name' => 'StringLength',\n 'options' => [\n 'min' => 1,\n 'max' => 512\n ],\n ],\n ],\n ]);\n \n }", "public function register_filters() {\n\n\t\t}", "function genesisawesome_custom_filters( $filters ) {\n\n\t$filters['email'] = 'sanitize_email';\n\t$filters['integer'] = 'genesisawesome_intval';\n\n\treturn $filters;\n\n}", "private function addInputFilter() \n {\n \n $inputFilter = new InputFilter(); \n $this->setInputFilter($inputFilter);\n \n $inputFilter->add([\n 'name' => 'nom_parent',\n 'required' => true,\n 'filters' => [\n ['name' => 'StringTrim'],\n ['name' => 'StripTags'],\n ['name' => 'StripNewlines'],\n ], \n 'validators' => [\n [\n 'name' => 'StringLength',\n 'options' => [\n 'min' => 2,\n 'max' => 100\n ],\n ],\n ],\n ]);\n \n $inputFilter->add([\n 'name' => 'prenom_parent',\n 'required' => true,\n 'filters' => [\n ['name' => 'StringTrim'],\n ['name' => 'StripTags'],\n ['name' => 'StripNewlines'],\n ], \n 'validators' => [\n [\n 'name' => 'StringLength',\n 'options' => [\n 'min' => 2,\n 'max' => 100\n ],\n ],\n ],\n ]);\n \n $inputFilter->add([\n 'name' => 'email_parent',\n 'required' => true,\n 'filters' => [\n ['name' => 'StringTrim'], \n ], \n 'validators' => [\n [\n 'name' => 'EmailAddress',\n 'options' => [\n 'allow' => \\Zend\\Validator\\Hostname::ALLOW_DNS,\n 'useMxCheck' => false, \n ],\n ],\n ],\n ]);\n \n }", "private function addInputFilter()\n {\n $inputFilter = new InputFilter();\n $this->setInputFilter($inputFilter);\n\n }", "function add_filters()\n {\n }", "function allow_configured_filters() {\n return TRUE;\n }", "private function addInputFilter()\n {\n // Create main input filter\n $inputFilter = $this->getInputFilter();\n\n // Add input for \"latitude\" field\n $inputFilter->add([\n 'name' => 'latitude',\n 'required' => true,\n 'filters' => [\n ['name' => 'StringTrim'],\n ],\n 'validators' => [\n [\n 'name' => 'Float',\n ],\n ],\n ]);\n\n // Add input for \"longitude\" field\n $inputFilter->add([\n 'name' => 'longitude',\n 'required' => true,\n 'filters' => [\n ['name' => 'StringTrim'],\n ],\n 'validators' => [\n [\n 'name' => 'Float',\n ],\n ],\n ]);\n\n\n }", "private function addInputFilter()\n {\n // Create main input filter\n $inputFilter = new InputFilter();\n $this->setInputFilter($inputFilter);\n\n // Add input for \"pin\" field\n $inputFilter->add([\n 'name' => 'pin',\n 'required' => true,\n 'filters' => [\n ['name' => 'StringTrim'],\n ],\n 'validators' => [\n [\n 'name' => 'StringLength',\n 'options' => [\n 'max' => 14\n ],\n ],\n ],\n ]);\n\n }", "public function addFilter(callable $filter);", "private function addInputFilters()\n {\n $inputFilter = new InputFilter();\n\n $author = (new Input())->setName('author')->setRequired(true);\n $author->getFilterChain()->attach(new StringTrim());\n $author->getValidatorChain()->attach((new StringLength())->setMin(1)->setMax(128));\n $inputFilter->add($author);\n\n $comment = (new Input())->setName('comment')->setRequired(true);\n $comment->getFilterChain()->attach(new StripTags());\n $comment->getValidatorChain()->attach((new StringLength())->setMin(1)->setMax(4096));\n $inputFilter->add($author)->add($comment);\n\n $this->setInputFilter($inputFilter);\n }", "public function filterValidEmailsProvider() {}", "public function beforeFilter() {\n parent::beforeFilter();\n $this->Auth->allow(array('register', 'check_existing_email'));\n }", "function beforeFilter() {\n }", "private function filters() {\n\n\n\t}", "public function validate( $p_filter_input ) {\n\t\treturn true;\n\t}", "public function createFilter();", "function filter_method_name()\r\n\t{\r\n\t\t// TODO:\tDefine your filter method here\r\n\t}", "public function addFilter()\n\t{\n\t\treturn $this->addTextFilter();\n\t}", "public function testFilteringWithBadInputs()\n {\n $sanitizer = new InputFilter();\n $sanitizer->setInputs(array(\n 'field1' => '100abc',\n 'field2' => 'kevin@gmailcom'\n ))\n ->setRequired('field1')\n ->filter('field1', array(\n FILTER_VALIDATE_INT\n ))\n ->setRequired('field2')\n ->filter('field2', array(\n FILTER_VALIDATE_EMAIL\n ), 'Valid email required')\n ->setRequired('field3', 'Field3 is required')\n ->filter('field3', array(\n FILTER_SANITIZE_STRING\n ))\n ->sanitize();\n\n $this->assertTrue($sanitizer->hasErrors());\n $errors = $sanitizer->getErrors();\n\n $this->assertNotEmpty($errors);\n\n $this->assertArrayHasKey('field1', $errors);\n\n $this->assertArrayHasKey('field2', $errors);\n $this->assertEquals('Valid email required', $errors['field2']);\n\n $this->assertArrayHasKey('field3', $errors);\n $this->assertEquals('Field3 is required', $errors['field3']);\n }", "public function filter($filter)\n {\n }", "public function registerFilters() {\n//\t $this->addFilter('get_avatar', ['Chayka\\\\LinkedIn\\\\LinkedInHelper', 'filterGetLinkedInAvatar'], 10, 3);\n\t $this->addFilter('CommentModel.created', ['Chayka\\\\LinkedIn\\\\LinkedInHelper', 'filterMarkCommentWithLinkedInUserId']);\n\t $this->addFilter('pre_comment_approved', ['Chayka\\\\LinkedIn\\\\LinkedInHelper', 'filterApproveLinkedInUserComment'], 10, 2);\n\t\t/* chayka: registerFilters */\n }", "abstract protected function validateFilterArguments($filters);", "public function backendExtraValidate(){\n \n }", "public function badFilter(): void\n {\n throw new RuntimeException('nope');\n }", "function Page_FilterValidated() {\n\n\t\t// Example:\n\t\t//global $MyTable;\n\t\t//$MyTable->MyField1->SearchValue = \"your search criteria\"; // Search value\n\n\t}", "function Page_FilterValidated() {\n\n\t\t// Example:\n\t\t//global $MyTable;\n\t\t//$MyTable->MyField1->SearchValue = \"your search criteria\"; // Search value\n\n\t}", "protected function addValidatorRules()\n {\n Validator::extend('jwt', function ($attribute, $value, $parameters) {\n return (new ValidJWT(Arr::first($parameters)))->passes($attribute, $value);\n });\n }", "function Page_FilterValidated() {\n\n\t\t// Example:\n\t\t//$this->MyField1->SearchValue = \"your search criteria\"; // Search value\n\n\t}", "function Page_FilterValidated() {\n\n\t\t// Example:\n\t\t//$this->MyField1->SearchValue = \"your search criteria\"; // Search value\n\n\t}", "public function setFilter($filter){ }", "public function beforeFilter()\n\t{\n\n\t}", "public function addFilterFormInput(): void;", "public function registerFilterBindings()\n {\n $this->app->bind('LucaDegasperi\\OAuth2Server\\Filters\\OAuthFilter', function ($app) {\n $httpHeadersOnly = $app['config']->get('oauth2-server-laravel::oauth2.http_headers_only');\n\n return new OAuthFilter($httpHeadersOnly);\n });\n }", "public function addFilters() {\n\t\t// $this->subscriber->addFilter( 'mdm_syndication_post_fields', [$this, 'addCustomFields'] );\n\t}", "public function beforeFilter() {\n\t}", "public function beforeFilter() {\n parent::beforeFilter();\n $this->Auth->allow('checkthreshold');\n \n\n }", "function acf_add_deprecated_filter($deprecated, $version, $replacement)\n{\n}", "protected function addFilter ()\n {\n global $database;\n\n if (defined('LEPTON_VERSION')) {\n // register the filter at LEPTON outputInterface\n if (! file_exists(WB_PATH . '/modules/output_interface/output_interface.php')) {\n throw new \\Exception('Missing LEPTON outputInterface, can\\'t register the kitFramework filter - installation is not complete!');\n } else {\n if (! function_exists('register_output_filter'))\n include_once (WB_PATH . '/modules/output_interface/output_interface.php');\n register_output_filter('kit_framework', 'kitFramework');\n }\n }\n elseif (defined('CAT_VERSION')) {\n // register the filter at the blackcatFilter\n require_once CAT_PATH.'/modules/blackcatFilter/filter.php';\n // first unregister to prevent trouble at re-install\n unregister_filter('kitCommands', 'kit_framework');\n // register the filter\n register_filter('kitCommands', 'kit_framework', 'Enable the usage of kitCommands within BlackCat');\n }\n else {\n if (version_compare(WB_VERSION, '2.8.3', '>=')) {\n // WebsiteBaker 2.8.3\n $filter_path = WB_PATH . '/modules/output_filter/index.php';\n } else {\n // all other WebsiteBaker versions\n $filter_path = WB_PATH . '/modules/output_filter/filter-routines.php';\n }\n if (file_exists($filter_path)) {\n if (! $this->websiteBakerIsPatched($filter_path)) {\n if (! $this->websiteBakerDoPatch($filter_path)) {\n throw new \\Exception('Failed to patch the WebsiteBaker output filter, please contact the support!');\n }\n }\n } else {\n throw new \\Exception('Can\\'t detect the correct method to patch the output filter, please contact the support!');\n }\n }\n return true;\n }", "function mustsee_add_url_sanitizer($default_filters) {\n\t$default_filters['url_prepend_http'] = 'mustsee_sanitize_url';\n\treturn $default_filters;\n}", "protected function additionalValidation() {\n return true;\n }", "public function requestFilters()\n\t{\n\t\t$this->services->Common->ajaxCheck();\n\t\t$this->timber->filter->issueDetect();\n\t\t$this->timber->filter->configLibs();\n\t}", "protected function before_filter() {\n\t}", "abstract public function supportsRegexFilters();", "private function loadFilters()\n {\n require __DIR__.'/filters.php';\n }", "public function addValidator()\n {\n $this->app->validator->extendImplicit('recaptcha', function ($attribute, $value, $parameters) {\n $captcha = new Recaptcha();\n return $captcha->validate();\n }, config('Recaptcha.custom_error'));\n }", "function beforeFilter() {\n parent::beforeFilter();\n }", "public function setFilter(string $filter);", "function beforeFilter() {\r\n parent::beforeFilter();\r\n }", "public function filters()\n {\n return [\n \n ];\n }", "public function addFilters()\n {\n foreach (func_get_args() as $filter) {\n if (is_a($filter, 'Rhubarb\\Stem\\Filters\\Filter')) {\n $this->filters[] = $filter;\n } else {\n throw new \\Exception('Non filter object added to Group filter');\n }\n }\n }", "function allow_interactive_filters() {\n return FALSE;\n }", "public function beforeFilter() {\n parent::beforeFilter();\n $this->Auth->allow('view');\n $this->Auth->allow('search');\n }", "public function beforeFilter()\n {\n parent::beforeFilter();\n }", "public function beforeFilter()\n {\n parent::beforeFilter();\n }", "protected function registerDomainLocaleFilter()\n {\n $app = $this->app;\n\n $app->router->filter('domain.locale', function () use ($app) {\n $tld = $app['domain.localization']->getTld();\n\n if (! is_null($locale = $app['domain.localization']->getSupportedLocaleNameByTld($tld))) {\n $app['domain.localization']->setCurrentLocale($locale);\n }\n });\n }", "public function getInputFilter()\n {\n // Get an InputFilter instance for an Address and create an InputFactory instance.\n $InputFilter = (new Address())->getInputFilter();\n $Factory = new InputFactory();\n\t\t\t\n // Create the additional necessary input specifications.\n // Account details.\n\t\t\t$Email = (new User())->getInputFilter()->get('email');\n $Password =\n [\n 'name' => 'password',\n 'required' => true,\n 'filters' =>\n [\n ['name' => 'StripTags'],\n ],\n 'validators' =>\n [\n [\n 'name' => 'NotEmpty',\n 'options' =>\n [\n 'messages' =>\n [\n 'isEmpty' => \"This field is required.\"\n ]\n ]\n ],\n [\n 'name' => 'regex',\n 'options' =>\n [\n 'break_chain_on_failure' => true,\n 'pattern' => '/^[\\p{Latin}0-9!@#$%^&*()_+-=,.;: ]{6,32}$/',\n 'messages' =>\n [\n 'regexNotMatch' => 'Password can contain only letters, numbers, spaces and !@#$%^&*()_+-=,.;:'\n ]\n ]\n ],\n [\n 'name' => 'StringLength',\n 'options' =>\n [\n 'break_chain_on_failure' => true,\n 'encoding' => 'UTF-8',\n 'min' => 6,\n 'max' => 32,\n 'messages' =>\n [\n 'stringLengthTooShort' => 'Password must be 6 to 32 characters long.',\n 'stringLengthTooLong' => 'Password must be 6 to 32 characters long.',\n ]\n ]\n ]\n ],\n ];\n $RePassword = \n [\n 'name' => 'rePassword',\n 'required' => true,\n 'validators' =>\n [\n [\n 'name' => 'NotEmpty',\n 'options' =>\n [\n 'messages' =>\n [\n 'isEmpty' => 'This field is required.'\n ]\n ]\n ],\n [\n 'name' => 'identical',\n 'options' =>\n [\n 'token' => 'password',\n 'break_chain_on_failure' => true,\n 'messages' =>\n [\n 'notSame' => 'Passwords do not match!'\n ]\n ]\n ]\n ]\n ];\n\t\t\t\n // Tos and submit button validators.\n $AcceptTos =\n [\n 'name' => 'acceptTos',\n 'required' => true,\n 'validators' =>\n [\n [\n 'name' => 'NotEmpty',\n 'options' =>\n [\n 'messages' =>\n [\n 'isEmpty' => \"This field is required.\"\n ]\n ]\n ],\n ]\n ];\n $SubmitSignup = \n [\n 'name' => 'submitSignupForm',\n 'required' => true,\n ];\n \n // Add the inputs to the input filter and return it.\n $InputFilter->add($Email);\n $InputFilter->add($Password);\n $InputFilter->add($Factory->createInput($RePassword));\n $InputFilter->add($AcceptTos);\n $InputFilter->add($Factory->createInput($SubmitSignup));\n return $InputFilter;\n }", "public function beforeFilter() {\n parent::beforeFilter();\n //$this->Auth->allow();\n }", "public function boot()\n\t{\n\t\t$this->app['validator']->extend('noscripttags', function($attribute, $value) {\n\t\t\treturn (preg_match('/'. Resource::SANITIZE_REGEXP .'/', $value) === 0);\n\t\t});\n\t}", "public function beforeFilter() {\n\t\tparent::beforeFilter();\n\t\tif ($this->Components->enabled('Auth')) {\n\t\t\t$this->Auth->allow('process');\n\t\t}\n\t\tif (isset($this->Security) && $this->action === 'process') {\n\t\t\t$this->Security->validatePost = false;\n\t\t}\n\t}", "public function validateFilter(): ValidateFilterRequestBuilder {\n return new ValidateFilterRequestBuilder($this->pathParameters, $this->requestAdapter);\n }", "function add_filter($tag = '', $function_to_add = '', $priority = 10, $accepted_args = 1)\n {\n }", "public function __construct()\n {\n $this->beforefilter('auth', array('except'=>array('index','show','sitemap')));\n }", "public function beforeFilter()\r\n\t {\r\n\t parent::beforeFilter();\r\n\t }", "public function onKernelRequest(RequestEvent $event): void\n {\n if (!$event->isMasterRequest()) {\n return;\n }\n $request = $event->getRequest();\n // Check path info to avoid issue with Symfony profiler or other paths\n $pattern = '/' . preg_quote($this->parameterBag->get('api_and_version_path_prefix'), '/'). '/';\n if (!preg_match($pattern, $request->getPathInfo())) {\n return;\n }\n $wrongParameters = [];\n // Filter wrong query parameters to return a custom JSON error response with kernel exception listener\n foreach ($request->query->keys() as $parameterName) {\n if (!\\in_array($parameterName, FilterRequestHandler::AVAILABLE_FILTERS)) {\n $wrongParameters[] = $parameterName;\n }\n }\n // Will list wrong parameters in custom JSON error response through custom exception\n if (0 !== \\count($wrongParameters)) {\n $wrongParameters = implode(', ', $wrongParameters);\n throw new BadRequestHttpException(\n sprintf('Invalid request: unknown (%s) query parameter(s)', $wrongParameters)\n );\n }\n // At this time, if filters are used on request which is not a collection list throw a custom exception\n $isCollection = true === $request->attributes->get('isCollection');\n if (0 !== count($request->query->keys()) && !$isCollection) {\n throw new BadRequestHttpException('Misused filter(s) without collection: unexpected request query parameter(s)');\n }\n }", "function beforeFilter(){\n\t\tparent::beforeFilter(); \n\t}", "public function beforeFilter() {\n parent::beforeFilter();\n $this->Auth->allow('indexOfMember', 'search');\n }", "function filters(){\n add_filter( 'oauth_authorization_parameters', array( $this, 'authorization_parameters'), 1, 1 );\n // add_filter( 'oauth_token_parameters', array( $this, 'token_parameters'), 1, 1 );\n add_filter( 'oauth_token_response', array( $this, 'token_response'), 1, 1 );\n // add_filter( 'oauth_identity_parameters', array( $this, 'identity_parameters'), 1, 1 );\n \tadd_filter( 'oauth_identity_response', array( $this, 'identity_response'), 1, 1 );\n }", "function CheckFilter()\n{\n\tglobal $FilterArr, $lAdmin;\n\tforeach ($FilterArr as $f) global $$f;\n\t\n\treturn count($lAdmin->arFilterErrors) == 0; //if some errors took place, return false;\n}", "public function allowedFilters()\n {\n return [];\n }", "public function register_filters() {\n\t\tadd_filter( 'json_endpoints', array( $this, 'register_routes' ) );\n\t\tadd_filter( 'json_post_type_data', array( $this, 'type_archive_link' ), 10, 2 );\n\t}", "public function beforeFilter() {\n \tparent::beforeFilter();\n\t\t$this->Auth->allow('');\n\t}", "public function filter() {\r\n\t\t$this->resource->filter();\r\n\t}", "function add_field_filter($tag = '', $function_to_add = '', $priority = 10, $accepted_args = 1)\n {\n }", "public function beforeFilter()\n {\n parent::beforeFilter();\n //check if login\n $this->checkLogin();\n //check if admin\n $this->isAdmin();\n //check permissions\n $this->checkPermission('5');\n //set layout\n $this->layout = 'admin';\n }", "function users_can_register_signup_filter()\n {\n }", "public function boot()\n {\n Validator::extend('not_contains', function($attribute, $value, $parameters)\n {\n // Banned words\n $words = array('<script>', '</script>', '<?php');\n foreach ($words as $word)\n {\n if (stripos($value, $word) !== false) return false;\n }\n return true;\n });\n }", "public function beforeFilter() {\r\n parent::beforeFilter();\r\n $this->debug(\"Using version 1.0\");\r\n }", "public function before_filter(){\n\t\t$config = Config::read(\"config.ini\");\n\t\t$active_app = Kumbia::$active_app;\n\t\tif(!$config->$active_app->interactive){\n\t\t\t$this->redirect(\"\");\n\t\t\treturn false;\n\t\t}\n\t}", "abstract public function filters();", "function apply_filters_deprecated($hook_name, $args, $version, $replacement = '', $message = '')\n {\n }", "public function attachDefaultFilters() {\n\n /**\n * It's possible to extend what filters the content is subjected to.\n * By default, this is a URL filter, and a PATH filter. Other filters\n * can be implemented and attached if other conversions are also required.\n */\n $this->attachFilter('URL', 'TigerfishDTLReplaceHrefAndSrc');\n $this->filters['URL']->from($this->fromValue);\n $this->filters['URL']->to($this->toValue);\n $this->filters['URL']->relative($this->relative);\n $this->filters['URL']->https($this->https);\n $this->filters['URL']->debugMode($this->debug);\n\n $this->attachFilter('PATH', 'TigerfishDTLReplacePaths');\n $this->filters['PATH']->from($this->fromValue);\n $this->filters['PATH']->to($this->toValue);\n $this->filters['PATH']->relative($this->relative);\n $this->filters['PATH']->https($this->https);\n $this->filters['PATH']->debugMode($this->debug);\n\n }", "function authFilter() {\n\t\treturn function () {\n\t\t\tif (!kirby()->site()->user()) {\n\t\t\t\tpanel()->redirect('login');\n\t\t\t}\n\t\t};\n\t}", "public function test_rejects_blacklisted_by_append_lowercase()\n {\n \tConfig::set('validation.email.blacklist.source', null);\n \tConfig::set('validation.email.blacklist.append', \"rejectthisother.com\");\n\n\t\t$rules = ['email' => 'email|blacklist'];\n\n\t\t$input = ['email' => 'rejectme@REJECTthisOTHER.CoM'];\n\n\t\t$passes = Validator::make($input, $rules)->passes();\n\n\t\t$this->assertFalse($passes);\n }", "public function validationProvider() {\n return [\n [['path' => 'some_field', 'value' => 'some_value'], NULL],\n [\n ['path' => 'some_field', 'value' => 'some_value', 'operator' => '='],\n NULL,\n ],\n [['path' => 'some_field', 'operator' => 'IS NULL'], NULL],\n [['path' => 'some_field', 'operator' => 'IS NOT NULL'], NULL],\n [\n ['path' => 'some_field', 'operator' => 'IS', 'value' => 'some_value'],\n new BadRequestHttpException(\"The 'IS' operator is not allowed in a filter parameter.\"),\n ],\n [\n [\n 'path' => 'some_field',\n 'operator' => 'NOT_ALLOWED',\n 'value' => 'some_value',\n ],\n new BadRequestHttpException(\"The 'NOT_ALLOWED' operator is not allowed in a filter parameter.\"),\n ],\n [\n [\n 'path' => 'some_field',\n 'operator' => 'IS NULL',\n 'value' => 'should_not_be_here',\n ],\n new BadRequestHttpException(\"Filters using the 'IS NULL' operator should not provide a value.\"),\n ],\n [\n [\n 'path' => 'some_field',\n 'operator' => 'IS NOT NULL',\n 'value' => 'should_not_be_here',\n ],\n new BadRequestHttpException(\"Filters using the 'IS NOT NULL' operator should not provide a value.\"),\n ],\n [\n ['path' => 'path_only'],\n new BadRequestHttpException(\"Filter parameter is missing a '\" . EntityCondition::VALUE_KEY . \"' key.\"),\n ],\n [\n ['value' => 'value_only'],\n new BadRequestHttpException(\"Filter parameter is missing a '\" . EntityCondition::PATH_KEY . \"' key.\"),\n ],\n ];\n }", "protected function registerCustomValidationRules()\n {\n Validator::extend('platform', function ($attribute, $value, $parameters, $validator) {\n return Device::isPlatformValueOrAlias($value);\n });\n }", "public function beforeFilter() {\n\t\tparent::beforeFilter();\n\t\tif ($this->request->action == 'admin_toggle' || \n\t\t\t$this->request->action == 'admin_add_smart' ||\n\t\t\t$this->request->action == 'admin_save_condition' ) {\n\t\t\t$this->Components->disable('Security');\n\t\t}\n\t}", "function _webform_edit_file_filtering_validate($form_element, &$form_state) {\r\n // Predefined types.\r\n $extensions = array();\r\n foreach (element_children($form_element['types']) as $category) {\r\n foreach (array_keys($form_element['types'][$category]['#value']) as $extension) {\r\n if ($form_element['types'][$category][$extension]['#value']) {\r\n $extensions[] = $extension;\r\n }\r\n }\r\n }\r\n\r\n // Additional types.\r\n $additional_extensions = explode(',', $form_element['addextensions']['#value']);\r\n foreach ($additional_extensions as $extension) {\r\n $clean_extension = drupal_strtolower(trim($extension));\r\n if (!empty($clean_extension) && !in_array($clean_extension, $extensions)) {\r\n $extensions[] = $clean_extension;\r\n }\r\n }\r\n\r\n form_set_value($form_element['types'], $extensions, $form_state);\r\n}", "public function add_filters() {\n\n\t\tadd_filter( 'bbp_user_can_view_forum', array( $this, 'bbp_user_can_view_forum__associated_users_view_only' ), 99, 3 );\n\n\t\tadd_filter( 'bbp_get_template_part', array( $this, 'bbp_get_template_part__forum_archive_associated_users_view_only' ), 99, 3 );\n\n\t\tadd_filter( 'body_class', array( $this, 'body_class__add_body_class_for_those_who_can_see_forums' ), 10, 2 );\n\n\t\treturn null;\n\n\t}", "private function extendValidator(): void\n {\n Validator::extend('max_seats_from_vehicle', function (\n $attribute,\n $value,\n $parameters,\n $validator\n ) {\n if (! $parameters || ! Auth::user()) {\n return false;\n }\n\n if (isset($parameters[1]) && (int) $parameters[1] >= (int) $value) {\n return true;\n }\n\n $vehicle = Vehicle::whereId($parameters[0])->first();\n\n if (! $vehicle) {\n return false;\n }\n\n return $vehicle->seats >= (int) $value;\n });\n\n Validator::extend('greater_than_date', function (\n $attribute,\n $value,\n $parameters,\n $validator\n ) {\n if (! $parameters || ! $parameters[0]) {\n return false;\n }\n\n return (int) $parameters[0] < (int) $value;\n });\n\n Validator::extend('greater_than_date_if', function (\n $attribute,\n $value,\n $parameters,\n $validator\n ) {\n if (! $parameters || ! $parameters[0] || ! $parameters[1]) {\n return false;\n }\n\n $data = $validator->getData();\n list($requiredField, $restrictedValue) = $parameters;\n\n if (empty($data[$requiredField]) || ! $data[$requiredField]) {\n return true;\n }\n\n return (int) $restrictedValue < (int) $value;\n });\n\n Validator::extend(\n 'routes_exists_for_trip',\n RoutesExistsForTripValidator::class,\n RoutesExistsForTripValidator::ERROR_MSG\n );\n\n Validator::extend(\n 'role_can_uncheck',\n CanUncheckRoleValidator::class,\n CanUncheckRoleValidator::ERROR_MSG\n );\n\n Validator::extend(\n 'is_password_current',\n IsPasswordCurrentValidator::class,\n IsPasswordCurrentValidator::ERROR_MSG\n );\n }", "public function beforeFilter()\n {\n parent::beforeFilter();\n $this->Auth->allow();\n\n }", "public function approve(Filter $filter)\n {\n return Validator::make($filter->toArray(), [\n 'title' => 'required|min:15',\n 'status' => 'in:verify',\n ]);\n\n }", "public function test_add_filter_funcname() {\n // Random function name\n $hook = rand_str();\n $this->assertFalse( yourls_has_filter( $hook ) );\n yourls_add_filter( $hook, rand_str() );\n $this->assertTrue( yourls_has_filter( $hook ) );\n\n // Specific function name to test with yourls_apply_filter\n $hook = rand_str();\n $this->assertFalse( yourls_has_filter( $hook ) );\n yourls_add_filter( $hook, 'change_variable' );\n $this->assertTrue( yourls_has_filter( $hook ) );\n\n return $hook;\n\t}", "public function registerFilters()\n {\n foreach ($this->getFilters() as $filter) {\n try {\n $this->smarty->registerFilter($filter->getType(), $filter->getCallback());\n } catch (SmartyException $e) {\n if (null !== $this->logger) {\n $this->logger->warn(sprintf(\"SmartyException caught: %s.\", $e->getMessage()));\n }\n }\n }\n }", "public function beforeFilter() {\n\t\t$this->Auth->allow(array('index', 'add', 'view','edit'));\n\t}" ]
[ "0.67723876", "0.64407635", "0.634318", "0.6283646", "0.62792164", "0.6267064", "0.61350065", "0.61193156", "0.6055482", "0.60178816", "0.60016054", "0.59867936", "0.5940141", "0.59226614", "0.5918885", "0.5906209", "0.5896151", "0.5888684", "0.5833301", "0.5832365", "0.58182806", "0.5815608", "0.58036214", "0.5802954", "0.57860893", "0.57742155", "0.5773176", "0.57690406", "0.5743407", "0.57249933", "0.5720535", "0.5720535", "0.5712787", "0.5659898", "0.5659898", "0.5659671", "0.5659127", "0.5644894", "0.5634668", "0.5631067", "0.5627077", "0.5622219", "0.56137395", "0.5608762", "0.56049", "0.5565762", "0.5565347", "0.55648255", "0.55619603", "0.55562663", "0.55495805", "0.5545558", "0.55442536", "0.552786", "0.5524363", "0.54944646", "0.54538924", "0.545084", "0.5439393", "0.5439393", "0.5429716", "0.5429194", "0.5421654", "0.54074216", "0.54007626", "0.5394158", "0.5384478", "0.53838146", "0.53829616", "0.5377421", "0.53734", "0.5369323", "0.53675205", "0.5363489", "0.53603005", "0.5350838", "0.5335571", "0.53339946", "0.5333598", "0.53325576", "0.5330596", "0.5322379", "0.5316786", "0.5315909", "0.531467", "0.5313295", "0.53129065", "0.5311037", "0.53098863", "0.5306863", "0.5292232", "0.529189", "0.5289025", "0.5284809", "0.5283146", "0.5280572", "0.5276728", "0.5272917", "0.52700603", "0.5261961" ]
0.5711101
33
Add input from a filter so you can easily use it later.
public function addFilterInput($name, array $input) { $this->filterInputs[$name] = $input; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function addInputFilter()\n {\n $inputFilter = new InputFilter();\n $this->setInputFilter($inputFilter);\n\n }", "public function addFilterFormInput(): void;", "private function addInputFilter()\n {\n // Create main input filter\n $inputFilter = new InputFilter();\n $this->setInputFilter($inputFilter);\n\n // Add input for \"pin\" field\n $inputFilter->add([\n 'name' => 'pin',\n 'required' => true,\n 'filters' => [\n ['name' => 'StringTrim'],\n ],\n 'validators' => [\n [\n 'name' => 'StringLength',\n 'options' => [\n 'max' => 14\n ],\n ],\n ],\n ]);\n\n }", "private function addInputFilter()\n {\n // Create main input filter\n $inputFilter = $this->getInputFilter();\n\n // Add input for \"latitude\" field\n $inputFilter->add([\n 'name' => 'latitude',\n 'required' => true,\n 'filters' => [\n ['name' => 'StringTrim'],\n ],\n 'validators' => [\n [\n 'name' => 'Float',\n ],\n ],\n ]);\n\n // Add input for \"longitude\" field\n $inputFilter->add([\n 'name' => 'longitude',\n 'required' => true,\n 'filters' => [\n ['name' => 'StringTrim'],\n ],\n 'validators' => [\n [\n 'name' => 'Float',\n ],\n ],\n ]);\n\n\n }", "private function addInputFilter() \n {\n // Create main input filter\n $inputFilter = new InputFilter(); \n $this->setInputFilter($inputFilter);\n \n // Add input for \"email\" field\n $inputFilter->add([\n 'name' => 'title',\n 'required' => true,\n 'filters' => [\n ['name' => 'StringTrim'], \n ], \n 'validators' => [\n [\n 'name' => 'StringLength',\n 'options' => [\n 'min' => 1,\n 'max' => 128\n ],\n ],\n \n \n ],\n ]); \n\n\n \n // Add input for \"status\" field\n $inputFilter->add([\n 'name' => 'status',\n 'required' => true,\n 'filters' => [ \n ['name' => 'ToInt'],\n ], \n 'validators' => [\n ['name'=>'InArray', 'options'=>['haystack'=>[1, 2]]]\n ],\n ]); \n }", "public function addFilter(callable $filter);", "public function add($name, $filter, array $options = []);", "function add_filters()\n {\n }", "private function addInputFilters()\n {\n $inputFilter = new InputFilter();\n\n $author = (new Input())->setName('author')->setRequired(true);\n $author->getFilterChain()->attach(new StringTrim());\n $author->getValidatorChain()->attach((new StringLength())->setMin(1)->setMax(128));\n $inputFilter->add($author);\n\n $comment = (new Input())->setName('comment')->setRequired(true);\n $comment->getFilterChain()->attach(new StripTags());\n $comment->getValidatorChain()->attach((new StringLength())->setMin(1)->setMax(4096));\n $inputFilter->add($author)->add($comment);\n\n $this->setInputFilter($inputFilter);\n }", "public function add()\n {\n foreach ($this->filters as $filter) {\n call_user_func_array($this->addCallback, $filter);\n }\n }", "public function addFilter($filter) {\n $this->filters[] = $filter;\n $this->rewind();\n }", "public function addFilter($type, $value);", "public function getInputFilter();", "public function getFilterInput();", "private function addInputFilter() \n {\n // Create main input filter\n \n //$inputFilter = new InputFilter(); \n \n $inputFilter = $this->getInputFilter(); \n $this->setInputFilter($inputFilter);\n \n // Add input for \"usuario\" field\n $inputFilter->add([\n 'name' => 'nombre',\n 'required' => true,\n 'filters' => [ \n ['name' => 'StringTrim'],\n ], \n 'validators' => [\n [\n 'name' => 'StringLength',\n 'options' => [\n 'min' => 1,\n 'max' => 512\n ],\n ],\n ],\n ]);\n \n // Add input for \"telefono\" field\n $inputFilter->add([\n 'name' => 'telefono',\n 'required' => false,\n 'filters' => [ \n ['name' => 'StringTrim'],\n ], \n 'validators' => [\n [\n 'name' => 'StringLength',\n 'options' => [\n 'min' => 1,\n 'max' => 512\n ],\n ],\n ],\n ]);\n \n // Add input for \"email\" field\n $inputFilter->add([\n 'name' => 'email',\n 'required' => false,\n 'filters' => [ \n ['name' => 'StringTrim'],\n ], \n 'validators' => [\n [\n 'name' => 'StringLength',\n 'options' => [\n 'min' => 1,\n 'max' => 512\n ],\n ],\n ],\n ]);\n \n // Add input for \"email\" field\n $inputFilter->add([\n 'name' => 'skype',\n 'required' => false,\n 'filters' => [ \n ['name' => 'StringTrim'],\n ], \n 'validators' => [\n [\n 'name' => 'StringLength',\n 'options' => [\n 'min' => 1,\n 'max' => 512\n ],\n ],\n ],\n ]);\n \n }", "public function addFilters()\n {\n }", "public function filter($input);", "public function addFilter()\n\t{\n\t\treturn $this->addTextFilter();\n\t}", "public function addFilter(DFilter $filter) {\n\t\t$this->filters[] = $filter;\n\t}", "private function addInputFilter() \n {\n \n $inputFilter = new InputFilter(); \n $this->setInputFilter($inputFilter);\n \n $inputFilter->add([\n 'name' => 'nom_parent',\n 'required' => true,\n 'filters' => [\n ['name' => 'StringTrim'],\n ['name' => 'StripTags'],\n ['name' => 'StripNewlines'],\n ], \n 'validators' => [\n [\n 'name' => 'StringLength',\n 'options' => [\n 'min' => 2,\n 'max' => 100\n ],\n ],\n ],\n ]);\n \n $inputFilter->add([\n 'name' => 'prenom_parent',\n 'required' => true,\n 'filters' => [\n ['name' => 'StringTrim'],\n ['name' => 'StripTags'],\n ['name' => 'StripNewlines'],\n ], \n 'validators' => [\n [\n 'name' => 'StringLength',\n 'options' => [\n 'min' => 2,\n 'max' => 100\n ],\n ],\n ],\n ]);\n \n $inputFilter->add([\n 'name' => 'email_parent',\n 'required' => true,\n 'filters' => [\n ['name' => 'StringTrim'], \n ], \n 'validators' => [\n [\n 'name' => 'EmailAddress',\n 'options' => [\n 'allow' => \\Zend\\Validator\\Hostname::ALLOW_DNS,\n 'useMxCheck' => false, \n ],\n ],\n ],\n ]);\n \n }", "function add_filter($tag = '', $function_to_add = '', $priority = 10, $accepted_args = 1)\n {\n }", "public function addCustomFilters(&$inputFilter, $factory)\n {\n return $inputFilter;\n }", "public function addCustomFilters(&$inputFilter, $factory)\n {\n return $inputFilter;\n }", "public function add_filter($filter, $key = NULL)\n\t{\n\t\tif (!empty($key))\n\t\t{\n\t\t\t$this->filters[$key] = $filter;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->filters[] = $filter;\n\t\t}\n\t}", "function add_field_filter($tag = '', $function_to_add = '', $priority = 10, $accepted_args = 1)\n {\n }", "public function add($request_param, $name) \n {\n $this->filters[$request_param] = $name;\n }", "private function attachInputs(): void\n {\n foreach ($this->inputs() as $input) {\n $this->getInputFilter()->add($input);\n }\n }", "function add() {\n $this->wireframe->print_button = false;\n \n if(!AssignmentFilter::canAdd($this->logged_user)) {\n $this->httpError(HTTP_ERR_FORBIDDEN);\n } // if\n \n \t$filter_data = $this->request->post('filter');\n \tif(!is_array($filter_data)) {\n \t $filter_data = array(\n \t 'user_filter' => USER_FILTER_LOGGED_USER,\n \t 'objects_per_page' => 30,\n \t );\n \t} // if\n \t$this->smarty->assign('filter_data', $filter_data);\n \t\n \tif($this->request->isSubmitted()) {\n \t $this->active_filter = new AssignmentFilter();\n \t $this->active_filter->setAttributes($filter_data);\n \t \n \t $save = $this->active_filter->save();\n \t if($save && !is_error($save)) {\n \t flash_success(\"Filter ':name' has been created\", array('name' => $this->active_filter->getName()));\n \t $this->redirectToUrl($this->active_filter->getUrl());\n \t } else {\n \t $this->smarty->assign('errors', $save);\n \t } // if\n \t} // if\n }", "public function addFilter(\\NMC\\Migration\\FilterInterface $filter)\n {\n $this->filters[] = $filter;\n }", "public function addFilter(FilterInterface $filter) : void\n {\n $this->getLoader()->addFilter($filter);\n }", "public function addFilter(Filter $filter)\n {\n // Start with an empty AND composite filter\n if (!isset($this->filter)) {\n $this->filter = Filter::_and();\n }\n\n $this->checkFilter($filter);\n $this->filter = $this->filter->withAdded($filter);\n }", "function filterInput($filter, $input, $includeFromOwnLibrary = TRUE, $params = NULL) {\n include_once(PAPAYA_INCLUDE_PATH.'system/papaya_strings.php');\n\n $filter = papaya_strings::normalizeString($filter);\n $className = 'HTMLPurifier_Filter_'.$filter;\n if (!class_exists($className, FALSE)) {\n if ($includeFromOwnLibrary) {\n @include_once(\n sprintf(HTMLPURIFIER_INCLUDE_PATH.'HTMLPurifier/Filter/%s.php', $filter)\n );\n } else {\n @include_once(\n sprintf(HTMLPURIFIER_INCLUDE_PATH.'../papaya/Filter/%s.php', $filter)\n );\n }\n }\n\n if (!class_exists($className, FALSE)) {\n return NULL;\n }\n\n if ($params == NULL) {\n $obj = new $className();\n } else {\n $obj = new $className($params);\n }\n $input = $obj->preFilter($input, NULL, $obj);\n $input = $obj->postFilter($input, NULL, $obj);\n return $input;\n }", "public function getInputFilter(){\n\t\t/*\n\t\t * validate data:\n\t\t * -id\n\t\t * -svg1\n\t\t * -image1\n\t\t * -svg2\n\t\t * -image2\n\t\t * -svg3\n\t\t * -image3\n\t\t **/\n\n\t\tif(!$this->inputFilter){\n\t\t\t$inputFilter = new InputFilter();\n\n\t\t\t//id\n $inputFilter->add(array(\n 'name' => 'id',\n 'required' => true,\n 'filters' => array(\n array('name' => 'Int'),\n ),\n ));\n\n\n\t\t}\n\t}", "public function attachFilter($name = '', $filter) {\n $this->filters[$name] = new $filter;\n }", "protected function add()\n {\n $this->numArgs = $this->findNumArgs($this->callback);\n if (is_string($this->callback) && class_exists($this->callback)) {\n $this->useCallbackManager('invoke', $this->callback);\n }\n foreach ((array) $this->hook as $hook) {\n \\add_filter($hook, $this->callback, $this->priority, $this->numArgs);\n }\n }", "public function addFilter($filterName, Filters\\IFilter $filter)\n\t{\n\t\t$this->filterStore[$filterName] = $filter;\n\t}", "function addFilter($query, $filter) {\n if (strpos($query, 'WHERE') !== false) {\n return $query . \" AND \" . $filter;\n } else {\n return $query . \" WHERE \" . $filter;\n }\n }", "public function addFilter(FilterInterface $filter)\n {\n if (null === $this->filters) {\n $this->getFilters();\n }\n\n $this->filters[] = $filter;\n }", "public function setFilter(string $filter);", "protected function addFilter(array $filter) {\n $this->filter = array_merge($this->filter, array_flip($filter));\n }", "public function createFilter();", "public function add($filter, $value)\n {\n if ($this->isAllowed($filter)) {\n $this->filters[$filter] = $value;\n }\n\n return $this;\n }", "public function filter($filter)\n {\n }", "public function setFilter($filter){ }", "function addFilters($filters, $includeFromOwnLibrary = TRUE, $params = NULL) {\n include_once(PAPAYA_INCLUDE_PATH.'system/papaya_strings.php');\n\n if (!is_array($filters)) {\n $filters = array($filters);\n }\n\n foreach ($filters as $filter) {\n // TODO sicher genug?\n $filter = papaya_strings::normalizeString($filter);\n $className = 'HTMLPurifier_Filter_'.$filter;\n if (!class_exists($className, FALSE)) {\n if ($includeFromOwnLibrary) {\n @include_once(\n sprintf(HTMLPURIFIER_INCLUDE_PATH.'HTMLPurifier/Filter/%s.php', $filter)\n );\n } else {\n @include_once(\n sprintf(HTMLPURIFIER_INCLUDE_PATH.'../papaya/Filter/%s.php', $filter)\n );\n }\n }\n if (class_exists($className, FALSE)) {\n if ($params == NULL) {\n $this->htmlPurifier()->addFilter(new $className());\n } else {\n $this->htmlPurifier()->addFilter(new $className($params));\n }\n }\n }\n }", "public function addTestCaseFilter(TestCaseFilter $filter): void\n {\n $this->testCaseFilters[] = $filter;\n }", "public function addSystemFilter($filter) {\n $this->callMethod( 'addSystemFilter', array($filter) );\n }", "public function addFilters() {\n\t\t// $this->subscriber->addFilter( 'mdm_syndication_post_fields', [$this, 'addCustomFields'] );\n\t}", "public function addFilter(Swift_StreamFilter $filter, $key);", "private function initInputFilter($di) {\n\t\t\t$di->set('inputFilter', function(){\n\t\t\t\n\t\t\t\treturn new FilterOptions();\n\t\t\t\t\n\t\t\t});\n\t\t\t\n\t\t}", "public function setAdditionalFilter($dataProvider, $filter);", "public function addFilters()\n {\n foreach (func_get_args() as $filter) {\n if (is_a($filter, 'Rhubarb\\Stem\\Filters\\Filter')) {\n $this->filters[] = $filter;\n } else {\n throw new \\Exception('Non filter object added to Group filter');\n }\n }\n }", "protected function form_add_filter_dialog( $filter, &$form ) {\n\t}", "public function register_filters() {\n\n\t\t}", "public function addFilter(ProjectFilterInterface $filter)\n {\n $this->filters[] = $filter;\n }", "function input_filter($components, $args)\n {\n $mmdTypes = array( \"disputed\", \"generated\", \"proofread\", \"erroneous\");\n $element = $args['element'];\n $record = $args['record'];\n $elementName = $element->name;\n $recordId = $record->id;\n $inputHtml = $components['input'];\n \n $newHtml = $inputHtml . \"<p>Bonus field input: <input type='text' name='Item-$recordId-$elementName-additional'/></p>\";\n $components['input'] = $newHtml;\n return $components;\n }", "public function _filterInput(WireInput $input) {\n\t\t$this->whseidInput($input);\n\t}", "public function addFilter(FilterInterface $filter)\n {\n $this->filters[] = $filter;\n\n return $this;\n }", "public function add_filter( $hook, $callback, $priority = 10, $accepted_args = 1 ) {\n\t\t$this->filters[] = compact( 'hook', 'callback', 'priority', 'accepted_args' );\n\t}", "public function addFilterField($filterField, $operator = 'like', $formFilter = NULL, $filterTransformer = NULL)\n {\n $this->filterFields[] = $filterField;\n $this->operators[] = $operator;\n $this->formFilters[] = isset($formFilter) ? $formFilter : $filterField;\n $this->filterTransformers[] = $filterTransformer;\n }", "public function addFilterItem(FilterItem $filter_item)\n\t{\n\t\t$this->items[] = $filter_item;\n\t}", "public function registerFilter(Chainr_Filter $filter) {\n\t\t$this->filterChain->register($filter);\n\t}", "protected function initInputFilters()\n {\n $inputFilter = new ZendInputFilter\\InputFilter();\n\n $this->setInputFilter($inputFilter);\n\n $inputFilter->add([\n 'name' => \"{$this->prefix}ip\",\n 'required' => false,\n 'filters' => [\n ['name' => ZendFilter\\StringTrim::class],\n ],\n ]);\n\n $inputFilter->add([\n 'name' => \"{$this->prefix}comment\",\n 'required' => false,\n 'filters' => [\n ['name' => ZendFilter\\StringTrim::class],\n ],\n ]);\n }", "public function addFilter($filter) {\n\t\tif (!is_callable($filter)) {\n\t\t\tthrow new \\Exception('addFilter must be callable');\n\t\t}\n\n\t\t$this->rules[$this->rule]['filters'][] = $filter;\n\n\t\treturn $this;\n\t}", "private function _addFilter(IColumnFilter $filter)\n\t{\n\t\tif ($this->hasFilter()) {\n\t\t\t$this->getComponent('filters')\n\t\t\t\t->removeComponent($this->getFilter());\n\t\t}\n\t\t$this->getComponent('filters')\n\t\t\t->addComponent($filter, $this->getName());\n\t}", "public function add_filters($filters)\n\t{\n\t\tif (empty($this->filters))\n\t\t{\n\t\t\t$this->filters = $filters;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->filters = array_merge($this->filters, $filters);\n\t\t}\n\t}", "protected function addFilter ()\n {\n global $database;\n\n if (defined('LEPTON_VERSION')) {\n // register the filter at LEPTON outputInterface\n if (! file_exists(WB_PATH . '/modules/output_interface/output_interface.php')) {\n throw new \\Exception('Missing LEPTON outputInterface, can\\'t register the kitFramework filter - installation is not complete!');\n } else {\n if (! function_exists('register_output_filter'))\n include_once (WB_PATH . '/modules/output_interface/output_interface.php');\n register_output_filter('kit_framework', 'kitFramework');\n }\n }\n elseif (defined('CAT_VERSION')) {\n // register the filter at the blackcatFilter\n require_once CAT_PATH.'/modules/blackcatFilter/filter.php';\n // first unregister to prevent trouble at re-install\n unregister_filter('kitCommands', 'kit_framework');\n // register the filter\n register_filter('kitCommands', 'kit_framework', 'Enable the usage of kitCommands within BlackCat');\n }\n else {\n if (version_compare(WB_VERSION, '2.8.3', '>=')) {\n // WebsiteBaker 2.8.3\n $filter_path = WB_PATH . '/modules/output_filter/index.php';\n } else {\n // all other WebsiteBaker versions\n $filter_path = WB_PATH . '/modules/output_filter/filter-routines.php';\n }\n if (file_exists($filter_path)) {\n if (! $this->websiteBakerIsPatched($filter_path)) {\n if (! $this->websiteBakerDoPatch($filter_path)) {\n throw new \\Exception('Failed to patch the WebsiteBaker output filter, please contact the support!');\n }\n }\n } else {\n throw new \\Exception('Can\\'t detect the correct method to patch the output filter, please contact the support!');\n }\n }\n return true;\n }", "function iniciarFiltro(&$filtro) {\n\n if (isset($_GET['order']))\n $filtro->order($_GET['order']);\n $filtro->nombres[] = 'Nombre';\n $filtro->valores[] = array('input', 'nombre', $filtro->filtro('nombre'));\n $filtro->nombres[] = 'Descripci&oacute;n';\n $filtro->valores[] = array('input', 'descripcion', $filtro->filtro('descripcion'));\n }", "public function add_filter( $hook, $component, $callback, $priority = 10, $acc_args = 1 ) {\n\t\t$this->filters = $this->add( $this->filters, $hook, $component, $callback, $priority, $acc_args );\n\t}", "public function addFilterFactory(FilterFactoryInterface $filterFactory)\n {\n $this->factories[] = $filterFactory;\n }", "private function filters() {\n\n\n\t}", "public function addFilter($_image, $filter, $param1, $param2, $param3)\n {\n \n //se o filtro estiver no array de filtros simples\n if(array_key_exists($filter,self::$_simpleFilters))\n {\n imagefilter($_image, self::$_simpleFilters[$filter]);\n return $_image;\n }\n //verifico se o filtro e do array de customizados\n elseif(in_array($filter,self::$_customFilters))\n {\n //verifico que tipo de filtro e esse\n switch ($filter)\n {\n case \"sharpen\":\n require_once \"Custom/Sharpen.php\"; //Efeito Sharpen\n //arumando as propriedades para que nao ocorra nehum tipo de erro durante a execucao\n $param1 = (($param1 > 200 || $param1 < 50)?50:$param1);\n $param2 = (($param2 > 1 || $param2 < 0.5)?0.5:$param2);\n $param3 = (($param3 > 5 || $param3 < 0)?0:$param3);\n\n //instanciando a classe do Sharpen\n $sharpen = new Sharpen;\n $_image = $sharpen->addSharpen($_image, $param1, $param2, $param3);\n return $_image;\n break;\n\n case \"noise\":\n require_once \"Custom/Noise.php\"; //Efeito Noise\n //instanciando a classe de noise\n $noise = new Noise;\n $_image = $noise->addNoise($_image);\n return $_image;\n break;\n\n case \"scatter\":\n require_once \"Custom/Scatter.php\"; //Efeito Scatter\n //instanciando a classe de scatter\n $scatter = new Scatter;\n $_image = $scatter->addScatter($_image);\n return $_image;\n break;\n\n case \"pixelate\":\n require_once \"Custom/Pixelate.php\"; //Efeito Pixelate\n //instanciando a classe de pixelate\n $pixelate = new Pixelate;\n $_image = $pixelate->addPixelate($_image);\n return $_image;\n break;\n\n case \"interlace\":\n require_once \"Custom/Interlace.php\"; //Efeito Interlace\n //instanciando a classe de interlace\n $interlace = new Interlace;\n $_image = $interlace->addInterlace($_image);\n return $_image;\n break;\n\n case \"screen\":\n require_once \"Custom/Screen.php\"; //Efeito Screen\n //instanciando a classe de Screen\n $screen = new Screen;\n $_image = $screen->addScreen($_image);\n return $_image;\n break;\n }\n }\n //se o filtro estiver no array de filtros simples\n elseif(array_key_exists($filter,self::$_advancedFilters))\n {\n //verifico se o filtro recebe mais de um parametro\n if($filter == 'colorize')\n {\n imagefilter($_image, self::$_advancedFilters[$filter], $param1, $param2, $param3);\n return $_image;\n }\n\n //caso contrario\n else\n {\n imagefilter($_image, self::$_advancedFilters[$filter], $param1);\n return $_image;\n }\n }\n //se nao existir entao sera lancada uma excessao\n else\n {\n throw new Exception(\"Filtro inexistente - Absent filter\");\n return false;\n }\n }", "public function addFilter(Filter $filter, int $priority = 0): HttpHandler;", "private function setFilter()\n {\n $this->filter['value'] = $this->getParameter('value') == null ? '' : $this->getParameter('value');\n }", "function mgd_register_filter($name, $function)\n{\n $GLOBALS['midgard_filters'][\"x{$name}\"] = $function;\n}", "function Filter($filter,$data)\n{\n \tglobal\t$FILTERS;\n\n\t\t//\n\t\t// get the program name from the filter name\n\t\t//\n\tif (!isset($FILTERS[$filter]) || $FILTERS[$filter] == \"\")\n\t{\n \t\tError(\"bad_filter\",\"The form has an internal error - unknown filter\");\n\t\texit;\n\t}\n\t$prog = $FILTERS[$filter];\n\t\t//\n\t\t// change to the directory that contains the filter program\n\t\t//\n\t$dirname = dirname($prog);\n\tif (!chdir($dirname))\n\t{\n \t\tError(\"chdir_filter\",\"The form has an internal error - cannot chdir to run filter\");\n\t\texit;\n\t}\n\t\t//\n\t\t// the output of the filter goes to a temporary file\n\t\t//\n\t$temp_file = tempnam(\"/tmp\",\"FMF\");\n\t$cmd = \"$prog > $temp_file 2>&1\";\n\t\t//\n\t\t// start the filter\n\t\t//\n\t$pipe = popen($cmd,\"w\");\n\tif (!$pipe)\n\t{\n\t $err = join('',file($temp_file));\n\t unlink($temp_file);\n \t\tError(\"filter_not_found\",\"The form has an internal error - cannot execute filter\",\n\t\t\t\t\t\ttrue,$err);\n\t\texit;\n\t}\n\t\t//\n\t\t// write the data to the filter\n\t\t//\n\tfwrite($pipe,$data);\n\tif (pclose($pipe) != 0)\n\t{\n\t $err = join('',file($temp_file));\n\t unlink($temp_file);\n \t\tError(\"filter_failed\",\"The form has an internal error - filter failed\",\n\t\t\t\t\t\ttrue,$err);\n\t\texit;\n\t}\n\t\t//\n\t\t// read in the filter's output and return as the data to be sent\n\t\t//\n\t$data = join('',file($temp_file));\n\tunlink($temp_file);\n\treturn ($data);\n}", "public function testAddFilter()\n {\n $this->todo('stub');\n }", "public function _add_incident_filters()\n\t{\n\t\t$params = Event::$data;\n\t\t$params = array_merge($params, $this->params);\n\t\tEvent::$data = $params;\n\t}", "public function addFilter($filterQuery) {\n if ($this->filter != \"\" && ! preg_match(\"/^\\s*NOT/\", $filterQuery) ) $this->filter .= \" AND \";\n $this->filter .= \" \" . $filterQuery;\n return $this;\n }", "public function filter($input, $as, $cond): static;", "public function appendFilter($filter)\n {\n return $this->addFilter($filter, self::CHAIN_APPEND);\n }", "public function setInputFilter(InputFilterInterface $inputFilter) {\r\n $this->_inputFilter = $inputFilter;\r\n }", "function modify_filters ($filter,$mods) \n{ \n $new_filter = array_merge($filter,$mods);\n return $new_filter;\n}", "function addRawInputValue( $idx, $value );", "function register($metatype, callable $filefilter) {\n\t\tstatic::$filefilters[$metatype] = $filefilter;\n\t}", "public function setInputFilter(InputFilterInterface $inputFilter){\n // throw new \\Exception(\"Not used\");\n }", "public function setInputFilter(InputFilterInterface $inputFilter){\n // throw new \\Exception(\"Not used\");\n }", "protected function attachInputs()\n {\n foreach ($this->inputs() as $input) {\n $this->getInputFilter()->add($input);\n }\n return $this;\n }", "public function filter(/* variable arguments */) {\n $args = func_get_args();\n $filterName = array_shift($args);\n $this->filters[$filterName] = $args;\n return $this;\n }", "public function addFilters() {\n\t\t\tadd_filter( 'muut_validate_setting', array( $this, 'validateSettings' ), 10, 2 );\n\t\t}", "public function appendFilter(FilterInterface $filter)\n {\n return $this->addFilter($filter, self::CHAIN_APPEND);\n }", "public function addFilterItem(FilterItem $filterItem): void\n {\n $this->filterItems[$filterItem->getColumn()] = $filterItem;\n }", "public function pre_filter($filter, $field = TRUE)\n\t{\n\t\tif ($field === TRUE OR $field === '*')\n\t\t{\n\t\t\t// Use wildcard\n\t\t\t$fields = array('*');\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Add the filter to specific inputs\n\t\t\t$fields = func_get_args();\n\t\t\t$fields = array_slice($fields, 1);\n\t\t}\n\n\t\t// Convert to a proper callback\n\t\t$filter = $this->callback($filter);\n\n\t\tforeach ($fields as $field)\n\t\t{\n\t\t\t// Add the filter to specified field\n\t\t\t$this->pre_filters[$field][] = $filter;\n\t\t}\n\n\t\treturn $this;\n\t}", "function filter_input($type, $variable_name, $filter = /* .constant 'FILTER_DEFAULT' */, $options = /* .constant 'FILTER_FLAG_NONE' */) {\r\n if(is_array($options)) {\r\n \t$flags = 0;\r\n \t\r\n foreach((array) $options['flags'] as $option)\r\n $flags |= $option;\r\n } else\r\n $flags = $options;\r\n \r\n // Get variable\r\n switch($type) {\r\n case /* .constant 'INPUT_GET' */:\r\n $GET = Pancake\\vars::$Pancake_request->getGETParams(); \r\n if(!array_key_exists($variable_name, $GET))\r\n return $flags & /* .constant 'FILTER_NULL_ON_FAILURE' */ ? false : null;\r\n $var = $GET[$variable_name];\r\n break;\r\n case /* .constant 'INPUT_POST' */:\r\n $POST = Pancake\\vars::$Pancake_request->getPOSTParams(); \r\n if(!array_key_exists($variable_name, $POST))\r\n return $flags & /* .constant 'FILTER_NULL_ON_FAILURE' */ ? false : null;\r\n $var = $POST[$variable_name];\r\n break;\r\n case /* .constant 'INPUT_COOKIE' */:\r\n $COOKIE = Pancake\\vars::$Pancake_request->getCookies(); \r\n if(!array_key_exists($variable_name, $COOKIE))\r\n return $flags & /* .constant 'FILTER_NULL_ON_FAILURE' */ ? false : null;\r\n $var = $COOKIE[$variable_name];\r\n break;\r\n case /* .constant 'INPUT_SERVER' */:\r\n $SERVER = Pancake\\vars::$Pancake_request->createSERVER(); \r\n if(!array_key_exists($variable_name, $SERVER))\r\n return $flags & /* .constant 'FILTER_NULL_ON_FAILURE' */ ? false : null;\r\n $var = $SERVER[$variable_name];\r\n break;\r\n case /* .constant 'INPUT_ENV' */:\r\n if(!array_key_exists($variable_name, $_ENV))\r\n return $flags & /* .constant 'FILTER_NULL_ON_FAILURE' */ ? false : null;\r\n $var = $_ENV[$variable_name];\r\n break;\r\n }\r\n \r\n return filter_var($var, $filter, $options); \r\n }", "public function addFilter($field, $value, $type = 'and')\n {\n return $this->addCallbackFilter($field, $value);\n }", "private function _add_filters() {\n\t\t\tadd_filter('wp_setup_nav_menu_item', array($this, 'add_custom_options'));\n\n\t\t\t# Update custom menu options\n\t\t\tadd_action('wp_update_nav_menu_item', array($this, 'update_custom_options'), 10, 3);\n\n\t\t\t# Set edit menu walker\n\t\t\tadd_filter('wp_edit_nav_menu_walker', array($this, 'apply_edit_walker_class'), 10, 2);\n\t\t\t\n\t\t\t# Addition style\n\t\t\tadd_action('admin_enqueue_scripts', array( $this, 'add_menu_css' ));\n\t\t\t\n\t\t\t# Addition js\n\t\t\tadd_action('admin_head-nav-menus.php', array( $this, 'add_icon_js' ));\n\n\t\t\t# Mega menu javascript\n\t\t\tadd_action('admin_enqueue_scripts', array( $this, 'wtbx_mega_menu_admin_scripts' ), 80);\n\t\t}", "public function addFilter(string $name, callable $callback, int $priority = 100, int $params = 1);", "private static function _getFilter() {}", "public function addFilter($filter)\n {\n $clone = $this->makeClone(true);\n if (is_array($filter)) {\n $clone->objectFilters[] = $filter;\n } else if (is_object($filter)) {\n $clone->objectFilter[] = $filter;\n } else {\n throw new TypeError(\"Unsupported filter type: \" . var_export($filter, true));\n }\n $clone->_nested = null;\n return $clone;\n }", "public function add_filter($hook_name, $callback, $priority, $accepted_args)\n {\n }" ]
[ "0.79471755", "0.74685466", "0.7185334", "0.71527225", "0.7125578", "0.7057969", "0.68429834", "0.6834139", "0.68260396", "0.67910516", "0.67904663", "0.677415", "0.6771706", "0.67541397", "0.6734295", "0.66626054", "0.6511555", "0.6506726", "0.6500988", "0.6439508", "0.6420715", "0.64160174", "0.64160174", "0.634055", "0.6323003", "0.6292203", "0.6264613", "0.623628", "0.6235038", "0.6193483", "0.61688036", "0.61540616", "0.6134885", "0.613222", "0.6090088", "0.6046302", "0.60435265", "0.6039035", "0.6022799", "0.60146445", "0.60013795", "0.59921205", "0.5987553", "0.5971757", "0.59017104", "0.5876505", "0.5864725", "0.5853711", "0.5849966", "0.5847698", "0.5791554", "0.5778987", "0.5758602", "0.5753842", "0.5752252", "0.57507324", "0.573972", "0.5705334", "0.5700798", "0.56785333", "0.56758416", "0.56738627", "0.56735665", "0.5664904", "0.56630933", "0.56472474", "0.56278574", "0.5626366", "0.55925184", "0.5583072", "0.55768603", "0.5576125", "0.5574591", "0.5545478", "0.55377597", "0.5527935", "0.5523416", "0.55126536", "0.5512519", "0.55116576", "0.54929954", "0.5466616", "0.54658467", "0.54601", "0.544833", "0.5444154", "0.5444154", "0.5440368", "0.5433896", "0.5429886", "0.542195", "0.5421878", "0.54111665", "0.54029787", "0.5399528", "0.53909236", "0.53905153", "0.5389016", "0.53854704", "0.538294" ]
0.7286794
2
Get input that was earlier stored from a called filter.
public function input($name) { if ( ! isset($this->filterInputs[$name])) { return null; } return $this->filterInputs[$name]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getFilterInput();", "final public function GetInput() { return $this->input; }", "public function input()\n {\n return $this->_input;\n }", "private function getStartInput(): Input {\n return $this->lowerInput;\n }", "public function getInputFilter();", "public function get_input()\n {\n }", "public function current()\n {\n return current($this->_filters);\n }", "public function pre_save($input)\n\t{\n\t\treturn $input;\n\t}", "public function getInputFilter()\n {\n if (!$this->inputFilter) {\n $inputFilter = new InputFilter();\n $this->inputFilter = $inputFilter;\n }\n\n return $this->inputFilter;\n }", "public function getInput()\n {\n return $this->_input;\n }", "public function input()\n\t{\n\t\treturn $this->parameters;\n\t}", "public function getInputFilter()\n {\n if (!$this->inputFilter) {\n $inputFilter = new InputFilter();\n $factory = new InputFactory();\n\n $this->inputFilter = $inputFilter;\n }\n\n return $this->inputFilter;\n }", "public function getInput() {\n return $this->input;\n }", "public function getInput() {\n return $this->input;\n }", "protected function getFilter()\n {\n return $this->filter;\n }", "function getFilter() {\n\t\treturn $this->_filter;\n\t}", "public function current()\r\n {\r\n return $this->_filter->filter(parent::current());\r\n }", "function GetFilter ( )\n{\n\treturn $this->FilterExp();\n}", "public function getCleanInput()\n {\n $input = $this->input;\n\n if ($this->is_argv) {\n unset($input[0]);\n }\n\n return $input;\n }", "public function getInputFilter()\n {\n if ($this->inputFilter) {\n return $this->inputFilter;\n }\n\n return new InputFilter();\n }", "protected function _getLastInput() {\n \n $_vValue = AdminPageFramework_WPUtility::getTransient( 'apf_tfd' . md5( 'temporary_form_data_' . $this->sClassName . get_current_user_id() ) );\n if ( is_array( $_vValue ) ) {\n return $_vValue;\n }\n return array();\n \n }", "public function getInput()\n {\n return $this->input;\n }", "public function getInput()\n {\n return $this->input;\n }", "public function getInput()\n {\n return $this->input;\n }", "public function getInput()\n {\n return $this->input;\n }", "public function getInput()\n {\n return $this->input;\n }", "function getFilter()\n\t{\n\t\treturn $this->_filter;\n\t}", "final public function getRawInput()\n {\n return $this->rawInput;\n }", "public function getInput(): Input\n\t{\n\t\treturn $this->input;\n\t}", "private function getUserInput()\n {\n // BotDetect built-in Ajax Captcha validation\n $input = $this->getUrlParameter('i');\n\n if (is_null($input)) {\n // jQuery validation support, the input key may be just about anything,\n // so we have to loop through fields and take the first unrecognized one\n $recognized = array('get', 'c', 't', 'd');\n foreach ($_GET as $key => $value) {\n if (!in_array($key, $recognized)) {\n $input = $value;\n break;\n }\n }\n }\n\n return $input;\n }", "public function rewind()\n {\n reset($this->_filters);\n return current($this->_filters);\n }", "public function getInput()\n\t\t{\n\t\t\treturn $this->input;\n\t\t}", "public function current ()\n {\n return $this->inputs->current();\n }", "public function getFilter()\n {\n return $this->filter;\n }", "public function getFilter()\n {\n return $this->filter;\n }", "public function getFilter()\n {\n return $this->filter;\n }", "public function getFilter()\n {\n return $this->filter;\n }", "public function getFilter()\n {\n return $this->filter;\n }", "public function getFilter()\n {\n return $this->filter;\n }", "public function getFilter()\n {\n return $this->filter;\n }", "public function getFilter()\n {\n return $this->filter;\n }", "public function getFilter()\n {\n return $this->filter;\n }", "public function getFilter()\n {\n return $this->filter;\n }", "public function getFilter()\n {\n return $this->filter;\n }", "public function getFilter()\n {\n return $this->filter;\n }", "public function getFilter()\n {\n return $this->filter;\n }", "public function getFilter()\n {\n return $this->filter;\n }", "public function getFilter()\n {\n return $this->filter;\n }", "public function getFilter()\n {\n return $this->filter;\n }", "public function getFilter()\n {\n return $this->filter;\n }", "public function getInput();", "public function getInput();", "public function getInput();", "function get( $name )\n\t{\n\t foreach( $this->inputs as $input ){\n\t // loop over each and see if match\n\t if( $input['name'] == $name ){\n\t // return a reference\n\t return $input;\n\t }\n\t }\n\t}", "public function getFilter()\n\t{\n\t\treturn $this->filter;\n\t}", "public function get($name)\n {\n return $this->filters[$name];\n }", "public function getInput()\r\n\t{\r\n\t\treturn $this->input;\r\n\t}", "public function onGetFilterKey_result()\n\t{\n\t\tif (!isset($this->filterKey))\n\t\t{\n\t\t\t$this->onGetFilterKey();\n\t\t}\n\t\treturn $this->filterKey;\n\t}", "public function getDataFromInput($key = null, $default = null, $source = 'REQUEST', $filter=null, array $args=array())\n {\n if (!$key) {\n $key = $this->_objPath;\n }\n\n $objectArray = FormUtil::getPassedValue($key, $default, $source, $filter, $args, $this->_objPath);\n\n if ($objectArray) {\n $this->_objData = $objectArray;\n $this->getDataFromInputPostProcess();\n return $this->_objData;\n }\n\n return $default;\n }", "public function getInputData()\n {\n return $this->env['INPUT'];\n }", "public function getInputSource()\n\t{\n\t\t$parsedBody = $this->getParsedBody();\n\t\t\n\t\tif ($this->getRequestMethod() === Request::GET) {\n\t\t\treturn $this->getQueryParams();\n\t\t}\n\t\t\n\t\treturn $parsedBody;\n\t}", "public function getInput() {}", "function getKeywordFromRequest() {\n\t\t$oFilter = utilityInputFilter::filterString();\n\t\t$key = $oFilter->doFilter($this->getActionFromRequest(false, 3));\n\t\treturn $key;\n\t}", "public function modify_input_for_read($input)\n {\n return $input;\n }", "public function filter($input);", "public function getInput(): string\n {\n return $this->input;\n }", "public function getInput()\n\t{\n\t\treturn $this->input;\n\t}", "public function getFilter()\n {\n return $this->get(self::FILTER);\n }", "function requestInput($key)\n{\n return request()->input($key);\n}", "function input_get(string $key): ?string\n{\n return \\filter_input(INPUT_GET, $key);\n}", "public function getFilterParam()\n {\n return $this->filterParam;\n }", "public static function getInput()\n {\n // First check if a custom input has been set, else get the PHP input.\n if (!($input = self::$telegram->getCustomInput())) {\n $input = file_get_contents('php://input');\n }\n\n // Make sure we have a string to work with.\n if (is_string($input)) {\n self::$input = $input;\n } else {\n throw new TelegramException('Input must be a string!');\n }\n\n TelegramLog::update(self::$input);\n return self::$input;\n }", "protected function getInputFilter($inputFilterService)\n {\n return $this->inputFilters[$inputFilterService];\n }", "public function getRawInput() : mixed {\n\t\t\tif (!$this->isValid) {\n\t\t\t\t// @codeCoverageIgnoreStart\n\t\t\t\tthrow new InvalidRequestException(\"Can't get input on an invalid request\");\n\t\t\t\t// @codeCoverageIgnoreEnd\n\t\t\t}\n\n\t\t\treturn $this->input;\n\t\t}", "protected function getFilter()\n {\n return $this->getSettingsValue('filter');\n }", "public function getPreviousValue();", "public function getInputValue()\n {\n return $this->input->getRawInput();\n }", "function current_filter()\n {\n }", "public function get_filtering()\r\n\t{\r\n\t\treturn $this->filtering->get_value();\r\n\t}", "protected function getInternalFilter()\n {\n return $this->getSettingsValue('internal_filter');\n }", "public function getInputFilter()\n {\n $template = $this->getTemplate();\n return new $template();\n }", "function getOriginal()\n {\n }", "public function input($needle = '', $default = FALSE, $filter = null)\n {\n $needle = ( empty($needle) ? $_REQUEST : (isset($_REQUEST[$needle]) ? $_REQUEST[$needle] : $default) );\n return is_callable($filter) ? (is_array($needle) ? array_walk_recursive($needle, $filter) : $filter($needle)) : $needle;\n }", "public function input(string $field)\n {\n $this->body();\n return $this->requestStack[$field];\n }", "function getInput()\n {\n $handle = fopen(\"php://stdin\", \"r\");\n $input = trim(fgets($handle));\n fclose($handle);\n return $input;\n }", "public function getInput($key);", "private function getEndInput(): Input {\n return $this->upperInput;\n }", "abstract public function getInput();", "public function getInput($name) {\n switch($this->request) {\n case 'GET':\n if(filter_has_var(INPUT_GET, $name)) {\n return $_REQUEST[$name];\n }else{\n throw new App\\Exceptions\\RequestException(\"Error input $name doesn't exist.\");\n }\n break;\n case 'POST':\n if(filter_has_var(INPUT_POST, $name)) {\n return $_REQUEST[$name];\n }else{\n throw new App\\Exceptions\\RequestException(\"Error input $name doesn't exist.\");\n }\n break;\n default:\n throw new App\\Exceptions\\RequestException('Error Something Went Wrong');\n break;\n }\n }", "public function getKeyFilterReference()\n {\n return $this->keyFilterReference;\n }", "public function old($name)\n {\n if (isset($this->session)) {\n return $this->session->getOldInput($this->transformKey($name));\n }\n }", "protected function peek() {\n $this->lookAhead = $this->get();\n return $this->lookAhead;\n }", "public function getInputName() {\n return $this->inputName;\n\t }", "function getEvent() {\t\n\n\t//Get the event from pipe and json_decode it\n\treturn json_decode(file_get_contents('php://input'));\n}", "function getInput()\n {\n $input = '';\n $fr = fopen(\"php://stdin\", \"r\");\n while (!feof ($fr))\n {\n $input .= fgets($fr);\n }\n fclose($fr);\n return $input;\n }", "public function getFilterValue(): string;", "function filter_input($type, $variable_name, $filter = /* .constant 'FILTER_DEFAULT' */, $options = /* .constant 'FILTER_FLAG_NONE' */) {\r\n if(is_array($options)) {\r\n \t$flags = 0;\r\n \t\r\n foreach((array) $options['flags'] as $option)\r\n $flags |= $option;\r\n } else\r\n $flags = $options;\r\n \r\n // Get variable\r\n switch($type) {\r\n case /* .constant 'INPUT_GET' */:\r\n $GET = Pancake\\vars::$Pancake_request->getGETParams(); \r\n if(!array_key_exists($variable_name, $GET))\r\n return $flags & /* .constant 'FILTER_NULL_ON_FAILURE' */ ? false : null;\r\n $var = $GET[$variable_name];\r\n break;\r\n case /* .constant 'INPUT_POST' */:\r\n $POST = Pancake\\vars::$Pancake_request->getPOSTParams(); \r\n if(!array_key_exists($variable_name, $POST))\r\n return $flags & /* .constant 'FILTER_NULL_ON_FAILURE' */ ? false : null;\r\n $var = $POST[$variable_name];\r\n break;\r\n case /* .constant 'INPUT_COOKIE' */:\r\n $COOKIE = Pancake\\vars::$Pancake_request->getCookies(); \r\n if(!array_key_exists($variable_name, $COOKIE))\r\n return $flags & /* .constant 'FILTER_NULL_ON_FAILURE' */ ? false : null;\r\n $var = $COOKIE[$variable_name];\r\n break;\r\n case /* .constant 'INPUT_SERVER' */:\r\n $SERVER = Pancake\\vars::$Pancake_request->createSERVER(); \r\n if(!array_key_exists($variable_name, $SERVER))\r\n return $flags & /* .constant 'FILTER_NULL_ON_FAILURE' */ ? false : null;\r\n $var = $SERVER[$variable_name];\r\n break;\r\n case /* .constant 'INPUT_ENV' */:\r\n if(!array_key_exists($variable_name, $_ENV))\r\n return $flags & /* .constant 'FILTER_NULL_ON_FAILURE' */ ? false : null;\r\n $var = $_ENV[$variable_name];\r\n break;\r\n }\r\n \r\n return filter_var($var, $filter, $options); \r\n }", "public function getFilter(): string;", "public function getData()\n\t{\n\t\treturn $this->value ? $this->value : $this->input;\n\t}", "public function getInput() : ParameterHelper {\n\t\t\tif (!$this->isValid) {\n\t\t\t\t// @codeCoverageIgnoreStart\n\t\t\t\tthrow new InvalidRequestException(\"Can't get input on an invalid request\");\n\t\t\t\t// @codeCoverageIgnoreEnd\n\t\t\t}\n\n\t\t\tif ($this->requestType->is(RequestType::GET)) {\n\t\t\t\treturn $this->getGet();\n\t\t\t}\n\n\t\t\tif (!$this->isJson) {\n\t\t\t\tthrow new NonJsonInputException(\"Can't get parameterized input for non-json payload\");\n\t\t\t}\n\n\t\t\t// @codeCoverageIgnoreStart\n\t\t\treturn new ParameterHelper(json_decode($this->input, true));\n\t\t\t// @codeCoverageIgnoreEnd\n\t\t}" ]
[ "0.6865076", "0.6335458", "0.6148668", "0.60061055", "0.5955545", "0.5944067", "0.59219235", "0.5917938", "0.5763187", "0.56868637", "0.5685717", "0.56847954", "0.56780106", "0.56780106", "0.56671053", "0.5655306", "0.5628632", "0.5618912", "0.5613993", "0.5611076", "0.5602932", "0.5587832", "0.5587832", "0.5587832", "0.5587832", "0.5587832", "0.55404264", "0.55258006", "0.5499755", "0.5486505", "0.547627", "0.54730225", "0.5449579", "0.54386777", "0.54386777", "0.54386777", "0.54386777", "0.54386777", "0.54386777", "0.54386777", "0.54386777", "0.54386777", "0.54386777", "0.54386777", "0.54386777", "0.54386777", "0.54386777", "0.54386777", "0.54386777", "0.54386777", "0.54100525", "0.54100525", "0.54100525", "0.5402764", "0.5377342", "0.53645897", "0.53600144", "0.5353839", "0.53259623", "0.5307627", "0.5303628", "0.52893984", "0.52624214", "0.525394", "0.52536696", "0.5247794", "0.52398384", "0.52389634", "0.52360636", "0.5216529", "0.5214049", "0.5207325", "0.520543", "0.51920336", "0.5183746", "0.51768833", "0.5175127", "0.5165434", "0.5165218", "0.51635295", "0.5162915", "0.51559144", "0.51464444", "0.5138434", "0.51373386", "0.51309866", "0.5128084", "0.51255286", "0.51233643", "0.5113574", "0.5111638", "0.51101965", "0.5093508", "0.5077251", "0.5050005", "0.50406563", "0.50402635", "0.50377995", "0.50345606", "0.5022806" ]
0.6456032
1
Index Page for this controller. Maps to the following URL or or Since this controller is set as the default controller in config/routes.php, it's displayed at So any other public methods not prefixed with an underscore will map to /index.php/welcome/
public function index() { $result['data'] = $this->branch_m->branchview(); $this->load->view('include/header_login'); $this->load->view('login',$result); $this->load->view('include/footer_login'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function index () {\n $view = new WelcomeIndex();\n $view->display();\n }", "public function index()\n\t{\n\t\treturn view(\"welcome\");\n\t}", "public function index()\n\t{\n\t\t$this->load->view('welcome');\n\t}", "public function action_index()\r\n\t{\r\n\t\t$this->title = 'Welcome';\r\n\t\t$this->template->content = View::factory('index');\r\n\t}", "public function index()\n\t{\n\t\treturn view('welcome');\n\t}", "public function index()\n\t{\n\t\treturn view('welcome');\n\t}", "public function indexAction()\n\t{\n\t\t//echo 'Hello from the index action in the Home controller!';\n\t\t\n\t\t/*View::render('Home' . DS . 'index.php', [\n\t\t\t\"name\" => \"Laura\",\n\t\t\t\"colours\" => [\"red\", \"green\", \"blue\"]\n\t\t]);*/\n\t\t\n\t\t// View::renderTemplate('Home' . DS . 'index.html', [\n\t\t// \t\"name\" => \"Laura\",\n\t\t// \t\"colours\" => [\"red\", \"green\", \"blue\"]\n // ]);\n \n\t\t$this->showRouteParams();\n\t\t// echo \"Hello, World!\";\n }", "public function index()\n\t{\n\t\t//Default view\n\t\t$this->load->view('index.html');\n\t}", "function index() {\n\n // This page cannot be accessed without providing a page\n // the routes.php file will not allow the page to be accessed\n // $route['pages/(:any)'] = 'pages/view/$';\n redirect('/', 'refresh');\n\n }", "public function Index()\n\t{\n\t\t$this->views->SetTitle('Index Controller');\n\t\t$this->views->AddView('index/index.tpl.php', array(),'primary');\n\t}", "public function index()\n\t{\n\t\t$this->load->view('default/index');\n\t}", "public function index() {\n\t\t$this->display('index');\n\t}", "public function index()\n\t{\t\n\n\t\t$this->load->view('welcome_message');\n\t}", "public function indexAction()\n {\n $arr = [\n 'title' => 'Welcome',\n 'data' => [\n 'name' => 'PHP FRAMEWORK',\n ]\n ];\n View::renderTemplate('Welcome/index.html', $arr);\n }", "public function index()\n\t{\n\t\t$this->load->view('index');\n\t}", "public function index()\n\t{\n\t\t$this->load->view('index');\n\t}", "public function index()\n\t{\n\t\t$this->load->view('index');\n\t}", "public function index()\n\t{\n\t\t$this->load->view('index');\n\t}", "public function index()\n\t{\n\t\t$this->load->view('index');\n\t}", "public function index()\n\t{\n\t\t$this->load->view('index');\n }", "public function show_index()\n {\n return view('welcome');\n }", "public function index()\n\t{\n\t\t$this->load->view('welcome_message');\n\t}", "public function index()\n\t{\n\t\t$this->load->view('welcome_message');\n\t}", "public function index()\n\t{\n\t\t$this->load->view('welcome_message');\n\t}", "public function index()\n\t{\n\t\t$this->load->view('welcome_message');\n\t}", "public function index()\n\t{\n\t\t$this->load->view('welcome_message');\n\t}", "public function index()\n\t{\n\t\t$this->load->view('welcome_message');\n\t}", "public function index()\n\t{\n\t\t$this->load->view('welcome_message');\n\t}", "public function index()\n\t{\n\t\t$this->load->view('welcome_message');\n\t}", "public function index()\n\t{\n\t\t$this->load->view('welcome_message');\n\t}", "public function index()\n\t{\n\t\t$this->load->view('welcome_message');\n\t}", "public function index()\n\t{\n\t\t$this->load->view('welcome_message');\n\t}", "public function index()\n\t{\n\t\t$this->load->view('welcome_message');\n\t}", "public function index()\n\t{\n\t\t$this->load->view('welcome_message');\n\t}", "public function Index()\n {\n $this->standardView('Index');\n }", "public function index()\n {\n return view('main.welcome');\n }", "public function index()\n {\n // return view('welcome');\n }", "public function index()\n {\n $this->load->view('index');\n }", "public function index()\n {\n // return view('welcome');\n \n }", "public function index()\n\t{\n\t\t$this->load->view('home');\n\t}", "public function index()\n\t{\n\t\techo \"Nothing !\";\n\t}", "public function index() {\n \n return view('welcome');\n }", "public function index()\n {\n return view('pages.welcome');\n }", "public function index()\n {\n $this->load->view('welcome_message');\n }", "public function index()\n {\n $this->load->view('welcome_message');\n }", "public function Index()\n {\n \treturn view(\"index\");\n\t}", "public function index()\n {\n\t\t/*$this->layout->setTitle('Welcome to our Blog');\n\t\t$this->layout->showView('welcome/about.php');*/\n\t\techo 'hello I\\'m using codeigniter';\n }", "public function index() {\n\n\t\tif(!empty($_GET['page'])) {\n\t\t\tif($_GET['page'] == 'home') {\n\t\t\t\t(new HomeController)->home();\n\t\t\t} elseif($_GET['page'] == 'about-me') {\n\t\t\t\t(new HomeController)->aboutMe();\n\t\t\t}\n\t\t} else {\n\t\t\t(new HomeController)->home();\n\t\t}\n\t}", "public function index()\n {\n return view('welcome');\n }", "public function index()\n {\n return view('welcome');\n }", "public function index()\n {\n return view('welcome');\n }", "public function index()\n {\n return view('welcome');\n }", "public function index()\n {\n return view('welcome');\n }", "public function index()\n {\n return view('welcome');\n }", "public function index()\n {\n return view('welcome');\n }", "public function index()\n {\n return view('welcome');\n }", "public function index()\n {\n return view('welcome');\n }", "public function index()\n {\n return view('welcome');\n }", "public function index()\n {\n return view('welcome');\n }", "public function index()\n\t{\n\t\treturn view('pages/home');\n\t}", "public function index()\n {\n return \"INDEX PAGE\";\n }", "public function index()\n\t{\n\t\treturn view('home');\n\t}", "public function index()\n\t{\n\t\treturn view('home');\n\t}", "function index() {\n \n parent::index();\n\n\t\t$data['user_id'] = $this->tank_auth->get_user_id();\n\t\t$data['username'] = $this->tank_auth->get_username();\n\t\t$data['main_content_view'] = $this->load->view('welcome', $data, true);\n $this->render_template($data);\n\t}", "public function index()\n {\n SEOMeta::setTitle('Trusted Mortgage & Remortgage Solutions In UK - SmartMortgages UK');\n SEOMeta::setDescription('Home Page Description: For competitive mortgage and remortgage quotes around the UK at affordable rates, speak to one of our expert credit consultants and get a mortgage. For more visit us today.');\n\n return view('welcome');\n }", "public function index()\n\t{\n\t\t$this->title = 'My Index Action';\n\n\t\treturn new View('basic/index');\n\t}", "public function index()\n\t{\n\t\t$data['title'] = 'Home | Welcome to AEY';\n\t\t$data ['view_page'] = 'homepage';\n\n\t\t$this->load->view('site', $data);\n\t}", "public function index()\n {\n\n return view('welcome');\n\n }", "public function actionIndex(){ \n $this->view(\"index.php\");\n }", "public function index() {\n $this->registry->template->module = 'welcome';\n \n /*** load the index template ***/\n $this->registry->template->show('index');\n }", "public function actionIndex()\n\t{\n\t $this->pageTitle = 'Get Started';\n\t\t$this->render('index');\n\t}", "public function index()\n {\n return view('front.welcome');\n }", "public function index()\n\t{\n\t\treturn $this->traces();\n\t\treturn view('welcome');\n\t}", "public function index()\n\t{\n\t\t$this->loadViews(\"index\");\n\t}", "public function index() {\n\t\t$this->title = 'Home';\n\t\t$this->pageData['pages'] = Page::getAll();\n\t\t$this->render('index');\n\t}", "public function index()\n\t{\n\t\t$this->load->view('home/home');\n\t}", "public function index() \n\t{\n\t\t$this->_render_hod_view('home');\n\t}", "public function index()\r\n\t{\r\n\t\techo \"index\";\r\n\t}", "public function index()\n\t{\n\t\t$this->twig->display('welcome/index.html', []);\n\t}", "public function Index() {\n $this->Display();\n }", "public function index()\r\n {\r\n View::render('home');\r\n }", "public function index()\n {\n $title = 'Welcome Page';\n return view($this->view . '.home', compact('title'));\n }", "public function index()\n\t{\n\t\t//\n\t\techo'index';\n\t}", "public function index() {\n $this->getView('navigation', array('pagename' => 'Welcome'));\n $this->getView('welcome');\n $this->getView('footer');\n }", "public function index()\n {\n return view(\"home\");\n }", "public function home()\n\t{\n\t\t$this->load->view('index_view');\n\t}", "function index() {\n $this->renderView(\"index\");\n }", "function index()\r\n\t{\r\n\t\t$this->view(); \r\n\t}", "public function index()\n\t{\n\t\treturn view('index');\n\t}", "public function index()\n {\n return view('welcome');\n }", "public function index()\n {\n\n\n\n return view('welcome');\n }", "public function index() {\n\t\t$page = Page::getInstance();\n\t\t$session = Session::getInstance();\n\t\t$page->setPageTitle('Method index notfound');\n\t\t$session->setFlash('Chaque controller doit avoir une m&eacute;thode index', 'error');\n\t}", "public function index()\r\n\t{\r\n\t\t//\r\n\t}", "public function index() {\n\t\t// render the view (/view/main/index.php)\n\t\t$this->view->render(\"main\", \"index\");\n\t}", "public function index()\n {\n return View(\"pages.home\");\n }", "public function index()\n {\n // Nothing to do\n }", "public function index(){\n return view('welcome');\n }", "public function index()\n\t{\n\t\t//\n\t}", "public function index()\n\t{\n\t\t//\n\t}", "public function index()\n\t{\n\t\t//\n\t}", "public function index()\n\t{\n\t\t//\n\t}" ]
[ "0.76557434", "0.7414538", "0.7396686", "0.73173964", "0.72283185", "0.72283185", "0.7189769", "0.71655566", "0.71522975", "0.7144573", "0.7107562", "0.7077026", "0.7075653", "0.70410365", "0.7029339", "0.7029339", "0.7029339", "0.7029339", "0.7029339", "0.69731146", "0.69687515", "0.6948086", "0.6948086", "0.6948086", "0.6948086", "0.6948086", "0.6948086", "0.6948086", "0.6948086", "0.6948086", "0.6948086", "0.6948086", "0.6948086", "0.6948086", "0.69308597", "0.69269305", "0.69126976", "0.6900778", "0.6895354", "0.6875165", "0.6857271", "0.6857204", "0.6839809", "0.6803464", "0.6803464", "0.6802633", "0.67959386", "0.6788331", "0.67683935", "0.67683935", "0.67683935", "0.67683935", "0.67683935", "0.67683935", "0.67683935", "0.67683935", "0.67683935", "0.67683935", "0.67683935", "0.6765308", "0.67633724", "0.676087", "0.676087", "0.67520106", "0.67516524", "0.67472863", "0.67425126", "0.6739338", "0.6729021", "0.6717751", "0.6713304", "0.6712274", "0.67045385", "0.6699644", "0.66918296", "0.66747445", "0.66621464", "0.6660396", "0.66517514", "0.6630355", "0.66213465", "0.6613361", "0.6603877", "0.659872", "0.6594299", "0.65928584", "0.6585346", "0.65760225", "0.65753067", "0.6574954", "0.6555389", "0.65459347", "0.6545137", "0.65436107", "0.6542934", "0.6541543", "0.6518538", "0.65155756", "0.65155756", "0.65155756", "0.65155756" ]
0.0
-1
Transform the resource into an array.
public function toArray($request) { return [ 'id' => $this->id, 'tag' => $this->tag, 'address' => $this->address, 'lat' => $this->lat, 'long' => $this->long, 'landmark' => $this->landmark, 'name' => $this->name, 'mobile' => $this->mobile, 'email' => $this->email, 'address_line_1' => $this->address_line_1, 'address_line_2' => $this->address_line_2, 'area' => $this->area, 'emirate' => $this->emirate, 'is_default' => $this->is_default, ]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function toArray(): array\n {\n if (is_null($this->resource)) {\n return [];\n }\n\n return is_array($this->resource)\n ? $this->resource\n : $this->resource->toArray();\n }", "public function toArray(): array\n {\n if (is_null($this->resource)) {\n return [];\n }\n\n return is_array($this->resource)\n ? $this->resource\n : $this->resource->toArray();\n }", "public function asArray() {\n return $this->resource;\n }", "public function transform($resource)\n {\n return [];\n }", "public function toArray()\n {\n if ($this->resource instanceof ArrayableInterface) {\n\n return $this->resource->toArray();\n } else {\n\n return null;\n }\n }", "public function parse($resource)\n {\n return $resource->toArray();\n }", "public function transform($resource)\n {\n return [\n 'id' => $resource['id'],\n 'item' => $resource['item'],\n 'qty' => $resource['qty'],\n\n ];\n }", "public function toArray() {}", "public function toArray() {}", "public function toArray() {}", "public function toArray() {}", "public function toArray() {}", "public function toArray() {}", "public function toArray() {}", "public function toArray() {}", "public function toArray() {}", "public function toArray() {}", "public function toArray() {}", "public function toArray() {}", "public function toArray() {}", "public function toArray() {}", "public function toArray() {}", "public function toArray() {}", "abstract protected function toArray();", "public function getAsArray();", "public function asArray();", "public function asArray();", "public function asArray();", "public function asArray();", "public function asArray();", "public function asArray();", "public function getAsArray()\n\t{\n\t\t\n\t\t$path = $this->get();\n\t\t\n\t\treturn self::toArray($path);\n\t\t\n\t}", "public function transform($resource)\n {\n return [\n\n 'id' => (int) $resource->id,\n\t\t\t'name' => $resource->name,\n\t\t\t'description' => $resource->description,\n 'seat_count' => $resource->seat_count,\n\t\t\t'is_active' => $resource->is_active,\n\t\t\t'status' => $resource->status,\n\t\t\t'created_at' => $resource->created_at->toDateTimeString(),\n\t\t\t'updated_at' => $resource->updated_at->toDateTimeString(),\n\t\t\t\n ];\n }", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray();", "public function toArray(): array\n {\n return [\n 'users' => HiUserResource::collection($this->resource),\n ];\n }", "public function toArray()\n {\n return $this->transform();\n }", "function toArray() ;", "function toArray() ;", "public function convertItemArray() {}", "public function toArray(): array\n {\n $content = $this->getContent();\n\n if (\\is_array($content)) {\n return $this instanceof Filterable\n ? (array) $this->filterResponse($content)\n : $content;\n }\n\n return [];\n }", "protected function asArray()\n\t{\n\t\treturn \\json_decode($this->response, true);\n\t}", "public function arr() {\n\t\t\treturn \\uri\\generate::to_array($this->object);\n\t\t}", "public function toArray()\n {\n return $this->getContent();\n }", "public function toArray()\n {\n\n }", "public function asArray(): array\n {\n return json_decode($this->result, true);\n }", "public function toArray()\n {\n return $this->cast('array');\n }", "function toArray(){\r\n\t\treturn $this->data;\r\n\t}", "private function arrayify(): array\n {\n return $this->toArray();\n }", "abstract public function toArray();", "abstract public function toArray();", "abstract public function toArray();", "abstract public function toArray();", "abstract public function toArray();", "public function toArray() // untested\n {\n return $this->data;\n }", "public function toArray(){\n $this->buildArray();\n return $this->array;\n }", "public function toArray(): array;", "public function toArray(): array;", "public function toArray(): array;", "public function toArray(): array;", "public function toArray(): array;", "public function toArray(): array;", "public function toArray(): array;" ]
[ "0.7750456", "0.7750456", "0.7715446", "0.7589755", "0.73103595", "0.7137621", "0.7134441", "0.70968926", "0.70968926", "0.70968735", "0.70968735", "0.70968735", "0.70968735", "0.70955735", "0.70955735", "0.70955735", "0.70955735", "0.70955735", "0.70955735", "0.70955735", "0.70955735", "0.70955735", "0.70955735", "0.6959287", "0.6956413", "0.68911356", "0.68911356", "0.68911356", "0.68911356", "0.68911356", "0.68911356", "0.6882083", "0.68670243", "0.6852625", "0.6852625", "0.6852625", "0.6852625", "0.6852625", "0.6852625", "0.6852625", "0.6852625", "0.6852625", "0.6852625", "0.6852625", "0.6852625", "0.6852625", "0.6852625", "0.6852625", "0.6852625", "0.6852625", "0.6852625", "0.6852625", "0.6852625", "0.6852625", "0.6852625", "0.6852625", "0.6852625", "0.6852625", "0.6852625", "0.6852625", "0.6852625", "0.6852625", "0.6852625", "0.6852625", "0.6852625", "0.6852625", "0.6852625", "0.6852625", "0.6852625", "0.6852625", "0.6852625", "0.6852625", "0.6852625", "0.68519616", "0.6790938", "0.67466193", "0.67466193", "0.67365426", "0.6720005", "0.67125833", "0.67117316", "0.6709858", "0.6661276", "0.66588646", "0.6657097", "0.66554594", "0.6654112", "0.66488254", "0.66488254", "0.66488254", "0.66488254", "0.66488254", "0.6637797", "0.66369003", "0.66289026", "0.66289026", "0.66289026", "0.66289026", "0.66289026", "0.66289026", "0.66289026" ]
0.0
-1
create .seeties.me token Cookie
public function createCookie(Request $request) { $token = 'JDJ5JDEwJFdDdGRLLlo4OWRCeDlMMTEyUTFtbXVPUDNBN3kxV1VNQ0NEdC9ORXp6WmtSRWkwOTd5WGwy'; $cookie = \Cookie::make('token', $token, 60, null, env('COOKIE_DOMAIN')); $response = new Response('Hello world'); return $response->withCookie( $cookie ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function create()\n\t{\n\t\t$c = bin2hex(random_bytes(32));\t\t\t\t\t\t\n\t\t$cnametoken = md5('cookie-name!' . time());\t\t\t// cookie name ; can be seen in the first 32 digits of string token\n\t\t$cname = md5('md5-cookie-name!' . $cnametoken);\t\t// real cookie name ; this is the cookie key set in the browser\n\t\t\n\t\t// stores the value in the client\n\t\t$this->_intf->set($cname, $c);\n\t\t\n\t\t// returns computed token\n\t\treturn $this->compute($cnametoken, $c, basename(__FILE__));\n\t}", "function setCryostemTokenCookie() {\n\n $current_time = time();\n if(isset($_SESSION['cryostemToken']) && !empty($_SESSION['cryostemToken'])) {\n\n $token = $_SESSION['cryostemToken']->access_token;\n $expires = $current_time + $_SESSION['cryostemToken']->expires_in -100;\n setcookie('cryostemToken', $token, $expires, COOKIEPATH, COOKIE_DOMAIN);\n\n } else {\n unset($_COOKIE['cryostemToken']);\n setcookie(\"cryostemToken\", \"\", $current_time-3600);\n }\n}", "private function createCookie(string $token): Cookie\n {\n $name = $this->csrfConfig->getCookieName();\n $value = $this->signer->sign($token);\n $expires = time() + $this->csrfConfig->getCookieAge();\n\n return $this->cookieFactory->create($name, $value, $expires);\n }", "function wp_generate_auth_cookie($user_id, $expiration, $scheme = 'auth', $token = '')\n {\n }", "function createtoken()\n {\n $token = \"token-\" . mt_rand();\n // put in the token, created time\n $_SESSION[$token] = time();\n return $token;\n }", "public static function cookieToken(): string\n {\n return mt_rand(1000, 9999).\".\".self::setToken(10);\n }", "function setSig() {\n if (sfConfig::get(\"sf_private_key\") !='') {\n \n $hash = md5(rand_str());\n $this -> context ->getLogger()->debug(\"{Theater Token Class} HASH:: \".$hash);\n putLog(\"USER:: \".$this -> sessionVar(\"user_id\").\" | MESSAGE:: TOKEN HASH:: \".$hash);\n \n $expires = strtotime(now());\n $this -> context ->getLogger()->debug(\"{Theater Token Class} EXPIRES:: \".$expires);\n putLog(\"USER:: \".$this -> sessionVar(\"user_id\").\" | MESSAGE:: TOKEN EXPIRES:: \".$expires);\n \n $code = setUserOrderTicket();\n $this -> seat -> setAudienceHmacKey( $code );\n $this -> seat -> save();\n $this -> context ->getLogger()->debug(\"{Theater Token Class} CODE:: \".$code);\n putLog(\"USER:: \".$this -> sessionVar(\"user_id\").\" | MESSAGE:: TOKEN CODE:: \".$code);\n \n /*\n\t\t\t$enc_date = encryptCookie($code, $hash.\"=\".strtotime(now()));\n $this -> context ->getLogger()->debug(\"{Theater Token Class} HMAC_SIG:: \".$enc_date);\n putLog(\"USER:: \".$this -> sessionVar(\"user_id\").\" - TOKEN HMAC_SIG:: \".$enc_date);\n \n $this -> token_raw = $hash . \"|\" . strtotime(now()) . \"|\" . $enc_date;\n $this -> context ->getLogger()->debug(\"{Theater Token Class} Set Token:: \".$this -> token_raw);\n putLog(\"USER:: \".$this -> sessionVar(\"user_id\").\" - TOKEN RAW:: \".$this -> token_raw);\n \n $this -> token = encryptCookie($code,$this -> token_raw);\n $this -> context ->getLogger()->debug(\"{Theater Token Class} Set Coookie:: \".$this -> token);\n putLog(\"USER:: \".$this -> sessionVar(\"user_id\").\" - SET COOKIE:: \".$this -> token);\n */\n \n $this -> setCookieVar( \"csth\", $code, 7 );\n return $this -> token;\n \n }\n \n }", "public static function createCookie($username, $userid, $token, $serial){\n setcookie('username', $username, time() + (86400) * 30, '/');\n setcookie('userid', $userid, time() + (86400) * 30, '/');\n setcookie('token', $token, time() + (86400) * 30, '/');\n setcookie('serial', $serial, time() + (86400) * 30, '/');\n }", "public function createToken();", "public function generateToken(){\n //if(empty($_SESSION['token']) && (empty($_SESSION['tokenAge']) || (time() - (int)$_SESSION['tokenAge']) > (int)$this->maxAge)){\n if(function_exists('random_bytes')){\n $_SESSION['token'] = bin2hex(random_bytes(32));\n }elseif(function_exists('mcrypt_create_iv')){\n $_SESSION['token'] = bin2hex(mcrypt_create_iv(32, MCRYPT_DEV_URANDOM));\n }else{\n $_SESSION['token'] = bin2hex(openssl_random_pseudo_bytes(32));\n }\n $_SESSION['tokenAge'] = time();\n //} \n }", "private function createCookie()\n {\n $salt = openssl_random_pseudo_bytes(16);\n $hash = hash('sha256', $salt . $this->userId);\n\n $this->db->prepare('UPDATE `' . $this->config['authTable'] . '` SET `authSalt` = ? WHERE `' . $this->config['userColumn'] . '` = ?');\n $this->db->execute(array($salt, $this->userId), 'ss');\n\n setcookie('userid', $this->userId, time() + $this->config['cookieLifetime']);\n setcookie('auth', $hash, time() + $this->config['cookieLifetime']);\n }", "function _generate()\n\t{\n\t\t$username = $this->CI->session->userdata('username');\n\t\t\n\t\t$token_source = fopen(\"http://random.org/strings/?num=1&len=20&digits=on&upperalpha=on&loweralpha=on&unique=on&format=plain&rnd=new\", \"r\");\n\t\t$token = fread($token_source, 20);\n\t\t\n\t\t$identifier = $username . $token;\n\t\t$identifier = $this->_salt($identifier);\n\t\t\n\t\t$this->CI->db->query(\"UPDATE `users` SET `identifier` = '$identifier', `token` = '$token' WHERE `username` = '$username'\");\n\t\t\n\t\tsetcookie(\"logged_in\", $identifier, time()+3600, '/');\n\t}", "public static function generateToken()\r\n {\r\n $_SESSION['CSRF_TOKEN'] = bin2hex(openssl_random_pseudo_bytes(32));\r\n }", "function create_token()\n {\n $secretKey = \"B1sm1LLAH1rrohmaan1rroh11m\";\n\n // Generates a random string of ten digits\n $salt = mt_rand();\n\n // Computes the signature by hashing the salt with the secret key as the key\n $signature = hash_hmac('sha256', $salt, $secretKey, false);\n // $signature = hash('md5', $salt.$secretKey);\n\n // return $signature;\n return urlsafeB64Encode($signature);\n }", "private function tasteTheCookie()\n {\n helper(\"auth\");\n\n if (isset($_COOKIE[\"token\"]))\n {\n $tokenCookie = $_COOKIE[\"token\"];\n $token = isValid($tokenCookie);\n \n if ($token != null)\n {\n if (isAuthenticated(\"Cinema\"))\n $this->userName = $token->name;\n else if (isAuthenticated(\"RUser\"))\n $this->userName = $token->firstName;\n else\n {\n header(\"Location: /HomeController\");\n exit();\n }\n $this->userMail = $token->email;\n $this->userImage = ((new UserModel())->find($token->email))->image;\n }\n else\n {\n header(\"Location: /HomeController\");\n exit();\n }\n }\n }", "public static function authCookie(string $token) : void\n {\n setcookie('NameYourGoat_User_Token', $token, time() + 3600*24*30, '/');\n }", "function createCookie($key,$value)\n{\n\tsetcookie(str_rot13(\"$key\"),str_rot13(\"$value\"),0,\"/\");\n}", "function setTokenFromCookie($token) {\n\t\t\t$this->tokenFromCookie = $token;\n\t\t}", "public function createCookie(){\n $stringen = new RandomStringGenerator(implode(range(0, 9)));\n $code = $stringen->generate(15);\n $cookie = null;\n if(!isset($_COOKIE[\"visitor\"]) || $_COOKIE[\"visitor\"]==\"\"){\n setcookie(\"visitor\", $code, time()+86400);\n\n $browser = new Browser();\n $navigateur = $browser->getBrowser();\n\n $data = [\n 'cookie_code' => \"$code\",\n 'ip_address' => $this->getRealUserIp(),\n 'browser' => \"$navigateur\",\n 'country_code' => $this->getCountryCode()\n ];\n\n\n //$cookie = Visitors::create($data);\n }\n\n //return $data;\n }", "private function createCSRFToken() {\r\n\t \r\n\t // Check that the token is still valid\r\n\t if( empty($this->input('session', 'token_creation')) ||\r\n\t (time() - $this->input('session', 'token_creation')) > TOKEN_KEEPALIVE ) {\r\n \t\t// The token needs to be refreshed, delete every previous request token for the user\r\n \t\tSecurity::deleteToken();\r\n \t\t\r\n \t\t// Create a new token\r\n \t\t$token = Security::generateToken();\r\n \t\t\r\n \t\t// Store the token in the session\r\n \t\t$this->input('session', 'token', $token);\r\n \t\t\r\n \t\t// Set the token creation time to the current time\r\n \t\t$this->input('session', 'token_creation', (string)time());\r\n\t }\r\n\t\t\r\n\t\t// Set the token in the template\r\n\t\t$this->output->setArguments(array(VAR_CSRF_TOKEN => $this->input('session', 'token')));\r\n\t}", "function saveToken (string $token = '', string $id = 'default') : void {\n\t$user = getUserObject($id);\n\tif(!$user){\n\t\treturn;\n\t}\n\t$tokenProvided = true;\n\tif($token === ''){\n\t\t$token = md5(uniqid());\n\t\tfor($i = 0; $i < getConfig(\"LOGIN_TOKEN_32_CHAR_CHUNKS\") - 1; $i++){\n\t\t\t$token .= md5($token.uniqid());\n\t\t}\n\t\t$token .= md5($token);\n\t\t$tokenProvided = false;\n\t}\n\t$expiration = new DateTime('now');\n\t$expiration = $expiration->add(new DateInterval(\"PT\".getConfig(\"LOGIN_TOKEN_EXPIRATION_HOURS\").\"H\"));\n\tif($tokenProvided){\n\t\texecuteQuery(\n\t\t\t_BASE_DB_HOOK,\n\t\t\t'UPDATE user_token SET expiration = DATE_ADD(CURDATE(), INTERVAL '.getConfig(\"LOGIN_TOKEN_EXPIRATION_HOURS\").' HOUR) WHERE token = ?;',\n\t\t\t[['s' => $token]]\n\t\t);\n\t}else{\n\t\texecuteQuery(\n\t\t\t_BASE_DB_HOOK,\n\t\t\t'INSERT INTO user_token VALUES (NULL, ?, ?, ?)',\n\t\t\t[\n\t\t\t\t['i' => $user['id']],\n\t\t\t\t['s' => $token],\n\t\t\t\t['s' => $expiration->format('Y-m-d')]\n\t\t\t]\n\t\t);\n\t}\n\n\tsetcookie(getConfig(\"SITE_TITLE\").'-logintoken', $token, time() + (3600 * getConfig(\"LOGIN_TOKEN_EXPIRATION_HOURS\")), '/');\n}", "function genAuthToken(){\n $timestamp = time();\n $username = $_SESSION['userid'];\n $random = rand(0, 50);\n \n return md5( \"YANS\" . $timestamp . $username . $random );\n }", "public function init_cookie(){\n\t\tglobal $con;\n\t\t\n\t\t// generate token value...\n\t\t$token = hash('sha512', (rand() . microtime()));\n\t\t\n\t\t// insert into table\n\t\tif($con->query(\"\n\t\t\t\tINSERT INTO `tokens`(token_user,token_val)\n\t\t\t\tVALUES ($this->user_id, '$token')\n\t\t\t\t\")) {\n\t\t\t\t\n\t\t\t// now set it\n\t\t\t$_COOKIE['id'] = $token;\n\t\t\tsetcookie('id', $token, time() + (60 * 60 * 24 * 30));\n\t\t\t\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "function _generate_token($data) {\n\n //generate 32 digit random string\n $random_string = $this->_generate_rand_str();\n\n //build data array variables (required for table insert)\n if (!isset($data['expiry_date'])) {\n $data['expiry_date'] = time() + $this->default_token_lifespan;\n }\n \n $data['token'] = $random_string;\n $params = $data;\n\n if (isset($params['set_cookie'])) {\n unset($params['set_cookie']);\n }\n\n $this->model->insert($params, 'trongate_tokens');\n\n if (isset($data['set_cookie'])) {\n setcookie('trongatetoken', $random_string, $data['expiry_date'], '/');\n } else {\n $_SESSION['trongatetoken'] = $random_string;\n }\n\n return $random_string;\n }", "function createToken($name)\n{\n\t$token=NULL;\n\t$token=uniqid(rand(), true);\n\t$_SESSION[$name.'Token']=$token;\n\t$_SESSION[$name.'Token_time']=time();\n\treturn $token;\n}", "private function setToken() {\n $this->admin->rememberToken = password_hash($this->admin->username.generateSalt().time().generateSalt(), PASSWORD_DEFAULT);\n\n setcookie(\"adminUsername\", $this->admin->username, time() + 30 * 24 * 60 * 60, COOKIE_PATH, null, 1);\n setcookie(\"adminToken\", $this->admin->rememberToken, time() + 30 * 24 * 60 * 60, COOKIE_PATH, null, 1);\n\n $_SESSION['adminRemember'] = true;\n }", "function save_cookie($data) {\n //set for ~2 months\n setcookie(Main::getCookieName(), $data, time()+60*60*24*7*8);\n }", "public function createNewToken()\n {\n return $this->getBandrek()->generateToken();\n }", "function WebDPCookie(){\r\n $cookie = [\r\n \"sessionid=\",\r\n \"sessionid=\",\r\n \"sessionid=\"\r\n ];\r\n \r\n return $cookie[mt_rand(0, count($cookie) - 1)];\r\n}", "function createCookie($cookie_name,$cookie_value,$exp_time)\n\t\t{\n\t\t\t//creating the cookie\n\t\t\t$path = '/';\n\t\t\tsetcookie($cookie_name,$cookie_value,$exp_time,$path);\n\t\t}", "public function cookie()\n {\n// $a = $abc->getCookieCollection();\n $abc = $this->request->getCookieCollection();\n $abc = new Collection($abc);\n\n $token = $abc->first()->getValue();\n return $this->responseJson(['csrfToken'=>$token]);\n }", "private static function generateToken()\n {\n Session::set('csrf', bin2hex(random_bytes(32)));\n }", "function signup_token() {\n $token = bin2hex(random_bytes(32));\n $_SESSION['signup_token'] = $token;\n return $token;\n }", "public function create()\n {\n /**\n * We should destroy the 'atoken' here also \n * because the session may expired before expiration of the token\n */\n return response()->view('admin.login')->cookie(Cookie::forget('atoken'));\n }", "public function auth(){\n if(empty($_COOKIE[\"utoken\"])){\n $cookie_value = $this->uuid();\n $this->utoken = $cookie_value;\n $this->setHeader($this->utoken);\n }else{\n $this->utoken = $_COOKIE[\"utoken\"];\n $this->setHeader($this->utoken);\n }\n }", "function create_csrf_token() {\n\t$token = csrf_token();\n $_SESSION['csrf_token'] = $token;\n \t$_SESSION['csrf_token_time'] = time();\n\treturn $token;\n}", "function make_cookie($name, $value) {\nsetcookie($name, $value, time() + 60 * 24 *24 * 30, \"/\");\n}", "protected function remember($token) {\n\t\t$token = Crypter::encrypt($token.'|'.Str::random(40));\n\t\t$this->cookie($this->recaller(), $token, Cookie::forever);\n\t}", "public static function generateNewCSRFToken () {\n\t\tself::$csrf_token = base64_encode( openssl_random_pseudo_bytes(32));\n\n\t\t$_SESSION['csrf_token'] = self::$csrf_token;\n\t}", "public function token()\n {\n // echo 'pk';\n try {\n $this->heimdall->createToken();\n } catch (Exception $exception) {\n $this->heimdall->handleException($exception);\n }\n }", "function csrf_token(){\n $token = sha1( rand(1, 1000) . '$$' . date('H.i.s') . 'digg' );\n $_SESSION['csrf_token'] = $token;\n return $token;\n }", "private function generateAuthToken(){\n // generate iv\n $iv = openssl_random_pseudo_bytes(self::IVLEN);\n\t$token=[\n\t\"loggedUser\"=>$this->loggedUser,\n\t\"expires\"=>time()+3600,\n\t\"someVar\"=>\"someValue\"\n\t];\n\t$token = json_encode($token);\n $encrypted = openssl_encrypt($token, self::ALG, self::AESKEY, OPENSSL_RAW_DATA,$iv);\n $this->authToken=(base64_encode($iv.$encrypted));\n }", "function createXsrfSecret() {\n\t\t$userSystem = new SpotUserSystem($this->_db, $this->_settings);\n\t\t$secret = substr($userSystem->generateUniqueId(), 0, 8);\n\t\t\n\t\t$this->setIfNot('xsrfsecret', $secret);\n\t}", "private static function create_csrf_token() {\n\t\t$token = self::csrf_token ();\n\t\t$_SESSION ['csrf_token'] = $token;\n\t\t$_SESSION ['csrf_token_time'] = time ();\n\t\treturn $token;\n\t}", "protected function generateSessionToken() {}", "function token_generator() {\n $token = $_SESSION['token'] = md5(uniqid(mt_rand(),true));\n\n return $token;\n}", "function gen_token(){\n\t\t$secretKey = \"BismILLAHirrohmaanirrohiim\";\n\n\t\t// Generates a random string of ten digits\n\t\t$salt = mt_rand();\n\n\t\t// Computes the signature by hashing the salt with the secret key as the key\n\t\t$signature = hash_hmac('sha256', $salt, $secretKey, true);\n\n\t\t// base64 encode...\n\t\t$encodedSignature = base64_encode($signature);\n\n\t\t// urlencode...\n\t\t$encodedSignature = urlencode($encodedSignature);\n\n\t\treturn $encodedSignature;\n\t}", "function saveToken($token) {\r\n\t\t$_SESSION['token'] = $token;\r\n\t}", "public static function generate(){\r\n return Session::put(Config::get('session/token_name'), md5(uniqid()));\r\n }", "private static function set_token() {\n\t\t\t// Bring in the $session variable\n\t\t\tglobal $session;\n\t\t\t// Generate a random token of 64 length\n\t\t\t$token = self::generate_token(64);\n\t\t\t// Store it in the $_SESSION\n\t\t\t$session->set('csrf_token', $token);\n\t\t}", "function make_cookie($name, $value) {\n\tsetcookie($name, $value, time() + 60 * 60 * 24 * 30, \"/\");\n}", "public function createToken()\n\t{\n\t\t$domain = $this->config->get('app.domain');\n\n\t\t$data = [\n\t\t\t'iss' => $domain,\n\t\t\t'aud' => $domain,\n\t\t\t'iat' => time(),\n\t\t\t'exp' => time () + $this->expiration,\n\t\t];\n\n\t\t$token = JWT::encode($data, $this->config->get('app.app_key'));\n\n\t\t$this->createAuth([\n\t\t\t'token' => $token,\n\t\t\t'expires_at' => date('Y-m-d h:i:s', $data['exp'])\n\t\t]);\n\n\t\treturn $token;\n\t}", "public function generateToken($tokenExtras = array()){\n $newToken = $this->jwtToken($tokenExtras);\n $response = response()->json(['success' => ['token' => $newToken]], 200);\n\n if(env('JWT_COOKIE') == true && env('JWT_COOKIE_NAME', null)){\n $cookieName = env('JWT_COOKIE_NAME');\n $response = $response->withCookie(new Cookie($cookieName, $newToken, env('JWT_EXPIRY')));\n }\n\n return $response;\n }", "public function store()\n {\n return response('200')->cookie(\n 'cookie-popup',\n 'checked',\n time() + (365 * 24 * 60 * 60)\n );\n }", "static function generateToken() {\n $token = Cache::get(\"token\", false);\n if ($token) {\n return $token;\n } else {\n $time = floor(time() / 1000);\n $token = md5(bin2hex($time));\n new Cache(\"token\", $token);\n return $token;\n }\n }", "private function newRememberMeCookie()\n {\n // if database connection opened\n if ($this->db->isConnected()) {\n // generate 64 char random string and store it in current user data\n $random_token_string = hash('sha256', mt_rand());\n $update = $this->db->query(\n \"UPDATE users SET user_rememberme_token = :user_rememberme_token WHERE user_id = :user_id\",\n array(\n \"user_rememberme_token\"=>$random_token_string,\n \"user_id\"=>$_SESSION['user_id']\n )\n );\n\n // generate cookie string that consists of userid, randomstring and combined hash of both\n $cookie_string_first_part = $_SESSION['user_id'] . ':' . $random_token_string;\n $cookie_string_hash = hash('sha256', $cookie_string_first_part . COOKIE_SECRET_KEY);\n $cookie_string = $cookie_string_first_part . ':' . $cookie_string_hash;\n\n // set cookie\n setcookie('rememberme', $cookie_string, time() + COOKIE_RUNTIME, \"/\", COOKIE_DOMAIN);\n }\n }", "private function createCsrfToken()\n {\n return sha1(microtime().$this->getLogin());\n }", "public function setToken() {\n $base_uri = $this->remoteSite->get('protocol') . '://' . $this->remoteSite->get('host');\n $options = array(\n 'base_uri' => $base_uri,\n 'allow_redirects' => TRUE,\n 'timeout' => 5,\n 'connect_timeout' => 5,\n );\n\n $token = $this->httpClient->request('get', 'rest/session/token', $options)->getBody();\n return $token->__toString();\n }", "private function createToken()\n {\n $this->token = md5(time().uniqid());\n return true;\n }", "protected function createToken()\n {\n $currentServerIp = $this->request->server('SERVER_ADDR');\n\n $secretKey = $this->config['doublespark_contaobridge_secret_key'];\n\n return md5('phpbbbridge'.date('d/m/Y').$currentServerIp.$secretKey);\n }", "function wp_set_auth_cookie($user_id, $remember = \\false, $secure = '', $token = '')\n {\n }", "private function setToken() {\n\n /* valid register */\n $request = $this->post('/v1/register', [\n 'firstname' => 'John',\n 'lastname' => 'Doe',\n 'email' => 'john.doe@email.com',\n 'password' => 'secret',\n ]);\n\n /* valid login */\n $this->post('/v1/login', [\n 'email' => 'john.doe@email.com',\n 'password' => 'secret',\n ]);\n\n }", "protected function AddCookie($n,$v,$s) { setcookie($n,$v,time()+$s,'/'); }", "function set_login_cookies($id,$token,$empresa){\n setcookie('Activo',\"True\",time()+3600,'','','',TRUE);\n setcookie('Id',$id,time()+3600,'','','',TRUE);\n setcookie('token',$token,time()+3600,'','','',TRUE);\n setcookie('empresa',isset($empresa)?$empresa:0,time()+3600,'','','',TRUE);\n }", "public function generateToken();", "function expire_token() {\n return time() + (60 * 60 * 24);\n}", "protected function generate_tok()\r\n {\r\n return $_SESSION['token'] = base64_encode(openssl_random_pseudo_bytes(32));\r\n }", "function createsessions($username,$password,$remme=\"no\") \n{\n \n\n $_SESSION[\"gusername\"] = $username; \n $_SESSION[\"gpassword\"] = $password; \n \n if($remme==\"yes\") \n { \n //Add additional member to cookie array as per requirement \n setcookie(\"gusername\", $_SESSION['gusername'], time()+60*60*24*100, \"/\"); \n setcookie(\"gpassword\", $_SESSION['gpassword'], time()+60*60*24*100, \"/\"); \n return; \n } \n}", "function generateToken($varname){\n\t\t$token = bin2hex(random_bytes(16));\n\t\tcreateSession($varname,$token);\n\t\treturn $token;\n\t}", "function create_token($filename = '.token')\n{\n try {\n $dir = VAR_FOLDER . DS;\n if (!file_exists($dir)) {\n mkdir($dir, 0755, true);\n }\n $file = fopen($dir . DS . $filename, \"w\");\n fwrite($file, bin2hex(random_bytes(32)) . \"\\n\");\n fclose($file);\n } catch (Exception $e) {\n throw new Exception($e->getMessage(), $e->getCode());\n }\n}", "function __construct() {\n //Set csrf_token cookie\n setcookie('csrf_token','',time()+(60*30),'/');\n }", "public function storeSessionKey( $cookie ) {\n\t\t$cookie = wp_parse_auth_cookie( $cookie, 'logged_in' );\n\t\t$this->sessionToken = ! empty( $cookie['token'] ) ? $cookie['token'] : '';\n\t}", "private function generate_nonce () {\n $c = [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 'a', 'b', 'c', 'd', 'e', 'f' ];\n $count = count($c);\n $nonce = '';\n for ($i = 0; $i < 32; $i++) {\n $nonce .= $c[rand(0, $count)];\n }\n // save nonce as domain cookie\n // expires with current browser session\n setcookie('sso_nonce', $nonce, 0, '/');\n return $nonce;\n }", "function add_cookie($name,$value,$time_litmit){\n setcookie($name,$value,time() + ($time_litmit * 86400));\n }", "function generateCandiToken($name){\t\n\t$mydate = getdate();\n\t$token = sha1($name.\"candidate\");\n\treturn $token;\n}", "function create_client_token(){\n \t$clientToken = Braintree_ClientToken::generate();\n \treturn $clientToken;\n }", "function save_cookie_from_browser($domain = \"\")\n\t{\n\t\t// .meonyou.com TRUE / FALSE 0 PHPSESSID 8p47p0c8g65kjtfnl7gjs4u5k2\n\t\t// www.meonyou.com FALSE / FALSE 1267546450 track a%3A4%3A%7Bs%3A12%3A%22affiliate_id%22%3Bs%3A1%3A%221%22%3Bs%3A10%3A\n\n\t}", "function createToken() {\n\treturn bin2hex(openssl_random_pseudo_bytes(32));\n}", "function cookie($name, $value, $time){\n setCookie($name, $value, $time, \"/\", \"www.cubebomb.com\");\n}", "abstract public function persistSessionToken() ;", "private static function cookieLifetime()\n {\n return time() + (self::ACCESS_TOKEN_EXPIRES_DAYS * 24 * 60 * 60);\n }", "private function createOwnToken($request)\n {\n $own_token = substr(str_shuffle('azertyuiopqsdfghjklmwxcvbn123456789'), 0, 12);\n $request->getSession()->set(self::OWN_TOKEN_NAME, $own_token);\n return $own_token;\n }", "function saveCookie($id){\r\n\tsetcookie(\"r$id\", strval(time()), time()+60*60*24*365);\t\r\n}", "function getAuthentication() {\n if (isset($_COOKIE['auth-token'])) {\n header('HTTP/1.1 200 OK');\n\n // Get the token from the cookie\n $token = $_COOKIE['auth-token'];\n\n // Refresh the cookie\n setcookie('auth-token', $token, time() + (1000 * 60 * 60 * 24), \"/\");\n\n // Return the token\n $response = new stdClass;\n $response->token = $token;\n return json_encode($response);\n } else {\n header('HTTP/1.1 401 Unauthorized');\n return 'No authentication present. Please log in.';\n }\n}", "private function newCookie($username, $rememberme) {\n $hash = md5(microtime()); // unique cookie hash\n // Fetch User ID :\n $queryUid = $this->db->select(\"SELECT userID FROM \".PREFIX.\"users WHERE username=:username\", array(':username' => $username));\n $uid = $queryUid[0]->userID;\n // Delete all previous cookies :\n $this->db->delete(PREFIX.'sessions', array('username' => $username));\n $ip = $_SERVER['REMOTE_ADDR'];\n\t\tif($rememberme == \"true\"){\n\t\t\t// User wants to be remembered for a while\n\t\t\t$expiredate = date(\"Y-m-d H:i:s\", strtotime(SESSION_DURATION_RM));\n\t\t}else{\n\t\t\t$expiredate = date(\"Y-m-d H:i:s\", strtotime(SESSION_DURATION));\n\t\t}\n $expiretime = strtotime($expiredate);\n $this->db->insert(PREFIX.'sessions', array('uid' => $uid, 'username' => $username, 'hash' => $hash, 'expiredate' => $expiredate, 'ip' => $ip));\n\t\t// Check to see if user checked the remember me box\n\t\tCookie::set('auth_cookie', $hash, $expiretime, \"/\", FALSE);\n }", "function get_cookie_secret(){\n $file = dirname(__FILE__).'/../cache/.htcookiesecret.php';\n if(@file_exists($file)){\n return md5(trim(file($file)));\n }\n\n $secret = '<?php #'.(rand()*time()).'?>';\n if(!$fh = fopen($file,'w')) die(\"Couldn't write to $file\");\n if(fwrite($fh, $secret) === FALSE) die(\"Couldn't write to $file\");\n fclose($fh);\n\n return md5($secret);\n}", "public function storeSessionTokenInRegistry() {}", "public function generateCSRFToken();", "public function getSignedToken(Cookie $cookie, ?int $lifetime = null) : string;", "function WriteTokenFile()\n {\n if ($this->getTokenUsePickupFile()) {\n $fname = $this->getTokenPickupFile();\n $fh = fopen($fname, \"w+\");\n fwrite($fh, $this->_props['RequestToken']);\n fclose($fh);\n }\n }", "function generate_token()\n\t{\n\t return sha1(base64_encode(openssl_random_pseudo_bytes(30)));\n\t}", "public function create()\n {\n parent::create();\n\n $this->response->setCookie($this->cookieName, $this->id, 0, $this->cookiePath, $this->cookieDomain);\n }", "public static function generate(){\n\t\treturn Session::put(Config::get('session/token_name'), md5(uniqid()));\t\t// Now we build the session class to utilis this method.\n\t}", "public function persistSessionToken() {}", "public function persistSessionToken() {}", "public function persistSessionToken() {}", "public function persistSessionToken() {}", "function login_token() {\n $token = bin2hex(random_bytes(32));\n $_SESSION['login_token'] = $token;\n return $token;\n }", "private function generateToken()\n {\n return hash('SHA256', uniqid((double) microtime() * 1000000, true));\n }", "private function getToken()\n {\n return uniqid();\n }" ]
[ "0.7273649", "0.72545207", "0.6626834", "0.65807796", "0.65520126", "0.65477735", "0.6544636", "0.6431241", "0.64227", "0.639029", "0.63128245", "0.6273016", "0.6198709", "0.6198588", "0.6194366", "0.61768043", "0.6176363", "0.61607593", "0.61593723", "0.6150298", "0.61182654", "0.61175525", "0.61031926", "0.60849863", "0.6077946", "0.60710496", "0.60611665", "0.6057186", "0.6055076", "0.6032306", "0.6028411", "0.6028254", "0.6017445", "0.5993872", "0.599284", "0.59746104", "0.59716713", "0.59700304", "0.59653896", "0.59584504", "0.59402686", "0.59378636", "0.59328717", "0.592908", "0.59245205", "0.59244084", "0.5921336", "0.5918687", "0.59156793", "0.5914909", "0.58921945", "0.589215", "0.5883717", "0.5873301", "0.58700883", "0.586808", "0.5857488", "0.5846565", "0.5840546", "0.58303154", "0.5819418", "0.5816664", "0.5787163", "0.57852656", "0.5778167", "0.5769645", "0.5765556", "0.57611656", "0.57586604", "0.5750614", "0.57468927", "0.5740911", "0.57355237", "0.573398", "0.5712545", "0.5711477", "0.5706379", "0.56954116", "0.56715983", "0.5670709", "0.56706625", "0.5669207", "0.56639683", "0.565927", "0.565105", "0.5626786", "0.5618783", "0.5617382", "0.56173193", "0.5616744", "0.5615862", "0.56123984", "0.5601379", "0.5599453", "0.5599453", "0.5599453", "0.5599453", "0.5599437", "0.55939955", "0.5591121" ]
0.6518886
7
Specify data which should be serialized to JSON
public function jsonSerialize() { return (string)$this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract protected function serializeData();", "public function _jsonSerialize();", "public function jsonSerialize()\n {\n }", "public function jsonSerialize()\n {\n }", "public function jsonSerialize();", "public function jsonSerialize();", "public function jsonSerialize();", "public function jsonSerialize();", "public function jsonSerialize();", "public function jsonSerialize();", "public function jsonSerialize();", "public function jsonSerialize();", "public function serialize($data)\n {\n }", "public function _serialize($data)\n\t{\n\t\treturn json_encode($data);\n\t}", "final public function jsonSerialize() {}", "public function serialize($data);", "abstract public function serialize($data);", "public static function EncodeJson (& $data);", "private function serializeData($data)\n {\n //$normalizer = ;\n //$normalizer->setIgnoredAttributes(['__initializer__','__cloner__','__isInitialized__']);\n\n $encoders = [new JsonEncoder()];\n $normalizers = [new ObjectNormalizer()];\n\n $serializer = new Serializer($normalizers, $encoders);\n return $serializer->serialize(\n $data,\n 'json',\n [AbstractNormalizer::IGNORED_ATTRIBUTES => [\n '__initializer__',\n '__cloner__',\n '__isInitialized__'\n ]]\n );\n }", "function jsonSerialize()\n {\n $data = $this->data;\n foreach ($this->config as $name => $c) {\n if (is_callable($c['serializer'])) {\n $data[$name] = call_user_func($c['serializer'], $data['name']);\n }\n }\n return $data;\n }", "public function getDataAsJSON()\n {\n $result = array();\n if ($serializeData = $this->getSerializeData()) {\n $result = $serializeData;\n }\n elseif (!empty($this->_inputsToSerialize)) {\n return '{}';\n }\n return Mage::helper('core')->jsonEncode($result);\n }", "private function json($data){\r\n if(is_array($data)){\r\n return json_encode($data);\r\n }\r\n else return json_encode($data);\r\n }", "public function jsonSerialize()\n {\n // TODO: Implement jsonSerialize() method.\n }", "public function get_data_type() { return \"json\"; }", "private function json($data) {\n if (is_array($data)) {\n return json_encode($data);\n }\n }", "private function json($data){\r\n\t\t\tif(is_array($data)){\r\n\t\t\t\treturn json_encode($data);\r\n\t\t\t}\r\n\t\t}", "private function json($data)\n {\n if(is_array($data)){\n return json_encode($data);\n }\n }", "private function json($data){\n\t\t\tif(is_array($data)){\n\t\t\t\treturn json_encode($data);\n\t\t\t}\n\t\t}", "private function json($data){\n\t\t\tif(is_array($data)){\n\t\t\t\treturn json_encode($data);\n\t\t\t}\n\t\t}", "private function json($data){\n\t\t\tif(is_array($data)){\n\t\t\t\treturn json_encode($data);\n\t\t\t}\n\t\t}", "private function json($data){\n\t\t\tif(is_array($data)){\n\t\t\t\treturn json_encode($data);\n\t\t\t}\n\t\t}", "private function json($data){\n\t\t\tif(is_array($data)){\n\t\t\t\treturn json_encode($data);\n\t\t\t}\n\t\t}", "private function json($data){\n\t\t\tif(is_array($data)){\n\t\t\t\treturn json_encode($data);\n\t\t\t}\n\t\t}", "protected function jsonEncode($data){\n\t\treturn json_encode($data);\n\t}", "private function json($data){\n\t\tif(is_array($data)){\n\t\t\treturn json_encode($data);\n\t\t}\n\t}", "function jsonSerialize();", "private function json($data){\n\t\tif(is_array($data)){\n\t\t\tif (getParameter('f')) {\n\t\t\t\tswitch(getParameter('f')){\n\t\t\t\t\tcase \"json\":\n\t\t\t\t\t\treturn json_encode($data);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"pjson\":\n\t\t\t\t\t\tif(defined(JSON_PRETTY_PRINT))\n\t\t\t\t\t\t{\t\n\t\t\t\t\t\t\treturn json_encode($data, JSON_PRETTY_PRINT);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\t\n\t\t\t\t\t\t\treturn json_encode($data);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\t\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\telse return $data;\n\t\t}\n\t}", "protected function json($data){\n\t\tif(is_array($data)){\n\t\t\tif($this->_prettyPrint === true) return $this->prettyJSON(json_encode($data)); //Pretty?\n\t\t\telse return json_encode($data);\n\t\t}\n\t}", "protected function serializeData($data) {\n return $data;\n }", "private function json($data) {\n if (is_array($data)) {\n return json_encode($data);\n }\n }", "private function json($data)\n\t\t{\n\t\t\tif (is_array($data))\n\t\t\t{\n\t\t\t\treturn json_encode($data);\n\t\t\t}\n\t\t}", "protected function createJsonBody($data)\n {\n\t\t\n $data = array_merge($this->getDefaultParameters(), $data);\n return json_encode($data);\n }", "public function jsonSerialize()\n {\n $this->serializeWithId($this->resolveFields(\n resolve(Request::class)\n ));\n }", "protected function jsonEncode($data) : string {\r\n return $this->getServicingSqlInstance()->jsonEncode($data);\r\n }", "public function toJson();", "public function toJson();", "public function serialize()\n\t{\n\t\treturn json_encode(array(\n\t\t\t'data' => $this->data,\n\t\t\t'this' => $this->getArrayCopy(),\n\t\t\t'name' => $this->name,\n\t\t\t'merged' => $this->merged,\n\t\t));\n\t}", "public function buildJson();", "function jsonSerialize() {\n $data = array();\n if ($this->getStreet()) {\n $data[self::FIELDNAME_STREET] = $this->getStreet();\n }\n if ($this->getZip()) {\n $data[self::FIELDNAME_ZIP] = $this->getZip();\n }\n if ($this->getCity()) {\n $data[self::FIELDNAME_CITY] = $this->getCity();\n }\n if ($this->getCountry()) {\n $data[self::FIELDNAME_COUNTRY] = $this->getCountry();\n }\n if ($this->getCoordinate()) {\n $data[self::FIELDNAME_COORDINATE] = $this->getCoordinate();\n }\n return $data;\n }", "public function jsonSerialize() {\n\n return ['id' => $this->id,\n 'name' => $this->name,\n 'author' => $this->author,\n 'description' => $this->description];\n \n \n }", "abstract protected function getAdditionalJsonData(): array;", "public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "public function jsonSerialize()\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "public static function toJSON($data) {\n\t\tif (function_exists('json_encode'))\n\t\t\treturn json_encode($data);\n\t\trequire_once('Zend/Json/Encoder.php');\n\t\treturn Zend_Json_Encoder::encode($data);\n\t}", "public function toJson($data)\n {\n if (is_string($data)) {\n return $data;\n }\n\n return json_encode($data);\n }", "public function jsonSerialize():mixed\n {\n return ObjectSerializer::sanitizeForSerialization($this);\n }", "public function toJSON() {\n return json_encode($this->data);\n }", "private function json($data){\n header('Content-type: application/json');\n return json_encode($data);\n }", "public function jsonSerialize()\n {\n $this->present();\n\n return $this->data;\n }", "function json_encode($data, $options = 0) {\n\t\t\t// currently the $options parameter does nothing\n\t\t\t// it's there only for PHP not to shout when using the two parameter version\n\t\t\t$json = new Services_JSON();\n\t\t\treturn($json->encode($data));\n\t\t}", "public function serializeJSON($data) {\n $serializer = SerializerBuilder::create()->build();\n $raw = $serializer->serialize($data, 'json');\n return addslashes($raw); //escapando la comilla simple en el texto de la descripcion y el resumen\n }", "public function setData(mixed $data = []): static\n {\n $options = JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES;\n\n $this->jsonEncodingOptions = app()->environment() === 'production' ? $options : $options | JSON_PRETTY_PRINT;\n \n $this->data = match(true) {\n $data instanceof Jsonable => $data->toJson($this->jsonEncodingOptions),\n $data instanceof JsonSerializable => json_encode($data->jsonSerialize(), $this->jsonEncodingOptions),\n $data instanceof Arrayable => json_encode($data->toArray(), $this->jsonEncodingOptions),\n default => json_encode($data, $this->jsonEncodingOptions),\n };\n\n if ( ! $this->hasJsonValidOptions(json_last_error())) {\n throw new InvalidArgumentException(__('Http.invalidJson', [json_last_error_msg()]));\n }\n\n return $this->setJson($this->data);\n }", "public function setJSON($data) {\n\t\t$this->json = $data;\n\t}", "abstract protected function serializeData($unSerializedData);", "function _json_encode($data) {\n\t\treturn json_encode($data);\n\t\treturn json_encode($data, JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_QUOT | JSON_HEX_AMP);\n\t}", "private function convertirJson($data){\n\t\treturn json_encode($data);\n\t}" ]
[ "0.73922014", "0.72721684", "0.7240127", "0.7240127", "0.7198893", "0.7198893", "0.7198893", "0.7198893", "0.7198893", "0.7198893", "0.7198893", "0.7198893", "0.71613514", "0.70694405", "0.70473385", "0.6964501", "0.69370866", "0.68387365", "0.6740888", "0.6735019", "0.673192", "0.6718874", "0.67143035", "0.6630896", "0.6602122", "0.6573843", "0.65477306", "0.65296537", "0.65296537", "0.65296537", "0.65296537", "0.65296537", "0.65296537", "0.65114444", "0.6507419", "0.6505585", "0.6498021", "0.6496315", "0.6491337", "0.6490383", "0.649003", "0.64507073", "0.64309525", "0.64259", "0.64244705", "0.64244705", "0.6418254", "0.64079326", "0.6394383", "0.6378091", "0.6371355", "0.63696355", "0.63696355", "0.63696355", "0.63696355", "0.63696355", "0.63696355", "0.63696355", "0.63696355", "0.63696355", "0.63696355", "0.63696355", "0.63696355", "0.63696355", "0.63696355", "0.63696355", "0.63696355", "0.63696355", "0.63696355", "0.63696355", "0.63696355", "0.63696355", "0.63696355", "0.63696355", "0.63696355", "0.63696355", "0.63696355", "0.63696355", "0.63696355", "0.63696355", "0.63696355", "0.63696355", "0.63696355", "0.63696355", "0.63696355", "0.63696355", "0.63696355", "0.63696355", "0.6368018", "0.6354936", "0.6349313", "0.6319698", "0.63153905", "0.63121027", "0.6298126", "0.6297013", "0.62940544", "0.62939775", "0.6285292", "0.62811565", "0.62804234" ]
0.0
-1
Get the instance as an array.
public function toArray(): array { return $this->getAllItems(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function instanceToArray() : array{\n\n if(!method_exists(self::class,'instance')):\n return [];\n endif;\n\n return self::instance()->toArray();\n }", "public function toArray($instance): array;", "public function getAsArray();", "public function toArray() {\n return (array)$this;\n }", "function asArray(){\n\t\t\t$array = $this->toArray( $this );\n\t\t\treturn $array;\n\t\t}", "public function toArray()\n {\n return (array)$this;\n }", "public function toArray()\n {\n return (array)$this;\n }", "public function toArray()\n {\n return (array)$this;\n }", "public function toArray() {\n\t\treturn $this->array;\n\t}", "public function as_array()\n\t{\n\t\treturn $this->getArrayCopy();\n\t}", "public function toArray() {\n return $this->array;\n }", "public function toArray()\n {\n return $this->cast('array');\n }", "public function & toArray()\n\t{\n\t\t$x = new ArrayObject($this->data);\n\t\treturn $x;\n\t}", "public function asArray()\r\n {\r\n return $this->data;\r\n }", "public function getArray() : array {\n return $this->getArrayCopy();\n }", "public function toArray() :array {\n return get_object_vars($this);\n }", "public function asArray()\n {\n return $this->data;\n }", "public function toArray(): array {\n\t\treturn $this->array;\n\t}", "public function toArray() // untested\n {\n return $this->data;\n }", "public function getAsArray()\n\t{\n\t\t\n\t\t$path = $this->get();\n\t\t\n\t\treturn self::toArray($path);\n\t\t\n\t}", "public function toArray() : array{\n return get_object_vars( $this );\n }", "public function toArray() {}", "public function toArray() {}", "public function toArray() {}", "public function toArray() {}", "public function toArray() {}", "public function toArray() {}", "public function toArray() {}", "public function toArray() {}", "public function toArray() {}", "public function toArray() {}", "public function toArray() {}", "public function toArray() {}", "public function toArray() {}", "public function toArray() {}", "public function toArray() {}", "public function toArray() {}", "public function asArray()\n {\n return iterator_to_array($this, false);\n }", "public function asArray();", "public function asArray();", "public function asArray();", "public function asArray();", "public function asArray();", "public function asArray();", "public function asArray(){\n return $this->data;\n }", "public function to_array()\n\t{\n\t\treturn $this->getArrayCopy();\n\t}", "public function toArray()\n\t{\n\t\treturn array();\n\t}", "public function __toArray(): array\n {\n return call_user_func('get_object_vars', $this);\n }", "public function toArray(){\n $this->buildArray();\n return $this->array;\n }", "public function getArray()\n {\n return $this->get(self::_ARRAY);\n }", "public /*array*/ function toArray()\n\t{\n\t\treturn $this->_data;\n\t}", "public function toArray() {\n\t\treturn $this->data;\n\t}", "public function asArray() : array\n {\n return $this->a;\n }", "public function toArray()\n {\n return json_decode(json_encode($this), true);\n }", "public function toArray()\n {\n return json_decode(json_encode($this), true);\n }", "public function toArray() {\n return json_decode(json_encode($this), true);\n }", "public function toArray()\n {\n // TODO: Implement toArray() method.\n }", "public function toArray()\n {\n // TODO: Implement toArray() method.\n }", "public function asArray()\n {\n }", "public function getArray()\n {\n return iterator_to_array($this->getIterator());\n }", "public function __toArray()\n {\n return $this->toArray();\n }", "function toArray(){\r\n\t\treturn $this->data;\r\n\t}", "public function toArray()\n {\n return get_object_vars($this);\n }", "public function toArray(): array\r\n {\r\n return get_object_vars($this);\r\n }", "public function toArray() {\n return get_object_vars($this);\n }", "public function toArray()\n {\n return $this->_data;\n }", "public function toArray()\n {\n return $this->_data;\n }", "public function toArray() : array\n {\n return $this->data;\n }", "function toArray() {\n\t\treturn get_object_vars($this);\n\t}", "function toArray() {\n\t\treturn get_object_vars($this);\n\t}", "function toArray() {\n\t\treturn get_object_vars($this);\n\t}", "function toArray() {\n\t\treturn get_object_vars($this);\n\t}", "function toArray() {\n\t\treturn get_object_vars($this);\n\t}", "function toArray() {\n\t\treturn get_object_vars($this);\n\t}", "function toArray() {\n\t\treturn get_object_vars($this);\n\t}", "function toArray() {\n\t\treturn get_object_vars($this);\n\t}", "function toArray() {\n\t\treturn get_object_vars($this);\n\t}", "public function getArray()\n {\n return $this->array;\n }", "public function getArray() {\n\t\treturn $this->data; \n\t}", "public function getArray() {\n\t\treturn $this->data; \n\t}", "public function toArray() {\n return get_object_vars($this);\n }", "public function AsArray();", "public function toArray()\r\n {\r\n return $this->data;\r\n }", "public function toArray(): array\n {\n // TODO: Implement toArray() method.\n }", "public function toArray(): array\n {\n return $this->data;\n }", "public function toArray(): array\n {\n return $this->data;\n }", "public function toArray(): array;", "public function toArray(): array;", "public function toArray(): array;", "public function toArray(): array;", "public function toArray(): array;", "public function toArray(): array;", "public function toArray(): array;", "public function toArray(): array;", "public function toArray(): array;", "public function toArray(): array;", "public function toArray(): array;", "public function toArray(): array;", "public function toArray(): array;", "public function toArray(): array;", "public function toArray(): array;" ]
[ "0.8586067", "0.8149433", "0.8079457", "0.79264486", "0.7908912", "0.7838473", "0.7838473", "0.7838473", "0.780033", "0.77830833", "0.77460957", "0.7715183", "0.77072406", "0.7675213", "0.76627564", "0.76547265", "0.7646425", "0.7642839", "0.7633185", "0.76251376", "0.75999", "0.75990415", "0.75990415", "0.75990397", "0.75990397", "0.75990397", "0.75990397", "0.75984627", "0.75984627", "0.75984627", "0.75984627", "0.75984627", "0.75984627", "0.75984627", "0.75984627", "0.75984627", "0.75984627", "0.7568166", "0.75630414", "0.75630414", "0.75630414", "0.75630414", "0.75630414", "0.75630414", "0.7561616", "0.7553083", "0.75371873", "0.7533647", "0.7533232", "0.75254655", "0.7525133", "0.74999696", "0.74944735", "0.7482524", "0.7482524", "0.74754715", "0.7471454", "0.7471454", "0.74672604", "0.7458071", "0.74568856", "0.7455964", "0.7454711", "0.7443756", "0.74346924", "0.7432348", "0.7432348", "0.7432152", "0.74275774", "0.74275774", "0.74275774", "0.74275774", "0.74275774", "0.74275774", "0.74275774", "0.74275774", "0.74275774", "0.74264014", "0.73996806", "0.73996806", "0.73940927", "0.7387029", "0.73844415", "0.7384306", "0.7382375", "0.7382375", "0.7379744", "0.7379744", "0.7379744", "0.7379744", "0.7379744", "0.7379744", "0.7379744", "0.7379744", "0.7379744", "0.7379744", "0.7379744", "0.7379744", "0.7379744", "0.7379744", "0.7379744" ]
0.0
-1
Create a new job instance.
public function __construct($post) { $this->post = $post; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function createJob( $creationParameters ){ return $this->APICallSub( '/jobs', array( 'create' => $creationParameters ), \"Could not create new job with query \" . $creationParameters['query'] . \" and operation \" . $creationParameters['operation'] ); }", "abstract public function makeJob();", "abstract public function makeJob();", "private function createSearchJob() {\n $response = $this->client->request('POST','search/jobs', [\n 'json' => [\n 'query' => $this->getSumoQuery(),\n 'from' => $this->start->format(DateTime::ATOM),\n 'to' => $this->end->format(DateTime::ATOM),\n 'timeZone' => $this->profile->getTimezone()\n ]\n ]);\n $code = $response->getStatusCode();\n if ($code !== 202) {\n throw new \\Exception('Error getting data from Sumologic, error was HTTP ' . $code . ' - ' . $response->getBody() . '.');\n }\n $data = json_decode($response->getBody());\n $this->jobId = $data->id;\n if ($this->output->isVerbose()) {\n $this->output->writeln(\" > Debug: Search job ID {$this->jobId} created.\");\n }\n }", "public function createJobObject($payload)\n {\n $job = new Job([\n 'title' => $payload['title'],\n 'name' => $payload['title'],\n 'description' => $payload['description'],\n 'url' => $payload['url'],\n 'location' => $payload['locations'],\n ]);\n\n $job->setCompany($payload['company'])\n ->setDatePostedAsString($payload['date'])\n ->setBaseSalary($payload['salary']);\n\n return $job;\n }", "public function createJobExecution(JobInstance $job)\n {\n return new JobExecution();\n }", "public function setJobName(string $jobName): JobInstanceInterface;", "public function __construct(Job $job)\n {\n $this->job = $job;\n }", "public static function createJob($project, $jobOptions, $parentJob = null) {\n\n // Check if the job must be CC\n $isCC = ($jobOptions->getProjectJobFileType() && $jobOptions->getProjectJobFileType() == ProjectJobFile::TYPE_CC);\n\n if ($jobOptions->getJobType())\n Subtitle::defineSubtitleExtension($jobOptions->getJobType());\n\n // Get job type service id\n $jobOptionsTypeService = JobTypeService::model()->byJobTypeAndService(\n $jobOptions->getJobType(),\n $jobOptions->getService()\n )->find();\n\n // Set attributes\n $projectJob = new PRMProjectJob();\n $projectJob->source_lang_id = $jobOptions->getSourceLanguage();\n $projectJob->target_lang_id = $jobOptions->getTargetLanguage();\n $projectJob->project_id = $project->id;\n $projectJob->job_type_id = $jobOptions->getJobType();\n $projectJob->job_type_service_id = $jobOptionsTypeService->id;\n $projectJob->subtitle_provided = $jobOptions->isSubtitleProvided() ? 1 : 0;\n $projectJob->status = parent::STATUS_NEW;\n $projectJob->due_date = $jobOptions->getDueDate();\n $projectJob->is_billable = ($jobOptions->getJobType() != JobType::TYPE_ACCEPTANCE) ? 1 : 0;\n $projectJob->is_cc = (int) $isCC;\n $projectJob->forced_subtitle = $jobOptions->getIsForced() ? 1 : 0;\n $projectJob->job_meta_type_id = $jobOptions->getMetaType();\n\n if($projectJob->save(false)) {\n\n $deliverySpecComponent = new DeliverySpecComponent();\n $projectJobPreference = $deliverySpecComponent->copyTerritoriesToJobPreferences($projectJob, $project->delivery_spec_id);\n // Set max_box_lines = 3 for CC jobs\n if($projectJobPreference instanceof ProjectJobPreference && $isCC) {\n $projectJobPreference->max_box_lines = 3;\n $projectJobPreference->save(false);\n }\n\n ProjectBreakdownReport::create(ProjectBreakdownReportActions::TASK_ADDED)\n ->forProjectJob($projectJob)\n ->save();\n\n if ($project->user_id){\n PUserJob::model()->assignJob($project->user_id, $projectJob->id);\n }\n\n ProjectJobParent::link($parentJob ? $parentJob->id : 0, $projectJob->id);\n\n if ($jobOptions->getOutputSupportedFile() instanceof ProjectSupportedFile) {\n $deliverableFile = new ProjectJobDeliverableFiles();\n $deliverableFile->project_job_id = $projectJob->id;\n $deliverableFile->project_supported_file_id = $jobOptions->getOutputSupportedFile()->id;\n $deliverableFile->file_name = $jobOptions->getOutputFileName();\n\n if ($jobOptions->getOutputPositioningType()){\n $deliverableFile->positioning_profile = \"0;{$jobOptions->getOutputPositioningType()};{$jobOptions->getOutputAspect()};{$jobOptions->getOutputAspectRatio()}\";\n }\n\n $deliverableFile->save(false);\n }\n\n // Return job\n return $projectJob;\n }\n\n return false;\n }", "public function createJobObject($payload)\n {\n $job = new Job;\n\n $map = $this->getJobSetterMap();\n\n array_walk($map, function ($path, $setter) use ($payload, &$job) {\n try {\n $value = static::getValue(explode('.', $path), $payload);\n $job->$setter($value);\n } catch (\\OutOfRangeException $e) {\n // do nothing\n }\n });\n\n return $job;\n }", "public function create(JobRequest $jobRequest)\n {\n $job = new Job();\n\n $job->business_person = $jobRequest->business_person;\n $job->principal_phone = $jobRequest->principal_phone;\n $job->optional_phone = $jobRequest->optional_phone;\n $job->init_date = $jobRequest->init_date;\n $job->finish_date = $jobRequest->finish_date;\n $job->city = $jobRequest->city;\n\n $job->save();\n\n return compact('job');\n }", "public function createNewJob($jobBody, $queue)\n {\n $job = new Job($jobBody, $queue);\n\n if ($this->jobHasBeenAddedFromOutside($job)) {\n $this->addMissingJobTimeData($job);\n }\n\n return $job;\n }", "protected function createJobFromPayload($payload = [])\n {\n return new Job([\n 'title' => $payload['jobTitle'],\n 'name' => $payload['jobTitle'],\n 'description' => $payload['descriptionFragment'],\n 'url' => $payload['jobViewUrl'],\n 'sourceId' => $payload['jobListingId'],\n 'location' => $payload['location'],\n 'industry' => $payload['jobCategory']\n ]);\n }", "public function created(Job $job)\n {\n //\n }", "protected function generateJob()\n\t{\n\t\t$name = $this->inflector->getJob();\n\n\t\t$this->call('make:job', compact('name'));\n\t}", "public static function create()\n\t{\n\t\t//check, if a JobController instance already exists\n\t\tif(JobController::$jobController == null)\n\t\t{\n\t\t\tJobController::$jobController = new JobController();\n\t\t}\n\n\t\treturn JobController::$jobController;\n\t}", "static public function factory($job, $conn, $handle, $initParams=array())\n {\n if (empty($initParams['path'])) {\n $paths = explode(',', NET_GEARMAN_JOB_PATH);\n $file = null;\n\n foreach ($paths as $path) {\n $tmpFile = $path . '/' . $job . '.php';\n\n if (file_exists(realpath($tmpFile))) {\n $file = $tmpFile;\n break;\n }\n }\n }\n else {\n $file = $initParams['path'];\n }\n\n if ( ! file_exists($file) ) {\n throw new Net_Gearman_Job_Exception('Invalid Job class file: ' . (empty($file) ? '<empty>' : $file));\n }\n\n include_once $file;\n\n if (empty($initParams['class_name'])) {\n $class = NET_GEARMAN_JOB_CLASS_PREFIX . $job;\n }\n else {\n $class = $initParams['class_name'];\n }\n\n if (!class_exists($class)) {\n throw new Net_Gearman_Job_Exception('Invalid Job class: ' . (empty($class) ? '<empty>' : $class) . ' in ' . (empty($file) ? '<empty>' : $file) );\n }\n\n $instance = new $class($conn, $handle, $initParams);\n if (!$instance instanceof Net_Gearman_Job_Common) {\n throw new Net_Gearman_Job_Exception('Job is of invalid type: ' . get_class($instance));\n }\n\n return $instance;\n }", "public function creating(Job $job)\n {\n $job->setTokenValue();\n $job->setExpiresAtValue();\n $job->is_activated = 1;\n }", "private function createJob (string $cronTab) : CronJobInterface\n {\n return new class ($cronTab) implements CronJobInterface\n {\n /** @var string */\n private $cronTab;\n\n\n /**\n */\n public function __construct (string $cronTab)\n {\n $this->cronTab = $cronTab;\n }\n\n\n /**\n */\n public function getCronTab () : string\n {\n return $this->cronTab;\n }\n\n\n /**\n */\n public function getName () : string\n {\n return \"My Job\";\n }\n\n\n /**\n */\n public function execute (BufferedSymfonyStyle $io) : CronStatus\n {\n return new CronStatus(true);\n }\n };\n }", "private function createJob(array $data = [])\n {\n $workflow = fake(WorkflowModel::class);\n $stage = fake(StageModel::class, [\n 'action_id' => 'info',\n 'workflow_id' => $workflow->id,\n 'required' => 1,\n ]);\n fake(StageModel::class, [\n 'action_id' => 'button',\n 'workflow_id' => $workflow->id,\n 'required' => 0,\n ]);\n\n $data = array_merge([\n 'workflow_id' => $workflow->id,\n 'stage_id' => $stage->id,\n ], $data);\n\n return fake(JobModel::class, $data);\n }", "public function getNewJob() {\n # we can grab a locked job if we own the lock\n $rs = $this->runQuery(\"\n SELECT id\n FROM \" . self::$jobsTable . \"\n WHERE queue = ?\n AND (run_at IS NULL OR NOW() >= run_at)\n AND (locked_at IS NULL OR locked_by = ?)\n AND failed_at IS NULL\n AND attempts < ?\n ORDER BY created_at DESC\n LIMIT 10\n \", array($this->queue, $this->name, $this->max_attempts));\n\n // randomly order the 10 to prevent lock contention among workers\n shuffle($rs);\n\n foreach ($rs as $r) {\n $job = new DJJob($this->name, $r[\"id\"], array(\n \"max_attempts\" => $this->max_attempts,\n \"fail_on_output\" => $this->fail_on_output\n ));\n if ($job->acquireLock()) return $job;\n }\n\n return false;\n }", "public function store(Request $request): JobResource\n {\n $jobTypes = Factory::listTypes();\n $validValues = $this->validate(\n $request,\n [\n 'sample_code' => ['filled', 'string', 'alpha_dash'],\n 'name' => ['required', 'string'],\n 'type' => ['required', 'string', Rule::in($jobTypes->pluck('id'))],\n 'parameters' => ['filled', 'array'],\n ]\n );\n $parametersValidation = $this->_prepareNestedValidation(\n Factory::validationSpec($validValues['type'], $request)\n );\n $validParameters = $this->validate($request, $parametersValidation);\n $type = $validValues['type'];\n $validParameters = $validParameters['parameters'] ?? [];\n $job = Job::create(\n [\n 'sample_code' => $validValues['sample_code'] ?? null,\n 'name' => $validValues['name'],\n 'job_type' => $type,\n 'status' => Job::READY,\n 'job_parameters' => [],\n 'job_output' => [],\n 'log' => '',\n 'user_id' => \\Auth::guard('api')->id(),\n ]\n );\n $job->setParameters(Arr::dot($validParameters));\n $job->save();\n $job->getJobDirectory();\n\n return new JobResource($job);\n }", "public function __construct(JobPoster $job)\n {\n $this->job = $job;\n }", "public function create()\n {\n // Display form to create a new job\n return view('jobs.create');\n }", "public function __construct(Job $job)\n {\n parent::__construct();\n\n $this->job = $job;\n }", "protected function getJobInstance(): JobInstance\n {\n if (!isset($this->jobInstance)) {\n $id = $this->argument('instanceId');\n /** @noinspection PhpIncompatibleReturnTypeInspection */\n $this->jobInstance = JobInstance::findOrFail(intval($id));\n }\n\n return $this->jobInstance;\n }", "static function createJobDescriptorFromInput()\n {\n $obj = b2input()->json();\n $job = new \\scheduler\\JobDescriptor();\n\n $job->group = trim($obj->group) ?: b2config()->scheduler['defaultGroupName'];\n $job->name = $obj->name;\n $job->type = $obj->type;\n $job->description = $obj->description;\n\n if ($obj->data) {\n $job->data = parse_ini_string($obj->data);\n }\n if (empty($job->data)) {\n $job->data = null;\n }\n\n// var_dump($job);\n\n return $job;\n }", "public function getInstance()\n {\n if (!is_null($this->instance)) {\n return $this->instance;\n }\n\n if (!class_exists($this->class)) {\n throw new \\RuntimeException('Could not find job class \"'.$this->class.'\"');\n }\n\n if (!method_exists($this->class, $this->method) or !is_callable(array($this->class, $this->method))) {\n throw new \\RuntimeException('Job class \"'.$this->class.'\" does not contain a public \"'.$this->method.'\" method');\n }\n\n $class = new \\ReflectionClass($this->class);\n\n if ($class->isAbstract()) {\n throw new \\RuntimeException('Job class \"'.$this->class.'\" cannot be an abstract class');\n }\n\n $instance = $class->newInstance();\n\n return $this->instance = $instance;\n }", "public function create() {}", "public function __construct()\n {\n $this->jobService = new JobService();\n }", "public function create()\n {\n $job=new Job;\n return view('jobs.create',[\n 'job'=>$job,]);\n //\n }", "public function store(CreateJobFormRequest $request)\n {\n $job = Job::create($request->input());\n\n return response()->json($job, 201);\n\n }", "public function create()\n {\n return view('admin.job.create');\n }", "public function createAction(Request $request)\n {\n $entity = new Job();\n $form = $this->createCreateForm($entity);\n $form->handleRequest($request);\n\n if ($form->isValid()) {\n $em = $this->getDoctrine()->getManager();\n $em->persist($entity);\n $em->flush();\n\n return $this->redirect($this->generateUrl('job_show', array('id' => $entity->getId())));\n }\n\n return array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n );\n }", "public function create() {\n $class_name = $this->getOption('className');\n return new $class_name();\n }", "public function create(){}", "public function create(Request $request) {\n $jobPost = new Job();\n $jobPost->user_id = Auth::user()->id;\n\n // Substract one credit from user's subscription\n $userPlans = Auth::user()->plans;\n\n foreach ($userPlans as $plan) {\n if ($plan->credits > 0) {\n $plan->credits = $plan->credits - 1;\n $plan->save();\n }\n }\n\n $jobPostData = $request::input('jobPost');\n foreach ($jobPostData as $key => $value) {\n $jobPost[$key] = $value;\n }\n\n $jobPost->save();\n\n return $jobPost;\n }", "public function __construct($job)\n {\n $payload = [];\n $this->job = $job;\n $payload['data'] = json_encode($this->job);\n\n $payload['classname'] = $this->job->getNameOfClass();\n $this->payload = $payload;\n\n }", "public function create()\n {\n return view('profile.job.create');\n }", "public function create()\n {\n return view('job.add_job');\n }", "public function store(CreateRequest $request, Job $job)\n {\n $newTask = $request->validated();\n $newTask['job_id'] = $job->id;\n $task = Task::create($newTask);\n\n flash(__('task.created'), 'success');\n\n return redirect()->route('jobs.show', $job);\n }", "public function create()\n {}", "public static function create() {}", "public static function create() {}", "public static function create() {}", "public function createTask()\n {\n return factory($this->model)->create();\n }", "public function newAction()\n {\n $entity = new Job();\n $form = $this->createCreateForm($entity);\n\n return array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n );\n }", "public function createJob(array $settings, $metaData = [], $priority = 0)\n {\n return $this->client->createJob([\n 'Role' => config('media-converter.iam_arn'),\n 'Settings' => $settings,\n 'Queue' => config('media-converter.queue_arn'),\n 'UserMetadata' => $metaData,\n 'StatusUpdateInterval' => $this->getStatusUpdateInterval(),\n 'Priority' => $priority,\n ]);\n }", "public function addNewJobOpo()\n {\n }", "public function insert($projectId, Google_Job $postBody, $optParams = array()) {\n $params = array('projectId' => $projectId, 'postBody' => $postBody);\n $params = array_merge($params, $optParams);\n $data = $this->__call('insert', array($params));\n if ($this->useObjects()) {\n return new Google_Job($data);\n } else {\n return $data;\n }\n }", "public function run()\n {\n Job::create([\n \"name\" => \"Wirausaha\"\n ]);\n\n Job::create([\n \"name\" => \"Wiraswasta\"\n ]);\n\n Job::create([\n \"name\" => \"Freelance\"\n ]);\n\n Job::create([\n \"name\" => \"Pelajar\"\n ]);\n }", "public function create() {\n \n }", "public function create() {\n \n }", "public static function createJob($mysqli,$name, $jobdesc, $cust_email, $trade, $area, $jobcost, $jobdate, $estdate){\n $insert = \"INSERT INTO job (job_name,job_desc,cust_email,trade_name,area,preferred_cost,date_needed,offer_end_date) VALUES (?,?,?,?,?,?,?,?)\";\n $stmt = $mysqli->prepare($insert);\n $stmt->bind_param('sssssiss', $name, $jobdesc, $cust_email, $trade, $area, $jobcost, $jobdate, $estdate); \n $stmt->execute();\n $stmt->close();\n $job = new Job(['JobName'],['JobDesc'],['Email'],['Trade'],['Area'],['JobCost'],['JobDate'],['EstDate']);\n return $job;\n }", "public function store(Request $request)\n {\n $job = new Job();\n $job->title = $request->title;\n $job->description = $request->description;\n $job->company_name = $request->company_name;\n $this->repo->save($job);\n return new JobsResources($job);\n }", "public function create()\n {\n $fields = Field::all();\n $jobTypes = config('user.job_type');\n\n return view('job.create', [\n 'fields' => $fields,\n 'jobTypes' => $jobTypes,\n ]);\n }", "public static function create($queue, $class, array $data = null, $run_at = 0)\n {\n $id = static::createId($queue, $class, $data, $run_at);\n\n $job = new static($queue, $id, $class, $data);\n\n if ($run_at > 0) {\n if (!$job->delay($run_at)) {\n return false;\n }\n } elseif (!$job->queue()) {\n return false;\n }\n\n Stats::incr('total', 1);\n Stats::incr('total', 1, Queue::redisKey($queue, 'stats'));\n\n return $job;\n }", "public function create()\n {\n return $this->objectManager->create($this->className);\n }", "public function create() {\r\n }", "public function submit(Job $job): JobResource\n {\n if (!$job->canBeModified()) {\n abort(400, 'Unable to submit a job that is already submitted.');\n }\n $job->setStatus(Job::QUEUED);\n JobRequest::dispatch($job);\n\n return new JobResource($job);\n }", "public function create()\n {\n //TODO\n }", "public function __construct(int $status, Job $job)\n {\n $this->status = $status;\n $this->job = $job;\n\n $this->updateTask($this->status, $this->job);\n }", "public function create()\n {\n return new $this->class;\n }", "public function create() {\n }", "public function create() {\n }", "public function create() {\n\t \n }", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public function create()\n {\n return view('admin.jobs.create');\n }", "public function fake(Generator &$faker): Job\n {\n return new Job([\n 'name' => $faker->catchPhrase,\n 'summary' => $faker->sentence,\n 'workflow_id' => random_int(1, Fabricator::getCount('workflows') ?: 4),\n 'stage_id' => random_int(1, Fabricator::getCount('stages') ?: 99),\n ]);\n }", "public function run()\n {\n Job::factory()->count(100)->create();\n \n }", "public function create()\n {\n return view('admin.jobs.create');\n\n }", "public function create() {\n\t\t\t//\n\t\t}", "public function create() {\n\n\t\t\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "protected function _createJob($type, $job)\n\t{\n\t\treturn strtoupper($type) . ' ' . json_encode($job);\n\t}", "public function createJobWithSalesPrices(array $inputData): Job;", "public function create(Job $job)\n {\n $states = $job->prepareStates();\n $countries = $job->prepareCountries();\n $hours = $job->prepareHours();\n $minutes = $job->prepareMinutes();\n $ampm = $job->prepareAmpm();\n $open = $job->prepareOpen();\n return view('companies.create', compact(['states','countries','hours','minutes','ampm','open']));\n }", "public function create()\n {\n return view('jobs.create');\n }", "public function create()\n {\n return view('jobs.create');\n }", "public function create()\n {\n return view('jobs.create');\n }" ]
[ "0.6920934", "0.6904838", "0.6904838", "0.6868104", "0.6808779", "0.65273094", "0.6518345", "0.64923275", "0.6489805", "0.6467702", "0.6427481", "0.64067507", "0.63930124", "0.6390954", "0.6374191", "0.63040626", "0.6256694", "0.624258", "0.6201882", "0.6178255", "0.60741466", "0.606964", "0.6048255", "0.6046371", "0.6028964", "0.6027325", "0.6020612", "0.60201806", "0.59219176", "0.58790815", "0.5874581", "0.58577603", "0.5809763", "0.58056796", "0.57996", "0.578759", "0.5785099", "0.57772964", "0.57756215", "0.5756182", "0.5702974", "0.56821346", "0.5681687", "0.5681687", "0.5681687", "0.5679407", "0.56782347", "0.56589705", "0.5653082", "0.5649362", "0.56333834", "0.56317276", "0.56317276", "0.56284106", "0.5625946", "0.5622152", "0.56137025", "0.5604381", "0.5603747", "0.5601985", "0.5600219", "0.55999386", "0.55947715", "0.5592249", "0.5592249", "0.5592207", "0.55763525", "0.55763525", "0.55763525", "0.55763525", "0.55763525", "0.55763525", "0.55763525", "0.55763525", "0.55763525", "0.55763525", "0.55763525", "0.5536131", "0.5534613", "0.5530061", "0.5522159", "0.55214804", "0.5516792", "0.5516144", "0.5516144", "0.5516144", "0.5516144", "0.5516144", "0.5516144", "0.5516144", "0.5516144", "0.5516144", "0.5516144", "0.5516144", "0.5516144", "0.551591", "0.54990643", "0.5498096", "0.54875535", "0.54875535", "0.54875535" ]
0.0
-1
declare abstract, we don't want instances (trick from Zend)
protected static function implodePoint($pntArray) { return implode(' ', $pntArray); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract protected function __construct();", "abstract public function __construct();", "abstract public function __construct();", "abstract public function __construct();", "abstract function __construct();", "public function forgetInstance( $abstract );", "abstract protected function interface();", "protected abstract function __construct();", "abstract public function instance();", "private function __construct()\r\n {\r\n // Prevent direct instantiation\r\n }", "abstract public function object();", "public function __construct()\n {\n //to be extended by children\n }", "public function __construct() { //this is not called from concrete class...\n\t\t\t$this->modelName = 'aaaaaaaaaabstract';\n\t\t\techo 'constructing a ' . static::class . '<br>';\n\t\t}", "function __construct()\r\n {\r\n //NOP\r\n }", "abstract public function otherfoo();", "function __construct(){parent::__construct();}", "abstract protected function create ();", "protected final function __construct() {}", "final private function __construct() {}", "final private function __construct() {}", "public function __contruct(){\r\n parent::__contruct();\r\n }", "protected function __init__() { }", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "final private function __construct() { }", "final private function __construct() { }", "final private function __construct() { }" ]
[ "0.7373739", "0.7352464", "0.7352464", "0.7352464", "0.7325577", "0.7059134", "0.7003252", "0.69949985", "0.6748265", "0.66290677", "0.6516626", "0.65124977", "0.64784247", "0.6428349", "0.6402508", "0.63850355", "0.63667846", "0.6358557", "0.63366425", "0.63366425", "0.63201404", "0.6290052", "0.6289737", "0.6289737", "0.6289737", "0.6289737", "0.6289737", "0.6289737", "0.6289737", "0.6289737", "0.6289737", "0.6289737", "0.6289737", "0.6289737", "0.6289737", "0.6289737", "0.6289737", "0.6289737", "0.6289737", "0.6289737", "0.6289737", "0.6289737", "0.6289737", "0.6289737", "0.6289737", "0.6289737", "0.6289737", "0.6289737", "0.6289737", "0.6289737", "0.6289737", "0.6289737", "0.6289737", "0.6289737", "0.6289737", "0.6289737", "0.6289737", "0.6289737", "0.6289737", "0.6289737", "0.6289737", "0.6289737", "0.6289737", "0.6289737", "0.6289737", "0.6289737", "0.6289737", "0.6289737", "0.6289737", "0.6289737", "0.6289737", "0.6289737", "0.6289737", "0.6289737", "0.6289737", "0.6289737", "0.6289737", "0.6289737", "0.6289139", "0.6289139", "0.6288701", "0.6274186", "0.6274186", "0.6274186", "0.6274186", "0.6274186", "0.6274186", "0.6274186", "0.6274186", "0.6274186", "0.6274186", "0.6274186", "0.6274186", "0.6274186", "0.6274186", "0.6274186", "0.6274186", "0.6274186", "0.6274069", "0.6274069", "0.6274069" ]
0.0
-1
Ensure that invalid driver types throw an error
public function testInvalidDriverType() { $extension = new AlyxGrayOathTokenExtension(); $config = $this->getConfig ('invalid_driver_type'); $extension->load (array ($config), new ContainerBuilder()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static function _checkParams(array $params)\n {\n // check existence of mandatory parameters\n\n // driver\n if ( ! isset($params['driver']) && ! isset($params['driverClass'])) {\n throw DBALException::driverRequired();\n }\n\n // check validity of parameters\n\n // driver\n if (isset($params['driver']) && ! isset(self::$_driverMap[$params['driver']])) {\n throw DBALException::unknownDriver($params['driver'], array_keys(self::$_driverMap));\n }\n\n if (isset($params['driverClass']) && ! in_array('Doctrine\\DBAL\\Driver', class_implements($params['driverClass'], true))) {\n throw DBALException::invalidDriverClass($params['driverClass']);\n }\n }", "public function testInvalidDriver () {\n $extension = new AlyxGrayOathTokenExtension();\n $config = $this->getConfig ('invalid_driver');\n $extension->load (array ($config), new ContainerBuilder());\n }", "public function testStatementThrowsExceptionInvalidParameterType()\n {\n $this->expectException(\\ReflectionException::class);\n\n $connection = new MockConnection($this->mockConnector, $this->mockCompiler);\n $connection->statement(function (string $a) {});\n }", "public function testQueryThrowsExceptionInvalidParameterType()\n {\n $this->expectException(\\ReflectionException::class);\n\n $connection = new MockConnection($this->mockConnector, $this->mockCompiler);\n $connection->query(function (string $a) {});\n }", "protected function checkDriverConfig($config);\n\t{\n\t\tif ( ! isset($config['driver'])) throw new Exception('No Database driver provided');\n\t\t$availableDrivers = array('Pdo_MySQL', 'Pdo_Sqlite');\n\t\tif ( ! in_array($config['driver'],$availableDrivers)) throw new Exception('Only Pdo_MySQl or Pdo_Sqlite allowed');\n\t\tif ( ! isset($config['database'])) throw new Exception('No database provided');\n\t\tif ($config['driver'] == 'Pdo_MySQL') {\n\t\t\tif ( ! isset($config['username'])) throw new Exception('No username provided');\n\t\t\tif ( ! isset($config['password'])) throw new Exception('No password provided');\n\t\t}\n\t}", "public function testInvalidTypeException() {\n\t\t$options = array(\n\t\t\t'adapter' => 'foo'\n\t\t);\n\t\t$this->expectException('/Could not find adapter `Foo`/');\n\t\tFixture::load('models/Posts', $options);\n\t}", "public function errorIfOldCustomDrivers(): void\n {\n $driversPath = VALET_HOME_PATH.'/Drivers';\n\n if (! $this->files->isDir($driversPath)) {\n return;\n }\n\n foreach ($this->files->scanDir($driversPath) as $driver) {\n if (! ends_with($driver, 'ValetDriver.php')) {\n continue;\n }\n\n if (! str_contains($this->files->get($driversPath.'/'.$driver), 'namespace')) {\n warning('Please make sure all custom drivers have been upgraded for Valet 4.');\n warning('See the upgrade guide for more info:');\n warning('https://github.com/laravel/valet/blob/master/UPGRADE.md');\n exit;\n }\n }\n }", "protected function _checkAdapter()\n {\n $notDefined = !is_object($this->_adapter);\n $isAdapter = $this->_adapter instanceof AdapterInterface;\n\n if ($notDefined || !$isAdapter) {\n throw new InvalidArgumentException(\n \"You need to set the database adapter for this schema loader.\"\n );\n }\n }", "protected function checkInvalidSqlModes() {}", "public function testSaveDataTableIncorrectDataType() {\r\n $this->setExpectedException('Exception', 'Data table is not of correct datatype.');\r\n\t\t$this->getPersistenceAdapter()->saveDataTable('POTEST', 'Incorrect data type');\r\n\t}", "public function testUnknownDataSourceType(): void\n {\n $dataSourceType = 'not-handled';\n $this->expectException(\\InvalidArgumentException::class);\n $this->expectExceptionMessage(\n AssertionException::inArray(\n $dataSourceType,\n MetaService::AVAILABLE_DATA_SOURCE_TYPES,\n 'MetaService::dataSourceType'\n )->getMessage()\n );\n new MetaService(1, 'Meta 1', 'average', 1, $dataSourceType);\n }", "public function testGetMultipleInvalidTypeString(): void\n {\n $keyValuePairs = \"I like to party sometimes until four\";\n $this->expectException(\\TypeError::class);\n $this->testNotStrict->getMultiple($keyValuePairs);\n }", "public function testConnectBadDriver()\n {\n PDB::connect('ExceptionThrower');\n }", "public function testConnectInvalidDriver()\n {\n PDB::connect('Fake');\n }", "public function testGetInvalidFieldType()\r\n\t\t{\r\n\t\t\tORM::init('mysql:host=localhost;dbname=rocket_orm', 'orm_username', 'orm_password');\r\n\t\t\t\r\n\t\t\t$user = User::load(1);\r\n\r\n\t\t\t$user->get(array());\r\n\t\t}", "public function invalidParameterTypesPassedToBindValueThrowsExceptionDataProvider() {}", "public function validDataTypes();", "function assertNativeType(string $type, $value): void // phpcs:ignore\n{\n}", "public function testRejectsAUnionTypeWithIncorrectlyTypedTypes()\n {\n $this->expectException(InvariantException::class);\n $this->expectExceptionMessage(\n 'Must provide array of types or a function which returns such an array for Union SomeUnion.'\n );\n\n /** @noinspection PhpUnhandledExceptionInspection */\n $this->schemaWithField(\n newUnionType([\n 'name' => 'SomeUnion',\n 'types' => ''\n ])\n );\n\n $this->addToAssertionCount(1);\n }", "function db_driver_error()\n{\n global $_db;\n\n return pg_result_error($_db['resource'][$_db['target']]['dbh']);\n}", "public function testItShouldThrowExceptionWhenInvalidConfigOptions()\n {\n $this->expectException(InvalidArgumentException::class);\n $this->expectExceptionMessage('List drivers MUST not empty.');\n\n new ChainDriver([]);\n }", "protected static function throwHardCheckError()\n {\n throw new \\InvalidArgumentException('Value has wrong type');\n }", "public function testPrepareThrowsRuntimeExceptionOnInvalidSqlWithErrorReportingDisabled()\n {\n error_reporting(0);\n $sql = \"INVALID SQL\";\n $this->statement->setSql($sql);\n\n $this->expectException(\n RuntimeException::class,\n 'Error message'\n );\n $this->statement->prepare();\n }", "public function testSaveDataTableUnknownValueDatatype() {\r\n $records = [\r\n ['UUID' => 'uuid1tRMR1', 'bool' => false, 'int' => 10, 'string' => 'testGetDataTable 1'],\r\n ['UUID' => 'uuid1tRMR2', 'bool' => true, 'int' => array(), 'string' => 'testGetDataTable 2'],\r\n ['UUID' => 'uuid1tRMR3', 'bool' => false, 'int' => 30, 'string' => 'testGetDataTable 3']\r\n ];\r\n\t\t$datatable = new avorium_core_data_DataTable(3, 4);\r\n\t\t$datatable->setHeader(0, 'UUID');\r\n\t\t$datatable->setHeader(1, 'BOOLEAN_VALUE');\r\n\t\t$datatable->setHeader(2, 'INT_VALUE');\r\n\t\t$datatable->setHeader(3, 'STRING_VALUE');\r\n\t\tfor ($i = 0; $i < 3; $i++) {\r\n\t\t\t$datatable->setCellValue($i, 0, $records[$i]['UUID']);\r\n\t\t\t$datatable->setCellValue($i, 1, $records[$i]['bool']);\r\n\t\t\t$datatable->setCellValue($i, 2, $records[$i]['int']);\r\n\t\t\t$datatable->setCellValue($i, 3, $records[$i]['string']);\r\n\t\t}\r\n\t\t// Save giving an unknown data type (array). The persistence adapter\r\n\t\t// checks this before it constructs the SQL query because it must\r\n\t\t// know whether to escape the value in the stamenent or not.\r\n $this->setExpectedException('Exception', 'Unknown datatype: array');\r\n\t\t$this->getPersistenceAdapter()->saveDataTable('POTEST', $datatable);\r\n\t}", "private function unknownType($type)\n {\n if (!$type)\n throw new Exception(\"Setting Type cannot be empty\");\n\n throw new Exception(\"Setting type is invalid: \" . $type);\n }", "public function testQueryArgumentTypesDetect()\n {\n $client = (new ClientTest())->testInstantiation();\n\n $query = $client->query(\n 'INSERT INTO typish (_0_int, _1_float, _2_decimal, _3_varchar, _4_blob, _5_date, _6_datetime, _7_nvarchar)\n VALUES (?, ?, ?, ?, null, ?, ?, ?)',\n [\n 'name' => __FUNCTION__,\n 'validate_params' => static::VALIDATE_PARAMS,\n 'sql_minify' => true,\n 'affected_rows' => true,\n ]\n );\n\n $types = '';\n\n $time = new Time();\n $args = [\n '_0_int' => 0,\n '_1_float' => 1.0,\n '_2_decimal' => '2.0',\n '_3_varchar' => 'arguments types detected',\n /*'_4_blob' => [\n sprintf(\"%08d\", decbin(4)),\n SQLSRV_PARAM_IN,\n null,\n SQLSRV_SQLTYPE_VARBINARY('max'),\n ],*/\n '_5_date' => $time,\n '_6_datetime' => $time,\n '_7_nvarchar' => 'n varchar',\n ];\n TestHelper::queryPrepareLogOnError($query, $types, $args);\n $result = TestHelper::logOnError('query execute', $query, 'execute');\n static::assertInstanceOf(MsSqlResult::class, $result);\n static::assertSame(1, $result->affectedRows());\n }", "public function testSetMultipleInvalidTypeString(): void\n {\n $keyValuePairs = 'This is a string';\n $this->expectException(\\TypeError::class);\n $this->testNotStrict->setMultiple($keyValuePairs);\n }", "private function checkExtensionRowType()\n {\n $rowType = strtolower($this->extension->attributes->getNamedItem('rowType')->nodeValue);\n if (in_array($rowType, $this->dwcRequiredRowTypes, true))\n {\n return;\n }\n\n throw new \\Exception(trans('errors.rowtype_mismatch',\n ['file' => $this->file, 'row_type' => $rowType, 'type_file' => $this->extension->nodeValue]\n ));\n }", "public function checkType() {\n\t\t//Because the DB gave us a string for the card type, we must\n\t\t//ensure that they are strings and compare accordingly.\n\t\tif (strcmp($this->getTypeAsStr(), \"aspect\")==0) {\n\t\t\t$this->boostInfo = 0;\n\t\t\t$this->magnitude = 0;\n\t\t}\n\t}", "public function testSaveDataTableStringsNotParseableToDataTypes() {\r\n $record = ['UUID' => 'uuid1tRMR2', 'bool' => 'not parsable', 'int' => 'not parsable', 'string' => 'testReadMultipleRecords 2'];\r\n\t\t$datatable = new avorium_core_data_DataTable(1, 4);\r\n\t\t$datatable->setHeader(0, 'UUID');\r\n\t\t$datatable->setHeader(1, 'BOOLEAN_VALUE');\r\n\t\t$datatable->setHeader(2, 'INT_VALUE');\r\n\t\t$datatable->setHeader(3, 'STRING_VALUE');\r\n\t\t$datatable->setCellValue(0, 0, $record['UUID']);\r\n\t\t$datatable->setCellValue(0, 1, $record['bool']);\r\n\t\t$datatable->setCellValue(0, 2, $record['int']);\r\n\t\t$datatable->setCellValue(0, 3, $record['string']);\r\n $this->setExpectedException('Exception');\r\n\t\t$this->getPersistenceAdapter()->saveDataTable('POTEST', $datatable);\r\n\t}", "public function testInvalidCacheTypeDriverAsOption()\n {\n $container = $this->createMockDefaultApp();\n\n $container->register(new DoctrineOrmServiceProvider);\n\n $container['orm.em.options'] = array(\n 'query_cache' => array(\n 'driver' => 'INVALID',\n ),\n );\n\n try {\n $container['orm.em'];\n\n $this->fail('Expected invalid query cache driver exception');\n } catch (\\RuntimeException $e) {\n $this->assertEquals(\"Unsupported cache type 'INVALID' specified\", $e->getMessage());\n }\n }", "public function testDriverNotExisting()\n\t{\n\t\t$this->setExpectedException( 'InvalidArgumentException' );\t\t\n\t\t$config = CCConfig::create( null, 'beep' );\n\t}", "public function testRegistrationFieldsWrongType(): void { }", "public function testCreateTableUnknownType() {\r\n // Drop table\r\n $this->executeQuery('drop table POTEST');\r\n // Automatically create table\r\n $this->setExpectedException('Exception', 'Database column type \\'unknowntype\\' is not known to the persistence adapter.');\r\n $this->getPersistenceAdapter()->updateOrCreateTable('test_persistence_AbstractPersistenceAdapterTestPersistentObjectUnknownType');\r\n }", "public function testRejectsASchemaWhichDefinesABuiltInType()\n {\n /** @noinspection PhpUnhandledExceptionInspection */\n $fakeString = newScalarType([\n 'name' => 'String',\n 'serialize' => function () {\n return null;\n },\n ]);\n\n /** @noinspection PhpUnhandledExceptionInspection */\n $queryType = newObjectType([\n 'name' => 'Query',\n 'fields' => [\n 'normal' => ['type' => stringType()],\n 'fake' => ['type' => $fakeString],\n ]\n ]);\n\n $this->expectException(InvariantException::class);\n $this->expectExceptionMessage(\n 'Schema must contain unique named types but contains multiple types named \"String\".'\n );\n\n /** @noinspection PhpUnhandledExceptionInspection */\n newSchema(['query' => $queryType]);\n\n $this->addToAssertionCount(1);\n }", "public function testConstructorWithBadTxTypeThrowsException(): void\r\n {\r\n $this->expectException(TransactionException::class);\r\n $this->expectExceptionMessageRegExp('/string or array/');\r\n\r\n $obj = new \\stdClass();\r\n new Transaction($obj);\r\n }", "public function testCastTypeUnknownWhenReading() {\r\n $uuid = 'abcdefg';\r\n $bool = true;\r\n $int = 1234567;\r\n $string = 'avorium';\r\n // Write data to the database\r\n $this->executeQuery('insert into POTEST (UUID, BOOLEAN_VALUE, INT_VALUE, STRING_VALUE) values (\\''.$uuid.'\\','.($bool ? 1:0).','.$int.', \\''.$string.'\\')');\r\n // Read data out and cast it to persistent object\r\n $this->setExpectedException('Exception', 'Database column type \\'unknowntype\\' is not known to the persistence adapter.');\r\n $this->getPersistenceAdapter()->get('test_persistence_AbstractPersistenceAdapterTestPersistentObjectUnknownType', $uuid);\r\n }", "public function testRejectsAnInterfaceTypeWithAnIncorrectTypeForResolveType()\n {\n $this->expectException(InvariantException::class);\n $this->expectExceptionMessage('AnotherInterface must provide \"resolveType\" as a function.');\n /** @noinspection PhpUnhandledExceptionInspection */\n newInterfaceType([\n 'name' => 'AnotherInterface',\n 'resolveType' => '',\n 'fields' => ['f' => ['type' => stringType()]],\n ]);\n }", "protected function check_type()\n {\n $regex = \"/^int$|^bool$|^string$/\";\n\n $result = preg_match($regex, $this->token);\n\n if($result == 0 or $result == FALSE)\n {\n fwrite(STDERR, \"Error, expecting <type> function parameter! Line: \");\n fwrite(STDERR, $this->lineCount);\n fwrite(STDERR, \"\\n\");\n exit(23);\n } \n }", "public function testErrorHandling()\n\t{\n\t\tR::nuke();\n\t\tR::store( R::dispense( 'book' ) );\n\t\tR::freeze( FALSE );\n\t\tR::find( 'book2', ' id > 0' );\n\t\tpass();\n\t\tR::find( 'book', ' id2 > ?' );\n\t\tpass();\n\t\t$exception = NULL;\n\t\ttry {\n\t\t\tR::find( 'book', ' id = ?', array( 0, 1 ) );\n\t\t} catch( \\Exception $e ) {\n\t\t\t$exception = $e;\n\t\t}\n\t\tasrt( ( $exception instanceof SQL ), TRUE );\n\t\tR::freeze( TRUE );\n\t\t$exception = NULL;\n\t\ttry {\n\t\t\tR::find( 'book2', ' id > 0' );\n\t\t} catch( \\Exception $e ) {\n\t\t\t$exception = $e;\n\t\t}\n\t\tasrt( ( $exception instanceof SQL ), TRUE );\n\t\t$exception = NULL;\n\t\ttry {\n\t\t\tR::find( 'book', ' id2 > 0' );\n\t\t} catch( \\Exception $e ) {\n\t\t\t$exception = $e;\n\t\t}\n\t\tasrt( ( $exception instanceof SQL ), TRUE );\n\t}", "private function checkValid()\n\t{\n\t\tif(!$this->isValid()) {\n\t\t\tthrow new \\RuntimeException(\"TypeStruct Error: '\".get_called_class().\"' not validated to perform further operations\");\t\n\t\t}\n\t}", "public function testCastTypeUnknownWhenWriting() {\r\n // Create record\r\n $po = new test_persistence_AbstractPersistenceAdapterTestPersistentObjectUnknownType();\r\n $po->booleanValue = true;\r\n $po->intValue = 2147483647;\r\n $po->stringValue = 'Hallo Welt!';\r\n // Store new record\r\n $this->setExpectedException('Exception', 'Database column type \\'unknowntype\\' is not known to the persistence adapter.');\r\n $this->getPersistenceAdapter()->save($po);\r\n }", "function testDoNotGuessIfSpecified() {\n\t\t$result = $this->helper->__guessInputType('Test.foo', array('type' => 'bar'));\n\t\t$this->assertEqual($result, 'bar');\n\t}", "public function testMakeWithInvalidDriverThrowsException()\n\t{\n\t\t\\Orchestra\\Widget::make('menus');\n\t}", "public function valid()\n {\n throw new PDOException('valid() method is not implemented for Oci8PDO_Statement');\n }", "protected function validateOrThrow() {}", "public function testConvertWithInvalidKeyType(): void\n {\n Config::set(RB::CONF_KEY_CONVERTER_CLASSES, [\n Collection::class => [\n RB::KEY_KEY => false,\n RB::KEY_HANDLER => FakeConverter::class,\n ],\n ]);\n\n $this->expectException(Ex\\InvalidTypeException::class);\n\n Lockpick::call(Converter::class, 'getClassesMapping');\n }", "public function checkForErrors()\n {\n if ($this->getDebtor() == '' && $this->getDebtorCode() == '') {\n throw new \\InvalidArgumentException(\n sprintf('Debtor or DebtorCode must be defined')\n );\n }\n\n if ($this->getDomain() == '') {\n throw new \\InvalidArgumentException(\n sprintf('Domain must be defined')\n );\n }\n\n if ($this->getTld() == '') {\n throw new \\InvalidArgumentException(\n sprintf('Tld must be defined')\n );\n }\n }", "public function validateColumnType($type)\n {\n if (! in_array($type, $this->columnTypes)) {\n throw new UnexpectedValueException('Attribute type \"'.$type.'\" is not supported.');\n }\n }", "public function testRejectsAScalarTypeDefiningSerializeWithAnIncorrectType()\n {\n $this->expectException(InvariantException::class);\n $this->expectExceptionMessage(\n 'SomeScalar must provide \"serialize\" function. If this custom Scalar ' .\n 'is also used as an input type, ensure \"parseValue\" and \"parseLiteral\" ' .\n 'functions are also provided.'\n );\n\n /** @noinspection PhpUnhandledExceptionInspection */\n $this->schemaWithField(\n newScalarType([\n 'name' => 'SomeScalar',\n 'serialize' => '',\n ])\n );\n\n $this->addToAssertionCount(1);\n }", "public function testIsVendorClassThrowsExceptionIfNoClassNameOrObjectIsPassed()\n {\n $this->expectException('InvalidArgumentException');\n VendorResources::isVendorClass('NoValidClassName');\n }", "public function testRejectsAScalarTypeDefiningParseValueAndParseLiteralWithAnIncorrectType()\n {\n $this->expectException(InvariantException::class);\n $this->expectExceptionMessage('SomeScalar must provide both \"parseValue\" and \"parseLiteral\" functions.');\n\n /** @noinspection PhpUnhandledExceptionInspection */\n $this->schemaWithField(\n newScalarType([\n 'name' => 'SomeScalar',\n 'serialize' => function () {\n return null;\n },\n 'parseValue' => '',\n 'parseLiteral' => '',\n ])\n );\n\n $this->addToAssertionCount(1);\n }", "public function testUpdateTableUnknownType() {\r\n // Drop table\r\n $this->executeQuery('drop table POTEST');\r\n // Manually create table with UUID column only\r\n $this->createTestTable();\r\n // Automatically update table\r\n $this->setExpectedException('Exception', 'Database column type \\'unknowntype\\' is not known to the persistence adapter.');\r\n $this->getPersistenceAdapter()->updateOrCreateTable('test_persistence_AbstractPersistenceAdapterTestPersistentObjectUnknownType');\r\n }", "public function testQueryArgumentsTypeQualifiedStrict()\n {\n $client = (new ClientTest())->testInstantiation();\n\n $query = $client->query(\n 'INSERT INTO typish (_0_int, _1_float, _2_decimal, _3_varchar, _4_blob, _5_date, _6_datetime, _7_nvarchar,\n _8_bit, _9_time, _10_uuid)\n VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)',\n [\n 'name' => __FUNCTION__,\n 'validate_params' => static::VALIDATE_PARAMS,\n 'sql_minify' => true,\n 'affected_rows' => true,\n ]\n );\n\n //$types = 'idssbsss';\n $types = '';\n\n $time = new Time();\n $args = [\n '_0_int' => [\n 0,\n SQLSRV_PARAM_IN,\n null,\n SQLSRV_SQLTYPE_INT,\n ],\n '_1_float' => [\n 1.0,\n SQLSRV_PARAM_IN,\n null,\n SQLSRV_SQLTYPE_FLOAT,\n ],\n '_2_decimal' => [\n '2.0',\n SQLSRV_PARAM_IN,\n null,\n SQLSRV_SQLTYPE_DECIMAL(14,2),\n ],\n '_3_varchar' => [\n 'type qualified strict',\n SQLSRV_PARAM_IN,\n null,\n SQLSRV_SQLTYPE_VARCHAR('max'),\n ],\n '_4_blob' => [\n sprintf(\"%08d\", decbin(4)),\n SQLSRV_PARAM_IN,\n null,\n SQLSRV_SQLTYPE_VARBINARY('max'),\n ],\n '_5_date' => [\n $time,\n SQLSRV_PARAM_IN,\n null,\n SQLSRV_SQLTYPE_DATE,\n ],\n '_6_datetime' => [\n $time,\n SQLSRV_PARAM_IN,\n null,\n //SQLSRV_SQLTYPE_DATETIME2,\n SQLSRV_SQLTYPE_DATETIME,\n ],\n '_7_nvarchar' => [\n 'n varchar',\n SQLSRV_PARAM_IN,\n null,\n SQLSRV_SQLTYPE_NVARCHAR('max'),\n ],\n '_8_bit' => [\n 0,\n SQLSRV_PARAM_IN,\n null,\n SQLSRV_SQLTYPE_BIT,\n ],\n '_9_time' => [\n '10:30:01',\n SQLSRV_PARAM_IN,\n null,\n SQLSRV_SQLTYPE_TIME,\n ],\n '_10_uuid' => [\n '123e4567-e89b-12d3-a456-426655440000',\n SQLSRV_PARAM_IN,\n null,\n SQLSRV_SQLTYPE_UNIQUEIDENTIFIER,\n ],\n ];\n TestHelper::queryPrepareLogOnError($query, $types, $args);\n $result = TestHelper::logOnError('query execute', $query, 'execute');\n static::assertInstanceOf(MsSqlResult::class, $result);\n static::assertSame(1, $result->affectedRows());\n\n $args['_0_int'][0] = '1';\n //$args['_0_int'][0] = 'hest';\n $args['_1_float'][0] = '1.1';\n $args['_2_decimal'][0] ='2.2';\n $args['_3_varchar'][0] = 'type qualified strict updated';\n $args['_5_date'][0] = $time->ISODate;\n //$args['_5_date'][0] = 'cykel';\n $args['_6_datetime'][0] = $time->ISODate;\n $args['_8_bit'][0] = true;\n $result = TestHelper::logOnError('query execute', $query, 'execute');\n static::assertInstanceOf(MsSqlResult::class, $result);\n static::assertSame(1, $result->affectedRows());\n }", "public function testValidation()\n {\n $this->driver->loadMetadataForClass(new \\ReflectionClass(InvalidExample::class));\n }", "protected function checkForValidImplementingClass()\n {\n $this->validateModel();\n $this->validateItemId();\n }", "public static function supportedDrivers()\n {\n }", "#[@test, @expect('rdbms.SQLStatementFailedException')]\n public function malformedStatement() {\n $this->db()->query('select insert into delete.');\n }", "public function testExceptExceptionWithWrongDatabaseInfo()\n {\n $this->expectException(\"Exception\");\n $randomData = (object) array(\n \"user\" => $this->generateRandomString(5),\n \"password\" => $this->generateRandomString(10),\n \"host\" => $this->generateRandomString(120),\n \"database\" => $this->generateRandomString(15),\n \"port\" => random_int(1000, 16200)\n );\n\n /**\n * Creating annomous class,\n * I think I found a caseuse for interfaces now.\n */\n $settings = new class ($randomData) {\n private $data;\n public function __construct($data)\n {\n $this->data = $data;\n }\n public function getDatabaseConfig()\n {\n return $this->data;\n }\n };\n\n $database = new \\Database($settings);\n }", "private function verifyTypes($connectObj) {\n if(method_exists($connectObj, 'getMetadata')){\n $type = $connectObj::getMetadata()->COM_type;\n }\n else{\n $type = get_class($connectObj);\n }\n\n if (array_search($type, $this->connectTypes) === false) {\n throw new \\Exception(sprintf(\"The specified aspect, %s, does not support %s objects\", $this->className(), $type));\n }\n }", "public function testInvalidAllOf() {\n $this->expectException(ParseException::class);\n $schema = new Schema(['$ref' => '#/components/schemas/Invalid1'], $this->lookup);\n $valid = $schema->validate(['type' => 'Invalid1']);\n }", "public function testConstructorInvalidType()\n\t{\n\t\t$this->expectException(\\RuntimeException::class);\n\t\tnew Builder('foo');\n\t}", "public function testNoSchema()\n {\n $obj_ex = null;\n try {\n new \\GDS\\Store();\n } catch (\\Exception $obj_ex) {}\n $this->assertEquals($obj_ex, new \\Exception('You must provide a Schema or Kind. Alternatively, you can extend GDS\\Store and implement the buildSchema() method.'));\n }", "public function testValidateFormMalformed()\n {\n $formData = ['jelly'];\n $this->expectException(TypeError::class);\n $case = GRUB\\Validator\\Validator::validateIngredient($formData);\n }", "function find_odbcdriver($driver){\n\n switch ($driver) {\n case 'MySQL':\n // /usr/lib/libmyodbc3.so /usr/lib/odbc/libmyodbc.so /usr/lib64/libmyodbc3.so;\n if(file_exists('/usr/lib/libmyodbc3.so') || file_exists('/usr/lib/odbc/libmyodbc.so') || file_exists('/usr/lib64/libmyodbc3.so'))\n return True;\n else\n return False; \n \n case 'MSSQL':\n if(file_exists('/usr/lib/libtdsodbc.so') || file_exists('/usr/lib64/libtdsodbc.so') || file_exists('/usr/lib/odbc/libtdsS.so') || file_exists('/usr/local/lib/libtdsodbc.so')) {\n return True; \n }\n else\n return False; \n\n case 'PostgreSQL':\n // /usr/lib/libodbcpsql.so /usr/lib/libodbcpsqlS.so\n if(file_exists('/usr/lib/libodbcpsql.so') || file_exists('/usr/lib64/libodbcpsql.so') || file_exists('/usr/lib/odbc/libodbcpsqlS.so')){\n\n $out = \"\";\n exec(\"psql --help\", $result);\n foreach($result as $l){\n $out .= \" \" . $l;\n }\n if ($out == \"\") return False; // this mean psql command does not exist\n else return True; \n }\n else\n return False; \n\n case 'SQLite':\n return False;\n default:\n return False;\n }\n}", "public static function load_driver(){\n\t\t\n\t\t$config = Config::read();\t\n\t\tif(isset($config->database->type)){\n\t\t\ttry {\t\t\t\t\n\t\t\t\tif($config->database->type){\t\t\t\t\t\n\t\t\t\t\t$config->database->type = escapeshellcmd($config->database->type);\n\t\t\t\t\trequire \"forms/db/adapters/\".$config->database->type.\".php\";\n\t\t\t\t\treturn true;\t\t\t\t\t\n\t\t\t\t}\n\t\t\t} \n\t\t\tcatch(kumbiaException $e){\n\t\t\t\t$e->show_message();\n\t\t\t}\n\t\t} else {\n\t\t\treturn true;\n\t\t}\n\t}", "public function checkConvertability()\n {\n }", "public function testThrowExceptionOnInvalidCoinType()\n {\n $this->expectException(Exceptions\\InvalidWalletTypeException::class);\n Wallet::validate(self::VALID_BTC_ADDRESS, 'Botchain');\n }", "public function testContainerDoesntAcceptInvalidConfigType()\n {\n $this->setExpectedException('InvalidArgumentException');\n\n $c = new Container(new \\stdClass());\n }", "public function testExceptExceptionWithEmptyDatabse()\n {\n $this->expectException(\"ArgumentCountError\");\n $database = new \\Database();\n }", "public function testRejectsAnObjectTypeWithAnIncorrectTypeForIsTypeOf()\n {\n $this->expectException(InvariantException::class);\n $this->expectExceptionMessage('AnotherObject must provide \"isTypeOf\" as a function.');\n\n /** @noinspection PhpUnhandledExceptionInspection */\n $this->schemaWithField(\n newObjectType([\n 'name' => 'AnotherObject',\n 'fields' => ['f' => ['type' => stringType()]],\n 'isTypeOf' => '',\n ])\n );\n\n $this->addToAssertionCount(1);\n }", "public function testExceptionIsThrownWhenRegisteringServiceProviderWithInvalidType()\n {\n $this->setExpectedException('InvalidArgumentException');\n\n $c = new Container;\n\n $c->addServiceProvider(new \\stdClass);\n }", "public function testX(): void\n\t{\n\t\t$this->expectException(\\InvalidArgumentException::class);\n\t\tnew Ex\\InvalidTypeException('foo', Type::STRING, []);\n\t}", "protected function validatePlatform(AbstractPlatform $platform): void\n {\n $platformName = $platform->getName();\n\n if (!in_array($platformName, $this->getPlatforms())) {\n throw new UnsupportedPlatformException(\n sprintf('DBAL platform \"%s\" is not currently supported.', $platformName)\n );\n }\n }", "public function getDriverType() {}", "function normalize_driver_types()\n\t{\n\t\t\\Config::load('auth', true);\n\n\t\t$drivers = \\Config::get('auth.driver', array());\n\t\tis_array($drivers) or $drivers = array($drivers);\n\n\t\t$results = array();\n\n\t\tforeach ($drivers as $driver)\n\t\t{\n\t\t\t// determine the driver classname\n\t\t\t$class = \\Inflector::get_namespace($driver).'Auth_Login_'.\\Str::ucwords(\\Inflector::denamespace($driver));\n\n\t\t\t// Auth's Simpleauth\n\t\t\tif ($class == 'Auth_Login_Simpleauth' or $class == 'Auth\\Auth_Login_Simpleauth')\n\t\t\t{\n\t\t\t\t$driver = 'Simpleauth';\n\t\t\t}\n\n\t\t\t// Auth's Ormauth\n\t\t\telseif ($class == 'Auth_Login_Ormauth' or $class == 'Auth\\Auth_Login_Ormauth')\n\t\t\t{\n\t\t\t\t$driver = 'Ormauth';\n\t\t\t}\n\t\t\telseif (class_exists($class))\n\t\t\t{\n\t\t\t\t// Extended fromm Auth's Simpleauth\n\t\t\t\tif (get_parent_class($class) == 'Auth\\Auth_Login_Simpleauth')\n\t\t\t\t{\n\t\t\t\t\t$driver = 'Simpleauth';\n\t\t\t\t}\n\n\t\t\t\t// Extended fromm Auth's Ormauth\n\t\t\t\telseif (get_parent_class($class) == 'Auth\\Auth_Login_Ormauth')\n\t\t\t\t{\n\t\t\t\t\t$driver = 'Ormauth';\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// store the normalized driver name\n\t\t\tin_array($driver, $results) or $results[] = $driver;\n\t\t}\n\n\t\treturn $results;\n\t}", "function SetDriverType($str) {\n $this->strDriverType = $str;\n }", "protected function validateSelectablePluginType() {\n if (!$this->selectablePluginType) {\n throw new \\RuntimeException('A plugin type must be set through static::setSelectablePluginType() first.');\n }\n }", "public function dropAllTypes()\n {\n throw new LogicException('This database driver does not support dropping all types.');\n }", "public function testSupports(): void\n {\n $this->assertTrue($this->driver->supports(DriverInterface::FEATURE_SAVEPOINT));\n $this->assertTrue($this->driver->supports(DriverInterface::FEATURE_QUOTE));\n\n $this->assertFalse($this->driver->supports(DriverInterface::FEATURE_CTE));\n $this->assertFalse($this->driver->supports(DriverInterface::FEATURE_JSON));\n $this->assertFalse($this->driver->supports(DriverInterface::FEATURE_WINDOW));\n\n $this->assertFalse($this->driver->supports('this-is-fake'));\n }", "public function testValidationCaseForNonStringInputDataPassedForEncryption()\n {\n // Backward compatible for different versions of PHPUnit\n if (method_exists($this, 'expectException')) {\n $this->expectException(\\InvalidArgumentException::class);\n\n NativeRc4::encryptData('', ['wrong']);\n } else {\n $hasThrown = null;\n\n try {\n NativeRc4::encryptData('', ['wrong']);\n } catch (\\InvalidArgumentException $exception) {\n $hasThrown = !empty($exception->getMessage());\n } catch (\\Exception $exception) {\n $hasThrown = $exception->getMessage();\n }\n\n $this->assertTrue($hasThrown);\n\n return;\n }\n }", "public function testPdoException() {\n\n\t\t$cfg = new PdoConnectionTestConfig();\n\n\t\t$conn = new \\Scrivo\\PdoConnection($cfg);\n\n\t}", "public function testQueryArgumentsTypeQualifyHelpers()\n {\n $client = (new ClientTest())->testInstantiation();\n\n $query = $client->query(\n 'INSERT INTO typish (_0_int, _1_float, _2_decimal, _3_varchar, _4_blob, _5_date, _6_datetime, _7_nvarchar,\n _8_bit, _9_time, _10_uuid)\n VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)',\n [\n 'name' => __FUNCTION__,\n 'validate_params' => static::VALIDATE_PARAMS,\n 'sql_minify' => true,\n 'affected_rows' => true,\n ]\n );\n\n //$types = 'idssbsss';\n $types = '';\n\n $time = new Time();\n $args = [\n '_0_int' => MsSqlQuery::argIn(MsSqlQuery::IN_INT, 0),\n '_1_float' => MsSqlQuery::argIn(MsSqlQuery::IN_FLOAT, 1.0),\n '_2_decimal' => MsSqlQuery::argIn(MsSqlQuery::IN_DECIMAL_14_2, 2.0),\n '_3_varchar' => MsSqlQuery::argIn(MsSqlQuery::IN_VARCHAR, 'type qualify helpers'),\n '_4_blob' => MsSqlQuery::argIn(MsSqlQuery::IN_VARBINARY, sprintf(\"%08d\", decbin(4))),\n '_5_date' => MsSqlQuery::argIn(MsSqlQuery::IN_DATE, $time),\n '_6_datetime' => MsSqlQuery::argIn(MsSqlQuery::IN_DATETIME, $time),\n '_7_nvarchar' => MsSqlQuery::argIn(MsSqlQuery::IN_NVARCHAR, 'n varchar'),\n '_8_bit' => MsSqlQuery::argIn(MsSqlQuery::IN_BIT, 0),\n '_9_time' => MsSqlQuery::argIn(MsSqlQuery::IN_TIME, '10:30:01'),\n '_10_uuid' => MsSqlQuery::argIn(MsSqlQuery::IN_UUID, '123e4567-e89b-12d3-a456-426655440000'),\n ];\n TestHelper::queryPrepareLogOnError($query, $types, $args);\n $result = TestHelper::logOnError('query execute', $query, 'execute');\n static::assertInstanceOf(MsSqlResult::class, $result);\n static::assertSame(1, $result->affectedRows());\n\n $args['_0_int'][0] = '1';\n //$args['_0_int'][0] = 'hest';\n $args['_1_float'][0] = '1.1';\n $args['_2_decimal'][0] ='2.2';\n $args['_3_varchar'][0] = 'type qualify helpers updated';\n $args['_5_date'][0] = $time->ISODate;\n //$args['_5_date'][0] = 'cykel';\n $args['_6_datetime'][0] = $time->ISODate;\n $args['_8_bit'][0] = true;\n $result = TestHelper::logOnError('query execute', $query, 'execute');\n static::assertInstanceOf(MsSqlResult::class, $result);\n static::assertSame(1, $result->affectedRows());\n }", "protected function getSupportedDbalDrivers() {}", "public function test_no_user_agent_exception() {\n\t\tunset($_SERVER['HTTP_USER_AGENT']);\n\t\ttry {\n\t\t\tparse_user_agent();\n\t\t} catch(\\InvalidArgumentException $ex) {\n\t\t\t$this->assertTrue(true); // easy way to quiet warning\n\t\t\treturn;\n\t\t}\n\n\t\t$this->fail(\"Expected \\InvalidArgumentException\");\n\t}", "public function testGetDataTableInvalidQuery() {\r\n $records = [\r\n ['UUID' => 'uuid1tRMR1', 'bool' => false, 'int' => 10, 'string' => 'testReadMultipleRecords 1'],\r\n ['UUID' => 'uuid1tRMR2', 'bool' => true, 'int' => 20, 'string' => 'testReadMultipleRecords 2'],\r\n ['UUID' => 'uuid1tRMR3', 'bool' => false, 'int' => 30, 'string' => 'testReadMultipleRecords 3']\r\n ];\r\n // Write data to the database\r\n foreach ($records as $record) {\r\n $this->executeQuery('insert into POTEST (UUID, BOOLEAN_VALUE, INT_VALUE, STRING_VALUE) values (\\''.$record['UUID'].'\\','.($record['bool'] ? 1:0).','.$record['int'].', \\''.$record['string'].'\\')');\r\n }\r\n\t\t$query = 'invalid sql query';\r\n $this->setExpectedException('Exception', 'Error in query: '.$query);\r\n\t\t$this->getPersistenceAdapter()->getDataTable($query);\r\n\t}", "#[@test, @expect('rdbms.SQLConnectException')]\n public function connectFailedThrowsException() {\n DriverManager::getConnection(str_replace(\n ':'.$this->db(FALSE)->dsn->getPassword().'@', \n ':hopefully-wrong-password@', \n $this->dsn\n ))->connect();\n }", "public function testStatementThrowsExceptionIncorrectParameterNumber()\n {\n $this->expectException(\\ReflectionException::class);\n\n $connection = new MockConnection($this->mockConnector, $this->mockCompiler);\n $connection->statement(function ($a, $b) {});\n }", "protected function validateDriver($driver)\n {\n $interface = $this->interface();\n\n if (! (new ReflectionClass($driver))->implementsInterface($interface)) {\n throw new InvalidDriverException(get_class($driver).\" does not implement {$interface}\");\n }\n\n return $driver;\n }", "public function testProcessorInvalidFormat()\n {\n $xml = '\n <dummy>\n </dummy>\n ';\n\n $processor = new Processor();\n $user = new User();\n $version = new Version($user);\n\n $this->expectException(\\RuntimeException::class);\n $processor->process($xml, $version);\n }", "private function checkDriver($driver)\n {\n return in_array($driver, $this->model->drivers) ? true : false;\n }", "public function testConstructor_invalidClass()\n {\n new DataPoint('uniqueid', 'an offense', new \\DateTime(), 'Gotham', ['lat' => 0, 'lon' => 0], 'FELONY', '1337');\n }", "public function testGetClassesMappingWithWrongType(): void\n {\n \\Config::set(RB::CONF_KEY_CONVERTER_CLASSES, false);\n\n $this->expectException(Ex\\InvalidConfigurationException::class);\n Lockpick::call(Converter::class, 'getClassesMapping');\n }", "public function testErrorTypeInteraction(): void \n {\n $param = new PhpStanType('bool');\n $this->assertEquals('void', $param->getDocBlockType(Method::FALSY_TYPE));\n $this->assertEquals('void', $param->getSignatureType(Method::FALSY_TYPE));\n \n //int|false => int if the method is falsy\n $param = new PhpStanType('int|false');\n $this->assertEquals('int', $param->getDocBlockType(Method::FALSY_TYPE));\n $this->assertEquals('int', $param->getSignatureType(Method::FALSY_TYPE));\n\n //int|null => int if the method is nullsy\n $param = new PhpStanType('int|null');\n $this->assertEquals('int', $param->getDocBlockType(Method::NULLSY_TYPE));\n $this->assertEquals('int', $param->getSignatureType(Method::NULLSY_TYPE));\n\n $param = new PhpStanType('array|false|null');\n $this->assertEquals('array|null', $param->getDocBlockType(Method::FALSY_TYPE));\n $this->assertEquals('?array', $param->getSignatureType(Method::FALSY_TYPE));\n }", "public function testRejectsAScalarTypeNotDefiningSerialize()\n {\n $this->expectException(InvariantException::class);\n $this->expectExceptionMessage(\n 'SomeScalar must provide \"serialize\" function. If this custom Scalar ' .\n 'is also used as an input type, ensure \"parseValue\" and \"parseLiteral\" ' .\n 'functions are also provided.'\n );\n\n /** @noinspection PhpUnhandledExceptionInspection */\n $this->schemaWithField(\n newScalarType([\n 'name' => 'SomeScalar',\n ])\n );\n\n $this->addToAssertionCount(1);\n }", "function constraint_mustBeDatastoreRecord($record)\n{\n\tif (! $record instanceof Datastore_Record)\n {\n \tthrow new PHP_E_ConstraintFailed(__FUNCTION__);\n }\n}", "abstract public function checkValueType($arg_value);", "public function testAddExeptionForInvalidTag()\n {\n $this->expectException(\\Exception::class);\n\n $table = Tag::create('table1');\n }", "public function testIsValidTypeInvalid()\n {\n $this->assertFalse($this->annotation->isValidType('INVALID'));\n }", "public function testValidationCaseForNonStringSecretKeyPassedForEncryption()\n {\n // Backward compatible for different versions of PHPUnit\n if (method_exists($this, 'expectException')) {\n $this->expectException(\\InvalidArgumentException::class);\n\n NativeRc4::encryptData(['wrong'], '');\n } else {\n $hasThrown = null;\n\n try {\n NativeRc4::encryptData(['wrong'], '');\n } catch (\\InvalidArgumentException $exception) {\n $hasThrown = !empty($exception->getMessage());\n } catch (\\Exception $exception) {\n $hasThrown = $exception->getMessage();\n }\n\n $this->assertTrue($hasThrown);\n\n return;\n }\n }" ]
[ "0.64850545", "0.6130831", "0.6098416", "0.5967255", "0.5961685", "0.5960688", "0.5947933", "0.59406424", "0.59108496", "0.5877371", "0.5867706", "0.5843674", "0.5837843", "0.5770017", "0.57685304", "0.57443947", "0.57237244", "0.5691156", "0.56477463", "0.56367856", "0.5611126", "0.56027937", "0.5599198", "0.5587254", "0.5557624", "0.55471784", "0.5530669", "0.54953593", "0.5482726", "0.54674864", "0.5434863", "0.5418527", "0.54134345", "0.5407858", "0.54063565", "0.5399399", "0.53993773", "0.53745496", "0.5368307", "0.53632885", "0.5360408", "0.5344526", "0.5341992", "0.53343683", "0.53202087", "0.53179127", "0.53072727", "0.52979904", "0.5281683", "0.5276599", "0.52599066", "0.52588457", "0.525422", "0.524145", "0.5238185", "0.5237154", "0.5209296", "0.5203656", "0.5201972", "0.5135882", "0.51320314", "0.51295555", "0.51119035", "0.5107109", "0.510663", "0.5098365", "0.50914145", "0.5082511", "0.50758845", "0.50751245", "0.5059481", "0.50528276", "0.5050848", "0.5050456", "0.50353646", "0.5034759", "0.5033415", "0.5025393", "0.5005739", "0.5000525", "0.500006", "0.49943328", "0.49915954", "0.4979019", "0.49784505", "0.49764955", "0.4966889", "0.49612567", "0.4960089", "0.49569434", "0.49549085", "0.4953524", "0.4945643", "0.49414364", "0.4937707", "0.49331784", "0.49324718", "0.49286032", "0.49245316", "0.49212232" ]
0.6787906
0
Ensure that invalid drivers throw an error
public function testInvalidDriver () { $extension = new AlyxGrayOathTokenExtension(); $config = $this->getConfig ('invalid_driver'); $extension->load (array ($config), new ContainerBuilder()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testConnectBadDriver()\n {\n PDB::connect('ExceptionThrower');\n }", "public function errorIfOldCustomDrivers(): void\n {\n $driversPath = VALET_HOME_PATH.'/Drivers';\n\n if (! $this->files->isDir($driversPath)) {\n return;\n }\n\n foreach ($this->files->scanDir($driversPath) as $driver) {\n if (! ends_with($driver, 'ValetDriver.php')) {\n continue;\n }\n\n if (! str_contains($this->files->get($driversPath.'/'.$driver), 'namespace')) {\n warning('Please make sure all custom drivers have been upgraded for Valet 4.');\n warning('See the upgrade guide for more info:');\n warning('https://github.com/laravel/valet/blob/master/UPGRADE.md');\n exit;\n }\n }\n }", "public function testConnectInvalidDriver()\n {\n PDB::connect('Fake');\n }", "public function testItShouldThrowExceptionWhenInvalidConfigOptions()\n {\n $this->expectException(InvalidArgumentException::class);\n $this->expectExceptionMessage('List drivers MUST not empty.');\n\n new ChainDriver([]);\n }", "private static function _checkParams(array $params)\n {\n // check existence of mandatory parameters\n\n // driver\n if ( ! isset($params['driver']) && ! isset($params['driverClass'])) {\n throw DBALException::driverRequired();\n }\n\n // check validity of parameters\n\n // driver\n if (isset($params['driver']) && ! isset(self::$_driverMap[$params['driver']])) {\n throw DBALException::unknownDriver($params['driver'], array_keys(self::$_driverMap));\n }\n\n if (isset($params['driverClass']) && ! in_array('Doctrine\\DBAL\\Driver', class_implements($params['driverClass'], true))) {\n throw DBALException::invalidDriverClass($params['driverClass']);\n }\n }", "public function testDriverNotExisting()\n\t{\n\t\t$this->setExpectedException( 'InvalidArgumentException' );\t\t\n\t\t$config = CCConfig::create( null, 'beep' );\n\t}", "public function testInvalidDriverType() {\n $extension = new AlyxGrayOathTokenExtension();\n $config = $this->getConfig ('invalid_driver_type');\n $extension->load (array ($config), new ContainerBuilder());\n }", "public function testMakeWithInvalidDriverThrowsException()\n\t{\n\t\t\\Orchestra\\Widget::make('menus');\n\t}", "function db_driver_error()\n{\n global $_db;\n\n return pg_result_error($_db['resource'][$_db['target']]['dbh']);\n}", "protected function validateOrThrow() {}", "public function checkForErrors()\n {\n if ($this->getDebtor() == '' && $this->getDebtorCode() == '') {\n throw new \\InvalidArgumentException(\n sprintf('Debtor or DebtorCode must be defined')\n );\n }\n\n if ($this->getDomain() == '') {\n throw new \\InvalidArgumentException(\n sprintf('Domain must be defined')\n );\n }\n\n if ($this->getTld() == '') {\n throw new \\InvalidArgumentException(\n sprintf('Tld must be defined')\n );\n }\n }", "public function testErrorHandling()\n\t{\n\t\tR::nuke();\n\t\tR::store( R::dispense( 'book' ) );\n\t\tR::freeze( FALSE );\n\t\tR::find( 'book2', ' id > 0' );\n\t\tpass();\n\t\tR::find( 'book', ' id2 > ?' );\n\t\tpass();\n\t\t$exception = NULL;\n\t\ttry {\n\t\t\tR::find( 'book', ' id = ?', array( 0, 1 ) );\n\t\t} catch( \\Exception $e ) {\n\t\t\t$exception = $e;\n\t\t}\n\t\tasrt( ( $exception instanceof SQL ), TRUE );\n\t\tR::freeze( TRUE );\n\t\t$exception = NULL;\n\t\ttry {\n\t\t\tR::find( 'book2', ' id > 0' );\n\t\t} catch( \\Exception $e ) {\n\t\t\t$exception = $e;\n\t\t}\n\t\tasrt( ( $exception instanceof SQL ), TRUE );\n\t\t$exception = NULL;\n\t\ttry {\n\t\t\tR::find( 'book', ' id2 > 0' );\n\t\t} catch( \\Exception $e ) {\n\t\t\t$exception = $e;\n\t\t}\n\t\tasrt( ( $exception instanceof SQL ), TRUE );\n\t}", "function check(){\r\n\t\tglobal $PDBCExceptionException;\r\n\t\tif($PDBCExceptionException)\r\n\t\t\tPDBCException::raise($PDBCExceptionException);\r\n\t}", "protected function _checkAdapter()\n {\n $notDefined = !is_object($this->_adapter);\n $isAdapter = $this->_adapter instanceof AdapterInterface;\n\n if ($notDefined || !$isAdapter) {\n throw new InvalidArgumentException(\n \"You need to set the database adapter for this schema loader.\"\n );\n }\n }", "protected function checkDriverConfig($config);\n\t{\n\t\tif ( ! isset($config['driver'])) throw new Exception('No Database driver provided');\n\t\t$availableDrivers = array('Pdo_MySQL', 'Pdo_Sqlite');\n\t\tif ( ! in_array($config['driver'],$availableDrivers)) throw new Exception('Only Pdo_MySQl or Pdo_Sqlite allowed');\n\t\tif ( ! isset($config['database'])) throw new Exception('No database provided');\n\t\tif ($config['driver'] == 'Pdo_MySQL') {\n\t\t\tif ( ! isset($config['username'])) throw new Exception('No username provided');\n\t\t\tif ( ! isset($config['password'])) throw new Exception('No password provided');\n\t\t}\n\t}", "public function testPrepareThrowsRuntimeExceptionOnInvalidSqlWithErrorReportingDisabled()\n {\n error_reporting(0);\n $sql = \"INVALID SQL\";\n $this->statement->setSql($sql);\n\n $this->expectException(\n RuntimeException::class,\n 'Error message'\n );\n $this->statement->prepare();\n }", "#[@test, @expect('rdbms.SQLConnectException')]\n public function connectFailedThrowsException() {\n DriverManager::getConnection(str_replace(\n ':'.$this->db(FALSE)->dsn->getPassword().'@', \n ':hopefully-wrong-password@', \n $this->dsn\n ))->connect();\n }", "public function testNotOperational1()\r\n {\r\n global $pretend;\r\n\r\n $gd = $this->createGd('test.png');\r\n self::resetPretending();\r\n\r\n $pretend['functionsNotExisting'] = ['imagewebp'];\r\n $this->expectException(SystemRequirementsNotMetException::class);\r\n $gd->checkOperationality();\r\n }", "protected static function throwHardCheckError()\n {\n throw new \\InvalidArgumentException('Value has wrong type');\n }", "private function checkForModuleOrFunctionException():void\n {\n // check for module and function error\n if ($this->hasError()) {\n //check for bad module\n $this->moduleExceptionChecker();\n\n //check for bad function\n $this->functionExceptionChecker();\n }\n }", "protected function check() {\n\n // check for a valid GD lib installation \n if(!function_exists('gd_info')) raise('GD Lib is not installed');\n\n }", "public function testGetDevicesWithValidDevices()\n {\n }", "public function testIsVendorClassThrowsExceptionIfNoClassNameOrObjectIsPassed()\n {\n $this->expectException('InvalidArgumentException');\n VendorResources::isVendorClass('NoValidClassName');\n }", "function broken() { return TRUE; }", "protected function checkEnvironmentOrDie() {}", "public function testGetDriversLicense()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "public function valid()\n {\n throw new PDOException('valid() method is not implemented for Oci8PDO_Statement');\n }", "protected function check_errors()\n {\n if (true === $this->error_flag) {\n throw new \\Exception($this->get_error( true ));\n }\n }", "function validate() {\n throw new Exception(\"Invalid validate call\");\n }", "public function testNotOperational2()\r\n {\r\n global $pretend;\r\n\r\n $gd = $this->createGd('test.png');\r\n self::resetPretending();\r\n\r\n $pretend['extensionsNotExisting'] = ['gd'];\r\n $this->expectException(SystemRequirementsNotMetException::class);\r\n $gd->checkOperationality();\r\n $pretend['extensionsNotExisting'] = [];\r\n }", "public function invalidParameterTypesPassedToBindValueThrowsExceptionDataProvider() {}", "public static function supportedDrivers()\n {\n }", "public function capable(\\Exception $error);", "public function testDiceInvalidRegister()\n {\n $dice = new DiceAdapter();\n $dice->register();\n }", "public static function availableDrivers()\n {\n }", "public function testNonExistentSystem()\n {\n $result = DALBaker::loadQueriesXml('InvalidSystem');\n PHPUnit_Framework_Assert::assertNull($result);\n\n }", "public function testExceptExceptionWithEmptyDatabse()\n {\n $this->expectException(\"ArgumentCountError\");\n $database = new \\Database();\n }", "protected function error()\n\t{\t\t\n\t\tif(self::$arrDbConf[$this -> databaseName] !== 1)\n\t\tthrow new SystemException('Không tồn tại con trỏ database!');\n\t\telseif($this -> tableName ==='')\n\t\tthrow new SystemException('Không tồn tại tên bảng!');\n\t\telse\n\t\treturn true;\n\t}", "public function checkOperationality()\n {\n if (!extension_loaded('gd')) {\n throw new SystemRequirementsNotMetException('Required Gd extension is not available.');\n }\n\n if (!function_exists('imagewebp')) {\n throw new SystemRequirementsNotMetException(\n 'Gd has been compiled without webp support.'\n );\n }\n }", "public function testInvalidConnectionCredentialsDB()\r\n\t\t{\r\n\t\t\tORM::init('mysql:host=localhost;dbname=doesnotexistdb', 'orm_username', 'orm_password');\r\n\t\t}", "public function testPdoException() {\n\n\t\t$cfg = new PdoConnectionTestConfig();\n\n\t\t$conn = new \\Scrivo\\PdoConnection($cfg);\n\n\t}", "function module_builder_handle_sanity_exception($e) {\n $failed_sanity_level = $e->getFailedSanityLevel();\n switch ($failed_sanity_level) {\n case 'data_directory_exists':\n $message = \"The component data directory could not be created or is not writable.\";\n break;\n case 'component_data_processed':\n $message = \"No component data was found. Run 'drush mb-download' to process component data from documentation files.\";\n break;\n }\n drush_set_error(DRUSH_APPLICATION_ERROR, $message);\n}", "protected function abortIfSetupIncorrectly()\n {\n if(! $this->username OR ! $this->password OR ! $this->clientCode OR ! $this->url) throw new ErplySyncException('Missing parameters', self::MISSING_PARAMETERS);\n }", "public function testImportingQueueEngineFailure(): void\n {\n $this->expectException('\\InvalidArgumentException');\n\n Queue::setConfig('fail', []);\n Queue::engine('fail');\n }", "public function testLibraryGetErrorForNonRegisteredService(): void\r\n {\r\n $serviceLibrary = new ServiceLibrary(new ArrayParser());\r\n $this->assertFalse($serviceLibrary->has('AdditionalService'));\r\n\r\n $this->expectExceptionCode(Error::ERROR_SERVICE_NOT_FOUND->getCode());\r\n $serviceLibrary->get('AdditionalService');\r\n }", "public function testChargeNonChargeableCardFails(): void\n {\n $this->expectException(StripePaymentException::class);\n\n $this->porter->importOne(\n new ImportSpecification(new CreateCharge(FixtureFactory::createNonChargeableCard(), 1337, 'GBP'))\n );\n }", "private function checkError() : void\n {\n $this->isNotPost();\n $this->notExist();\n $this->notAdmin();\n }", "function checkForDbError($preparedStatement) {\n\t\t\t$error = $preparedStatement->errorInfo();\n\t\t\tif ($error != null && count($error) > 0 && $error[0] > 0)\n\t\t\t\tdie(\"Insert failed on: $error[2]\");\n\t}", "public function testCheckExpectConnectNullException()\n {\n $PDOFactory = new PDOFactory(\n 'sqlite::memory:',\n null,\n null\n );\n\n $dBBaseTableExistCheck = $this->getDBBaseTableExistCheckBuilder()\n ->disableProxyingToOriginalMethods()\n ->getMock();\n\n $dBBaseTableExistCheck\n ->method('getPDOInstance')\n ->willReturn(null);\n\n $checkResult = $dBBaseTableExistCheck->performCheck();\n\n $this->assertInstanceOf(\n DBExpectConnectCheckException::class,\n $checkResult->getError()\n );\n }", "public function fails();", "public function fails();", "private function checkDriver($driver)\n {\n return in_array($driver, $this->model->drivers) ? true : false;\n }", "public function testUnknownDataSourceType(): void\n {\n $dataSourceType = 'not-handled';\n $this->expectException(\\InvalidArgumentException::class);\n $this->expectExceptionMessage(\n AssertionException::inArray(\n $dataSourceType,\n MetaService::AVAILABLE_DATA_SOURCE_TYPES,\n 'MetaService::dataSourceType'\n )->getMessage()\n );\n new MetaService(1, 'Meta 1', 'average', 1, $dataSourceType);\n }", "public function testCallThrowsExceptionIfEnvironmentIsInvalid()\n {\n $this->setExpectedException('OutOfBoundsException');\n \n // method name must be defined in possible values array\n (new DetectEnvironment($this->name, []))->isDevelopment();\n \n return;\n }", "public function testValidationCaseForNonStringSecretKeyPassedForEncryption()\n {\n // Backward compatible for different versions of PHPUnit\n if (method_exists($this, 'expectException')) {\n $this->expectException(\\InvalidArgumentException::class);\n\n NativeRc4::encryptData(['wrong'], '');\n } else {\n $hasThrown = null;\n\n try {\n NativeRc4::encryptData(['wrong'], '');\n } catch (\\InvalidArgumentException $exception) {\n $hasThrown = !empty($exception->getMessage());\n } catch (\\Exception $exception) {\n $hasThrown = $exception->getMessage();\n }\n\n $this->assertTrue($hasThrown);\n\n return;\n }\n }", "function broken() { }", "public function testUnsupportedFeatures()\n {\n $notSupported = [\n 'getPublishedList' => function () { return $this->api->getPublishedList(); },\n 'create' => function () { return $this->api->create([]); },\n 'edit' => function () { return $this->api->edit('x', []); },\n 'delete' => function () { return $this->api->delete('x'); },\n ];\n foreach ($notSupported as $key => $closure) {\n $response = $closure();\n $this->assertTrue(!empty($response['errors']), 'Should contain Error element');\n $this->assertEquals($response['errors'][0]['code'], 500, 'Should contain code 500');\n $this->assertEquals($response['errors'][0]['message'], $key.' is not supported at this time.', 'Should be equal');\n }\n }", "private function throwException()\n {\n throw new CacheException(\\odbc_errormsg(), (int) \\odbc_error());\n }", "public function deviceConditionDoesNotMatchRobot() {}", "public function deviceConditionDoesNotMatchRobot() {}", "protected function checkEnvironmentOrDie(): void\n {\n if (PHP_SAPI !== 'cli') {\n die('Not called from a command line interface (e.g. a shell or scheduler).' . LF);\n }\n }", "public function testDriver()\n {\n $img = new P4Cms_Image();\n $this->assertFalse(\n $img->hasDriver(),\n 'Expected no driver to be set on new P4Cms_Image.'\n );\n\n if (extension_loaded('gd')) {\n $gd = new P4Cms_Image_Driver_Gd();\n $img->setDriver($gd);\n $this->assertTrue(\n $img->hasDriver(),\n 'Expected gd driver to be set.'\n );\n } else {\n $this->markTestIncomplete(\"Cannot verify default driver, 'gd' extension not found.\");\n }\n\n $driver = $img->getDriver();\n $this->assertSame(\n $gd,\n $driver,\n 'Expected gd driver to be returned by getDriver.'\n );\n }", "public function testOfMethodThrowsException()\n {\n $this->expectException('InvalidArgumentException');\n\n $stub = new Grid($this->getContainer(), []);\n $stub->of('id');\n }", "public function test_it_should_throw_an_exception_on_invalid_url()\n {\n SourceFactory::create('unknown');\n }", "public function testGetUserWhenPDOThrowsException()\n {\n $this->db->expects($this->once())\n ->method('prepare')\n ->will($this->throwException(new \\PDOException));\n $id = 'bbccdd1134';\n $userService = new UserService($this->db);\n $retrievedUser = $userService->retrieve($id);\n $this->assertNull($retrievedUser); \n }", "public function testCallThrowsExceptionIfMethodIsInvalid()\n {\n $this->setExpectedException('BadMethodCallException');\n \n // method name must start with \"is\"\n (new DetectEnvironment($this->name, []))->foo();\n \n return;\n }", "public function testExceptExceptionWithWrongDatabaseInfo()\n {\n $this->expectException(\"Exception\");\n $randomData = (object) array(\n \"user\" => $this->generateRandomString(5),\n \"password\" => $this->generateRandomString(10),\n \"host\" => $this->generateRandomString(120),\n \"database\" => $this->generateRandomString(15),\n \"port\" => random_int(1000, 16200)\n );\n\n /**\n * Creating annomous class,\n * I think I found a caseuse for interfaces now.\n */\n $settings = new class ($randomData) {\n private $data;\n public function __construct($data)\n {\n $this->data = $data;\n }\n public function getDatabaseConfig()\n {\n return $this->data;\n }\n };\n\n $database = new \\Database($settings);\n }", "protected function checkInvalidSqlModes() {}", "public function testIsPaymentMethodCreatableThrowApiException()\n {\n // $this->expectException(\\Xendit\\Exceptions\\InvalidArgumentException::class);\n $this->expectException(\\Xendit\\Exceptions\\ApiException::class);\n $params = self::PAYMENT_METHOD_PARAMS;\n\n DirectDebit::createPaymentMethod($params);\n }", "public function test_no_user_agent_exception() {\n\t\tunset($_SERVER['HTTP_USER_AGENT']);\n\t\ttry {\n\t\t\tparse_user_agent();\n\t\t} catch(\\InvalidArgumentException $ex) {\n\t\t\t$this->assertTrue(true); // easy way to quiet warning\n\t\t\treturn;\n\t\t}\n\n\t\t$this->fail(\"Expected \\InvalidArgumentException\");\n\t}", "public function testCreateWillThrowFactoryExceptionIfProvidedAdapterIsInvalid(): void\r\n {\r\n $factory = new ContainerFactory();\r\n\r\n $config = [\r\n 'adapter' => 123, // invalid adapter!\r\n ];\r\n\r\n $this->expectException(FactoryException::class);\r\n $this->expectExceptionMessage(sprintf(\r\n 'The \\'adapter\\' configuration option must be a object of type \\'%s\\'; \\'%s\\' provided in \\'%s\\'',\r\n ContainerAdapterInterface::class,\r\n gettype($config['adapter']),\r\n ContainerFactory::class\r\n ));\r\n\r\n $factory->create($config);\r\n }", "private function checkValid()\n\t{\n\t\tif(!$this->isValid()) {\n\t\t\tthrow new \\RuntimeException(\"TypeStruct Error: '\".get_called_class().\"' not validated to perform further operations\");\t\n\t\t}\n\t}", "public function testAddExeptionForInvalidTag()\n {\n $this->expectException(\\Exception::class);\n\n $table = Tag::create('table1');\n }", "private function __checkFormat($format)\n {\n if (!in_array($format, $this->_availableFormats)) {\n throw new \\Exception();\n }\n }", "public function testInvalidTypeException() {\n\t\t$options = array(\n\t\t\t'adapter' => 'foo'\n\t\t);\n\t\t$this->expectException('/Could not find adapter `Foo`/');\n\t\tFixture::load('models/Posts', $options);\n\t}", "public function testValidationCaseForInvalidTypeOfKeyExpansionServicePassedOnInitialization()\n {\n // Backward compatible for different versions of PHPUnit\n if (method_exists($this, 'expectException')) {\n $this->expectException(\\RuntimeException::class);\n\n $protocol = new KeyExchange(null);\n } else {\n $hasThrown = null;\n\n try {\n $protocol = new KeyExchange(null);\n } catch (\\RuntimeException $exception) {\n $hasThrown = !empty($exception->getMessage());\n } catch (\\Exception $exception) {\n $hasThrown = $exception->getMessage();\n }\n\n $this->assertTrue($hasThrown);\n\n return;\n }\n }", "public function testInvalidCacheTypeDriverAsOption()\n {\n $container = $this->createMockDefaultApp();\n\n $container->register(new DoctrineOrmServiceProvider);\n\n $container['orm.em.options'] = array(\n 'query_cache' => array(\n 'driver' => 'INVALID',\n ),\n );\n\n try {\n $container['orm.em'];\n\n $this->fail('Expected invalid query cache driver exception');\n } catch (\\RuntimeException $e) {\n $this->assertEquals(\"Unsupported cache type 'INVALID' specified\", $e->getMessage());\n }\n }", "private function ensureInitials()\n\t{\n\t\t$errors = $this->getInitialErrors();\n\n\t\tif($errors)\n\t\t{\n\t\t\tthrow new \\Exception(implode('<br>', $errors), 1);\n\t\t}\n\t}", "public function testInvalidClient()\n {\n $this->expectException(\\Exception::class);\n $cl = CF::getClient([\n \"registrar\" => \"InvalidRegistrar\"\n ]);\n }", "abstract protected function getDriver();", "public function checkConnection()\n {\n $this->last_error = '';\n if (!isset($this->database)) \n $this->connect();\n }", "public function testValidationCaseForNonStringInputDataPassedForEncryption()\n {\n // Backward compatible for different versions of PHPUnit\n if (method_exists($this, 'expectException')) {\n $this->expectException(\\InvalidArgumentException::class);\n\n NativeRc4::encryptData('', ['wrong']);\n } else {\n $hasThrown = null;\n\n try {\n NativeRc4::encryptData('', ['wrong']);\n } catch (\\InvalidArgumentException $exception) {\n $hasThrown = !empty($exception->getMessage());\n } catch (\\Exception $exception) {\n $hasThrown = $exception->getMessage();\n }\n\n $this->assertTrue($hasThrown);\n\n return;\n }\n }", "public function testLibraryBuildFailWithWrongConfigData(): void\r\n {\r\n $serviceLibrary = new ServiceLibrary(new ArrayParser());\r\n $this->expectExceptionCode(Error::ERROR_JSON_ENCODE_OR_DECODE->getCode());\r\n $serviceLibrary->build(NAN);\r\n }", "public static function cmpFqdnInvalidDataProvider() {}", "public function testThrowExceptionOnInvalidCoinType()\n {\n $this->expectException(Exceptions\\InvalidWalletTypeException::class);\n Wallet::validate(self::VALID_BTC_ADDRESS, 'Botchain');\n }", "public function testCreatingNewAssettoCorsaReaderWithInvalidData()\n {\n $this->expectException(\\Simresults\\Exception\\CannotReadData::class);\n $reader = new Data_Reader_AssettoCorsa('Unknown data for reader');\n }", "public function testStatementThrowsExceptionInvalidParameterType()\n {\n $this->expectException(\\ReflectionException::class);\n\n $connection = new MockConnection($this->mockConnector, $this->mockCompiler);\n $connection->statement(function (string $a) {});\n }", "public function testGetInvalidBridgeByBridgeName() {\n\t\t// grab a bridge by searching for content that does not exist\n\t\t$bridge = Bridge::getBridgeByBridgeName($this->getPDO(), \"not a valid key\");\n\t\t$this->assertEmpty($bridge);\n\t}", "public function testPDOExceptionCausesServiceToReturnFalse()\n {\n $this->db->expects($this->at(0))\n ->method('prepare')\n ->with('SELECT id FROM `users` WHERE id = :id')\n ->will($this->returnValue($this->statement));\n\n $this->statement->expects($this->once())\n ->method('execute')\n ->with($this->isType('array'))\n ->will($this->returnValue($this->statement));\n\n $this->statement->expects($this->once())\n ->method('rowCount')\n ->will($this->returnValue(0));\n\n $this->db->expects($this->at(1))\n ->method('prepare')\n ->will($this->throwException(new \\PDOException));\n $user = new User();\n $user->id = '123abcde45';\n $user->firstName = 'Test';\n $user->lastName = 'User';\n $user->email = 'test.user@gmail.com';\n $user->githubHandle = 'testuser';\n $user->ircNick = 'testUser';\n $user->twitterHandle = '@testUser';\n $user->mentorAvailable = true;\n $user->apprenticeAvailable = false;\n $user->timezone = 'America/Chicago';\n $userService = new UserService($this->db);\n $result = $userService->create($user);\n $this->assertFalse($result);\n }", "public function testInvalidConnectionCredentialsUsername()\r\n\t\t{\r\n\t\t\tORM::init('mysql:host=localhost;dbname=doesnotexistdb', array(), 'orm_password');\r\n\t\t}", "private function validate(): void\n {\n if (empty($this->options)) {\n throw new ObjectiphyException('Find options have not been set on the object fetcher.');\n }\n }", "function it_can_throw_error_if_any_required_config_data_missing(Machine $machine)\n {\n $config = new Config(array(), true);\n $this->shouldThrow('\\Exception')->during('createState', array($machine, $config));\n\n // test with description missing\n $config = new Config(array(), true);\n $config->name = 'Test Name';\n $this->shouldThrow('\\Exception')->during('createState', array($machine, $config));\n\n // test with name missing\n $config = new Config(array(), true);\n $config->description = 'Test Description';\n $this->shouldThrow('\\Exception')->during('createState', array($machine, $config));\n }", "public function delegateReleaseSavepointExceptionProcess(DbalDriverException $e);", "public function testCheckConvertability1()\r\n {\r\n global $pretend;\r\n\r\n $gd = $this->createGd('test.png');\r\n self::resetPretending();\r\n\r\n $pretend['functionsNotExisting'] = ['imagecreatefrompng'];\r\n $this->expectException(SystemRequirementsNotMetException::class);\r\n $gd->checkConvertability();\r\n $pretend['functionsNotExisting'] = [];\r\n }", "public function testRequiredKeys()\n {\n $this->expectException(InvalidArgumentException::class);\n $this->expectExceptionMessage('Cannot create a SmartwaiverSignatures with missing field: waiverId');\n\n $signatures = SmartwaiverTypes::createSignatures();\n unset($signatures['waiverId']);\n\n $swSignatures = new SmartwaiverSignatures($signatures);\n }", "public function testInvalidModule(): void\n {\n $result = $this->check->run('Users1');\n $result = $this->check->getErrors();\n $this->assertTrue(is_array($result), \"getErrors() returned a non-array result\");\n }", "protected function validatePlatform(AbstractPlatform $platform): void\n {\n $platformName = $platform->getName();\n\n if (!in_array($platformName, $this->getPlatforms())) {\n throw new UnsupportedPlatformException(\n sprintf('DBAL platform \"%s\" is not currently supported.', $platformName)\n );\n }\n }", "protected function validateParameters()\n {\n if (empty($this->save_path)) {\n throw new \\Exception(\"The 'save_path' is not specified!\");\n }\n }", "public function it_cant_create_invalid()\n {\n $this->shouldThrow('\\Aspire\\DIC\\Exception\\NotFoundException')->duringGet('SomeClassThatDoesNotExist');\n }", "public function testShouldFailIFARegistrationIsCreatedWithoutSource() {\n $this->expectException(\\PDOException::class);\n \n $entity = new Registration;\n $entity->registrant_id = $this->getRegistrant()->id;\n $entity->type = 'PLAYER' ;\n $entity->league = 'league';\n $entity->org_name = 'Oranization...';\n $entity->org_state = 'NY';\n $entity->season = '2017';\n $entity->external_id = 'myexternalid';\n $entity->right_to_market = true;\n $entity->team_gender = 'Male';\n $entity->team_name = 'A-Team';\n $entity->school_district = 'school district';\n $entity->school_state = 'school sate';\n $entity->first_name = 'Firt name';\n $entity->middle_name = 'Middle name';\n $entity->last_name = 'Last Name';\n $entity->email = 'mail@mail.com';\n $entity->gender = 'Male';\n $entity->city = 'California';\n $entity->zip_code = '234141234123';\n $entity->birth_date = '11/27/1984';\n $entity->phone_number = '1234567890';\n $entity->game_type = 'SOME';\n $entity->level = 'LEVEL';\n $entity->state = 'CALIFORNIA';\n $entity->address_first_line = 'An Address 1234';\n $entity->county = 'A county';\n\n $entity->save();\n }" ]
[ "0.6741538", "0.6528959", "0.63926303", "0.63800675", "0.63086706", "0.6306741", "0.6128391", "0.59337974", "0.58745855", "0.5808472", "0.5794968", "0.57836556", "0.57477957", "0.5737482", "0.56849957", "0.56812716", "0.55956763", "0.5592794", "0.5592146", "0.5543559", "0.5533189", "0.549395", "0.5487112", "0.5486211", "0.54813963", "0.5476234", "0.54559433", "0.54504704", "0.54485893", "0.54439616", "0.54354215", "0.54076755", "0.54016745", "0.5395092", "0.5378018", "0.5370901", "0.53697765", "0.53582376", "0.53551954", "0.53346276", "0.53264457", "0.5321881", "0.53203094", "0.5316349", "0.53108656", "0.52930474", "0.5291665", "0.5290931", "0.52875704", "0.5278671", "0.5278671", "0.5271891", "0.5252382", "0.52484304", "0.5233745", "0.52252895", "0.52162945", "0.5214622", "0.52010936", "0.5198889", "0.5180754", "0.5173274", "0.5172259", "0.5162455", "0.5161972", "0.5159367", "0.51575786", "0.51550597", "0.51461935", "0.5140339", "0.51368016", "0.51270026", "0.5124386", "0.51227015", "0.51208395", "0.51205117", "0.511375", "0.5105526", "0.5095162", "0.5094907", "0.5088432", "0.5087407", "0.50873435", "0.50740236", "0.5071323", "0.50710934", "0.50663567", "0.50519514", "0.5047496", "0.5047284", "0.50471944", "0.50454944", "0.50452554", "0.50420785", "0.50419706", "0.50343806", "0.5023373", "0.5020962", "0.5016214", "0.5014862" ]
0.65324426
1
Test configuration parsing for the SQLite driver
public function testSQLiteDriver () { $extension = new AlyxGrayOathTokenExtension(); $config = $this->getConfig ('sqlite'); $extension->load (array ($config), new ContainerBuilder()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testDb()\n {\n // print_r($cfg);\n\n // $params = array('adapter', 'host', 'username', 'password', 'dbname');\n // foreach ($params as $param) {\n // $this->assertArrayHasKey(\n // $param, $cfg['database'], 'db缺少' . $param . '配置'\n // );\n // }\n // $dbCfg = $cfg['database'];\n // $dsn = '' . strtolower($dbCfg['adapter']) . ':host=' . $dbCfg['host'] . ';dbname=' . $dbCfg['dbname'] . '';\n\n // new PDO($dsn, $dbCfg['username'], $dbCfg['password']);\n }", "public function testConfig()\n {\n $connection = new MockConnection($this->mockConnector, $this->mockCompiler);\n $this->assertEquals('mock', $connection->config('driver'));\n }", "public function test_connect()\n\t{\n\t\t$this->assertTrue( DB::connect( 'phpunit_sqlite' ) );\n\t}", "public function testGetWithConfig()\n {\n TableRegistry::config('Articles', [\n 'table' => 'my_articles',\n ]);\n $result = TableRegistry::get('Articles');\n $this->assertEquals('my_articles', $result->table(), 'Should use config() data.');\n }", "public function testDatabaseConfig() {\n $class = $this->carClass;\n \n $this->assertEquals( \n $this->databaseConfig, \n $class::DatabaseConfigName()\n );\n }", "public function testConfigAndBuild()\n {\n TableRegistry::clear();\n $map = TableRegistry::config();\n $this->assertEquals([], $map);\n\n $connection = ConnectionManager::get('test', false);\n $options = ['connection' => $connection];\n TableRegistry::config('users', $options);\n $map = TableRegistry::config();\n $this->assertEquals(['users' => $options], $map);\n $this->assertEquals($options, TableRegistry::config('users'));\n\n $schema = ['id' => ['type' => 'rubbish']];\n $options += ['schema' => $schema];\n TableRegistry::config('users', $options);\n\n $table = TableRegistry::get('users', ['table' => 'users']);\n $this->assertInstanceOf('Cake\\ORM\\Table', $table);\n $this->assertEquals('users', $table->table());\n $this->assertEquals('users', $table->alias());\n $this->assertSame($connection, $table->connection());\n $this->assertEquals(array_keys($schema), $table->schema()->columns());\n $this->assertEquals($schema['id']['type'], $table->schema()->column('id')['type']);\n\n TableRegistry::clear();\n $this->assertEmpty(TableRegistry::config());\n\n TableRegistry::config('users', $options);\n $table = TableRegistry::get('users', ['className' => __NAMESPACE__ . '\\MyUsersTable']);\n $this->assertInstanceOf(__NAMESPACE__ . '\\MyUsersTable', $table);\n $this->assertEquals('users', $table->table());\n $this->assertEquals('users', $table->alias());\n $this->assertSame($connection, $table->connection());\n $this->assertEquals(array_keys($schema), $table->schema()->columns());\n }", "public function setUp(): void\n {\n parent::setUp();\n\n if ($this->getConnection()->config()['scheme'] !== 'postgres') {\n $this->markTestSkipped('Skipping tests for postgres, current driver is `' . $this->getConnection()->config()['scheme'] . '`');\n }\n }", "public function testDefaultsApplying()\n {\n $cfg = new ConfigLoader(realpath(__DIR__ . '/../config/database-config.ini'), $this->config);\n $ro = new \\ReflectionObject($cfg);\n $prop = $ro->getProperty('configs');\n $prop->setAccessible(true);\n $value = $prop->getValue($cfg);\n\n $this->assertTrue(is_scalar($value['main']['dbClassImpl']));\n }", "public function testWith_DsnIsDriverAndPathOptExt()\n {\n $config = Config::with(\"dir:{$this->dir}\", array('ext'=>'mock'));\n $this->checkWithResult($config);\n }", "protected function checkDriverConfig($config);\n\t{\n\t\tif ( ! isset($config['driver'])) throw new Exception('No Database driver provided');\n\t\t$availableDrivers = array('Pdo_MySQL', 'Pdo_Sqlite');\n\t\tif ( ! in_array($config['driver'],$availableDrivers)) throw new Exception('Only Pdo_MySQl or Pdo_Sqlite allowed');\n\t\tif ( ! isset($config['database'])) throw new Exception('No database provided');\n\t\tif ($config['driver'] == 'Pdo_MySQL') {\n\t\t\tif ( ! isset($config['username'])) throw new Exception('No username provided');\n\t\t\tif ( ! isset($config['password'])) throw new Exception('No password provided');\n\t\t}\n\t}", "public static function setUpBeforeClass()\n {\n return;\n\n self::$pdo = PDOFactory::makePDO();\n self::$pdo->setAttribute(\\PDO::ATTR_ERRMODE, \\PDO::ERRMODE_EXCEPTION);\n\n self::$pdo->exec(\"DROP TABLE IF EXISTS bank\");\n self::$pdo->exec(\n \"CREATE TEMPORARY TABLE bank (\n id int primary key,\n blz char(8),\n isMain tinyint(1),\n name varchar(58),\n plz varchar(5),\n city varchar(35),\n shortterm varchar(27),\n pan char(5),\n bic varchar(11),\n validator char(2),\n index(blz),\n index(name),\n index(shortterm),\n index(pan),\n index(bic)\n ) engine=MEMORY\"\n );\n\n $fp = fopen(__DIR__ . '/../../data/banklist.txt', 'r');\n if (! is_resource($fp)) {\n throw new RuntimeException('I/O-Error');\n\n }\n\n $insert = self::$pdo->prepare(\n \"INSERT INTO bank\n ( id, blz, isMain, name, plz, city, shortterm, pan, bic, validator)\n VALUES (:id, :blz, :isMain, :name, :plz, :city, :shortTerm, :pan, :bic, :validator)\"\n );\n $insert->bindParam(':id', $id);\n $insert->bindParam(':blz', $blz);\n $insert->bindParam(':isMain', $isMain);\n $insert->bindParam(':name', $name);\n $insert->bindParam(':plz', $plz);\n $insert->bindParam(':city', $city);\n $insert->bindParam(':shortTerm', $shortTerm);\n $insert->bindParam(':pan', $pan);\n $insert->bindParam(':bic', $bic);\n $insert->bindParam(':validator', $validator);\n\n while ($line = fgets($fp)) {\n $blz = substr($line, 0, 8);\n $isMain = ($line{8} === '1') ? 1 : 0;\n $name = trim(substr($line, 9, 58));\n $plz = trim(substr($line, 67, 5));\n $city = trim(substr($line, 72, 35));\n $shortTerm = trim(substr($line, 107, 27));\n $pan = trim(substr($line, 134, 5));\n $bic = trim(substr($line, 139, 11));\n $validator = substr($line, 150, 2);\n $id = substr($line, 152, 6);\n\n $insert->execute();\n\n }\n fclose($fp);\n }", "public function test_handler()\n\t{\n\t\t$handler = DB::handler( 'phpunit_sqlite' );\n\n\t\t$this->assertTrue( $handler instanceof \\DB\\Handler );\n\n\t\t$this->assertTrue( $handler->connected() );\n\n\t\t$this->assertTrue( $handler->driver() instanceof \\DB\\Handler_Driver );\n\t\t\n\t\t$this->assertTrue( $handler->driver() instanceof \\DB\\Handler_Sqlite );\n\n\t\t$this->assertTrue( $handler->statement( 'select * from people' ) instanceof \\PDOStatement );\n\t}", "protected function fixture() {\n return new \\rdbms\\sqlite3\\SQLite3Connection(new \\rdbms\\DSN('sqlite://localhost/'));\n }", "protected function setUpTestDatabase() {}", "public function setUp()\n\t{\n\t\tparent::setUp();\n\n\t\tif ( ! extension_loaded('pdo_sqlite'))\n\t\t{\n\t\t\t$this->markTestSkipped('SQLite PDO PHP Extension is not available');\n\t\t}\n\n\t\tif ( ! Kohana::$config->load('cache.sqlite'))\n\t\t{\n\t\t\tKohana::$config->load('cache')\n\t\t\t\t->set(\n\t\t\t\t\t'sqlite',\n\t\t\t\t\t[\n\t\t\t\t\t\t'driver' => 'sqlite',\n\t\t\t\t\t\t'default_expire' => 3600,\n\t\t\t\t\t\t'database' => 'memory',\n\t\t\t\t\t\t'schema' => 'CREATE TABLE caches(id VARCHAR(127) PRIMARY KEY, tags VARCHAR(255), expiration INTEGER, cache TEXT)',\n\t\t\t\t\t]\n\t\t\t\t);\n\t\t}\n\n\t\t$this->cache(Cache::instance('sqlite'));\n\t}", "public function testCustomDBPath() {\n $dbdata = HermesHelper::getMagentoDBConfig($this->_dbFile);\n $this->assertNotNull((string)$dbdata->host);\n $this->assertNotNull((string)$dbdata->username);\n $this->assertNotNull((string)$dbdata->password);\n $this->assertNotNull((string)$dbdata->dbname);\n\n //From phpunit path, the config file shouldn't be found.\n set_exit_overload(function($message) { Etailers_HermesHelper_Test::setMessage($message); return FALSE; });\n $dbdata = HermesHelper::getMagentoDBConfig();\n unset_exit_overload();\n $this->assertEquals('Unable to load magento db config file.', self::$message);\n }", "public function testWith_DsnIsDriverAndPathOptExtArgTr()\n {\n $config = Config::with(\"dir:{$this->dir}\", array('ext'=>'yaml', 'transformer'=>'from-mock'));\n $this->checkWithTrResult($config);\n }", "protected function setUp()\n\t{\n $dsn = sprintf('sqlite:%s/pdo_test.db', __DIR__);\n $this->pdo = new \\PDO($dsn);\n $this->handler = new Handler($this->pdo);\n\n\t\t// create our logger and our pdo handler\n\t\t$this->logger = new Logger(self::APP_NAME);\n $this->logger->pushHandler($this->handler);\n\n // drop the table\n $drop_sql = sprintf(\"\n\t\t\tDROP TABLE IF EXISTS %s;\n\t\t\", Handler::DEFAULT_TABLE_NAME);\n\n\t\t$this->pdo->exec($drop_sql);\n \n // create the table\n\t\t$create_sql = sprintf(\"\n CREATE TABLE %s (\n id integer(11) PRIMARY KEY,\n time datetime DEFAULT(CURRENT_TIMESTAMP),\n level varchar(100) NOT NULL,\n channel varchar(25) NOT NULL,\n message text\n );\n \", Handler::DEFAULT_TABLE_NAME);\n\n $this->pdo->exec($create_sql);\n\t}", "public function testGetExistingWithConfigData()\n {\n $users = TableRegistry::get('Users');\n TableRegistry::get('Users', ['table' => 'my_users']);\n }", "public function setUp()\n\t{ \n\t\tparent::setUp();\n\n\t\t$this->app['config']->set('database.default','sqlite');\t\n\t\t$this->app['config']->set('database.connections.sqlite.database', ':memory:');\n\n\t\t$this->migrate();\n\t}", "public function init()\n {\n parent::init();\n if ($this->db->driverName !== 'sqlite') {\n throw new InvalidConfigException('In order to use SqliteMutex connection must be configured to use Sqlite database.');\n }\n }", "protected function setUp()\r\n {\r\n parent::setUp();\r\n\r\n $this->driver = new Driver([\r\n 'dsn' => 'mysql:dbname=mysql;host=127.0.0.1'\r\n ]);\r\n }", "public function initDb($configuration) {\n\n $dataSource = $configuration->dataSource();\n\n $dataSource->exec('DROP TABLE IF EXISTS user');\n $dataSource->exec('DROP TABLE IF EXISTS project');\n $dataSource->exec('DROP TABLE IF EXISTS projectInfo');\n $dataSource->exec('DROP TABLE IF EXISTS bug');\n $dataSource->exec('DROP TABLE IF EXISTS resource');\n $dataSource->exec('DROP TABLE IF EXISTS addSillyRecord');\n $dataSource->exec('DROP TABLE IF EXISTS sillyRecord');\n $dataSource->exec('DROP TABLE IF EXISTS uuidRecord');\n \n $dataSource->exec('\nCREATE TABLE user (\nuserId INTEGER PRIMARY KEY AUTOINCREMENT,\nname TEXT NOT NULL,\nfavoriteProjectId INTEGER\n )\n');\n\n $dataSource->exec('\nCREATE TABLE project (\nprojectId INTEGER PRIMARY KEY AUTOINCREMENT,\nname TEXT NOT NULL,\nmanagerUserId INTEGER NOT NULL\n)\n');\n\n $dataSource->exec('\nCREATE TABLE projectInfo (\nprojectInfoId INTEGER PRIMARY KEY AUTOINCREMENT,\nprojectId INTEGER NOT NULL,\ndescription TEXT NOT NULL\n)\n');\n\n $dataSource->exec('\nCREATE TABLE bug (\nbugId INTEGER PRIMARY KEY AUTOINCREMENT,\ntitle TEXT NOT NULL,\nbody TEXT NOT NULL,\nprojectId INTEGER NOT NULL,\nreporterUserId INTEGER NOT NULL,\nownerUserId INTEGER\n)\n');\n\n $dataSource->exec('\nCREATE TABLE resource (\nresourceId TEXT NOT NULL,\nname TEXT NOT NULL\n)\n');\n\n $dataSource->exec('\nCREATE TABLE sillyRecord (\nrecordId TEXT NOT NULL,\nname TEXT NOT NULL\n)\n');\n \n $dataSource->exec('\nCREATE TABLE addSillyRecord (\nrecordId TEXT NOT NULL,\nname TEXT NOT NULL\n)\n');\n \n $dataSource->exec('\nCREATE TABLE uuidRecord (\nrecordId TEXT NOT NULL\n)\n');\n \n $dataSource->exec('INSERT INTO user (userId, name) VALUES (100001, \"firstUser\")');\n $dataSource->exec('INSERT INTO user (userId, name) VALUES (100002, \"secondUser\")');\n\n $dataSource->exec('INSERT INTO user (userId, name) VALUES (55566, \"existingManager\")');\n $dataSource->exec('INSERT INTO user (userId, name) VALUES (67387, \"existingUser\")');\n\n $dataSource->exec('INSERT INTO project (projectId, name, managerUserId) VALUES (12345, \"Existing Project\", 55566)');\n $dataSource->exec('INSERT INTO bug (bugId, title, body, projectId, reporterUserId, ownerUserId) VALUES (521152, \"Existing Bug\", \"This bug existed from the time the database was created\", 12345, 67387, 55566)');\n \n $dataSource->exec('INSERT INTO user (userId, name, favoriteProjectId) VALUES (99990, \"circleUser\", 35570)');\n \n $dataSource->exec('INSERT INTO project (projectId, name, managerUserId) VALUES (35569, \"Circle Test\", 99990)');\n $dataSource->exec('INSERT INTO project (projectId, name, managerUserId) VALUES (35570, \"Circle Test (leaf)\", 55566)');\n \n }", "public function testMakeAuthWithMysqlBackendConfig()\n {\n $config = $this->config;\n $factory = new Factory($config);\n $basicAuth = $factory->makeAuth();\n $this->assertInstanceOf(BasicAuth::class, $basicAuth);\n\n // test with missing db config\n $config = $this->config;\n unset($config['db']);\n $factory = new Factory($config);\n $this->expectException(BasicAuthException::class);\n $factory->makeAuth();\n }", "protected function setUpDatabaseConnectionMock() {}", "public function testConfigLoaded()\n {\n $this->assertClassHasAttribute('credentials', '\\interview\\Config_Database');\n }", "private function setUpAndReturnDatabaseStub() {}", "protected function setUp()\n\t{\n\t\tparent::setUp();\n\n\t\t$oContext = &Context::getInstance();\n\n\t\t$db_info = include dirname(__FILE__) . '/../config/db.config.php';\n\n\t\t$db = new stdClass();\n\t\t$db->master_db = $db_info;\n\t\t$db->slave_db = array($db_info);\n\t\t$oContext->setDbInfo($db);\n\n\t\tDB::getParser(TRUE);\n\t}", "public static function ini()\n {\n switch (Config::get('database.driver')) {\n case 'mysql':\n self::$driver = new Schema\\MysqlSchema();\n break;\n }\n }", "function pdo_connect_sqlite($db, array $driver_options = array())\n {\n return pdo_connect(\"sqlite:{$db}\", $driver_options);\n }", "public function setUp()\n {\n parent::setUp();\n\n $this->app['config']->set('database.default', 'sqlite');\n $this->app['config']->set('database.connections.sqlite.database', ':memory:');\n\n $this->migrate();\n }", "public function testValidateConfiguration()\n\t{\n\t\t$method = $this->setAccessibleMethod('validateConfig');\n\n\t\t$results = $method->invoke($this->dbConfiguration->newInstance([\n\t\t\t'default' => 'default',\n\t\t\t'connections' => [\n\t\t\t\t'default' => [\n\t\t\t\t\t'hostname' => 'localhost',\n\t\t\t\t\t'driver' => 'mysql',\n\t\t\t\t\t'database' => 'database'\n\t\t\t\t]\n\t\t\t]\n\t\t]));\n\n\t\t$this->assertSame(null, $results);\n\t}", "public function __construct()\n {\n putenv('DB_CONNECTION=sqlite');\n putenv('DB_DATABASE=:memory:');\n parent::setUp();\n }", "public function getDatabaseConfig()\n {\n \n $jdbc_dir = 'C:\\xampp\\htdocs\\JasperReport\\vendor\\cossou\\jasperphp\\src\\JasperStarter\\jdbc';\n return [\n 'driver' => 'generic',\n 'host' => env('DB_HOST'),\n 'port' => env('DB_PORT'),\n 'username' => env('DB_USERNAME'),\n 'password' => env('DB_PASSWORD'),\n 'database' => env('DB_DATABASE'),\n 'jdbc_driver' => 'com.microsoft.sqlserver.jdbc.SQLServerDriver',\n 'jdbc_url' => 'jdbc:sqlserver://192.168.1.250:1433;databaseName='.env('DB_DATABASE').'',\n 'jdbc_dir' => $jdbc_dir\n ];\n }", "function getDatabaseConfig()\n{\n $dsnDetail = [];\n $databaseConfig = require dirname(__FILE__) . \"/../config/database.php\";\n preg_match(\"/mysql:host=(.+);dbname=([^;.]+)/\", $databaseConfig[\"dsn\"], $dsnDetail);\n $dsnDetail[3] = $databaseConfig[\"username\"];\n $dsnDetail[4] = $databaseConfig[\"password\"];\n return $dsnDetail;\n}", "public function setUp() {\n ORM::set_db(new MockPDO('sqlite::memory:'));\n\n // Enable logging\n ORM::configure('logging', true);\n }", "public function testCreateSQLiteTable()\n {\n // table name\n $name = \"foobar\";\n\n // connect to sqlite db\n $db = new Biscuit\\Db\\SQLite();\n $db->setDbFile( \":memory:\" );\n $db->connect();\n\n // check connection\n $this->assertEquals( true, $db->connected(), \"SQLite connection failed\" );\n\n // setup table schema object for sqlite\n $table = $this->getTableSchema( $name, true );\n $db->dropTable( $name );\n\n // build and run queries\n foreach( $table->getQueries() as $query )\n {\n $result = $db->query( $query );\n $error = $db->getError();\n $this->assertEquals( true, $result instanceof PDOStatement, \"SQLite query failed: \". $error );\n }\n // run final checks\n $this->runFinalDbAsserts( $db, $name );\n }", "public static function load_driver(){\n\t\t\n\t\t$config = Config::read();\t\n\t\tif(isset($config->database->type)){\n\t\t\ttry {\t\t\t\t\n\t\t\t\tif($config->database->type){\t\t\t\t\t\n\t\t\t\t\t$config->database->type = escapeshellcmd($config->database->type);\n\t\t\t\t\trequire \"forms/db/adapters/\".$config->database->type.\".php\";\n\t\t\t\t\treturn true;\t\t\t\t\t\n\t\t\t\t}\n\t\t\t} \n\t\t\tcatch(kumbiaException $e){\n\t\t\t\t$e->show_message();\n\t\t\t}\n\t\t} else {\n\t\t\treturn true;\n\t\t}\n\t}", "private function initDatabase()\n {\n $defaults = [\n 'user' => 'root',\n 'password' => '',\n 'prefix' => '',\n 'options' => [\n \\PDO::ATTR_PERSISTENT => true,\n \\PDO::ATTR_ERRMODE => 2,\n \\PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8',\n \\PDO::MYSQL_ATTR_USE_BUFFERED_QUERY => 1,\n \\PDO::ATTR_EMULATE_PREPARES => false\n ]\n ];\n\n if (empty($this->settings['db'])) {\n error_log('No DB data set in Settings.php');\n Throw new FrameworkException('Error on DB access');\n }\n\n if (empty($this->settings['db']['default'])) {\n error_log('No DB \"default\" data set in Settings.php');\n Throw new FrameworkException('Error on DB access');\n }\n\n foreach ($this->settings['db'] as $name => &$settings) {\n\n $prefix = 'db.' . $name;\n\n // Check for databasename\n if (empty($settings['dsn'])) {\n Throw new \\PDOException(sprintf('No DSN specified for \"%s\" db connection. Please add correct DSN for this connection in Settings.php', $name));\n }\n\n // Check for DB defaults and map values\n foreach ($defaults as $key => $default) {\n\n // Append default options to settings\n if ($key == 'options') {\n\n if (empty($settings['options'])) {\n $settings['options'] = [];\n }\n\n foreach ($defaults['options'] as $option => $value) {\n\n if (array_key_exists($option, $settings['options'])) {\n continue;\n }\n\n $settings[$key][$option] = $value;\n }\n }\n\n if (empty($settings[$key])) {\n $settings[$key] = $default;\n }\n }\n\n foreach ($settings as $key => $value) {\n $this->di->mapValue($prefix . '.conn.' . $key, $value);\n }\n\n $this->di->mapService($prefix . '.conn', '\\Core\\Data\\Connectors\\Db\\Connection', [\n $prefix . '.conn.dsn',\n $prefix . '.conn.user',\n $prefix . '.conn.password',\n $prefix . '.conn.options'\n ]);\n $this->di->mapFactory($prefix, '\\Core\\Data\\Connectors\\Db\\Db', [\n $prefix . '.conn',\n $settings['prefix']\n ]);\n }\n }", "public function testLegacyDatabaseDriverInRootDriversDirectory() {\n $this->expectDeprecation('Support for database drivers located in the \"drivers/lib/Drupal/Driver/Database\" directory is deprecated in drupal:9.1.0 and is removed in drupal:10.0.0. Contributed and custom database drivers should be provided by modules and use the namespace \"Drupal\\MODULE_NAME\\Driver\\Database\\DRIVER_NAME\". See https://www.drupal.org/node/3123251');\n $namespace = 'Drupal\\\\Driver\\\\Database\\\\Stub';\n $mock_pdo = $this->createMock(StubPDO::class);\n $connection = new StubConnection($mock_pdo, ['namespace' => $namespace], ['\"', '\"']);\n $this->assertEquals($namespace, $connection->getConnectionOptions()['namespace']);\n }", "public function testOpenFileDB()\n {\n $dbLocation = __DIR__ . \"/../test.sq3\";\n $dbManager = new DbManager([\n 'driver' => [\n 'name' => 'sqlite',\n 'arguments' => [\n ['location' => SQLite::LOCATION_FILE, 'path' => $dbLocation]\n ]\n ]\n ]);\n\n $this->assertInstanceOf(DbManager::class, $dbManager);\n \n /** @var SQLite $driver */\n $driver = $dbManager->getDriver();\n $tableNames = $driver->getTableNames();\n\n // Asserting that the table names are correct. The assertEquals call has extended arguments to have $canonicalize set to true,\n // avoiding errors thrown because arrays aren't in the same order\n $this->assertCount(2, $tableNames);\n $this->assertEquals(['test_table', 'sqlite_sequence'], $tableNames, \"Table names aren't valid\", 0.0, 10, true);\n\n return $dbManager;\n }", "public function testParse()\n {\n $this->assertEquals('SELECT * FROM test WHERE status=\"ACTIVE\"', $this->conn->parse('SELECT * FROM test WHERE status=?', array('ACTIVE')));\n }", "protected static function main_database()\n\t{\n\t\t// these tests should use a seperate table\n\t\treturn 'phpunit';\n\t}", "public function __construct(array $config = array())\n {\n if (!isset($config['dbpath']) || !$config['dbpath']) {\n $config['dbpath'] = __DIR__ . '/../data/phpdoc.db';\n }\n\n try {\n $connectionParams = array(\n 'driver' => 'pdo_sqlite',\n 'path' => $config['dbpath']\n );\n $this->db = DriverManager::getConnection($connectionParams, new \\Doctrine\\DBAL\\Configuration());\n $this->db->connect();\n } catch (\\Exception $e) {\n $this->db = null;\n }\n }", "function setup_db($_db_path)\n{\n\t$create_table = !file_exists($_db_path);\n\t$db = new PDO('sqlite:'.$_db_path);\n\tif ($create_table)\n\t{\n\t\t$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n\t\t$db->exec('CREATE TABLE IF NOT EXISTS labels (\n\t\t\tid integer primary key,\n\t\t\tlabel varchar(128),\n\t\t\tdetails varchar(255)\n\t\t)');\n\t\t$db->exec(\"INSERT INTO labels (id,label,details) VALUES(1,'1.3','***version***')\");\n\t\t$db->exec('CREATE TABLE IF NOT EXISTS results (\n\t\t\tbranch integer,\n\t\t\tscript integer,\n\t\t\tsuite integer,\n\t\t\ttest integer,\n\t\t\tsuccess integer DEFAULT NULL,\n\t\t\tfirst_failed integer DEFAULT NULL,\n\t\t\tfailed integer DEFAULT NULL,\n\t\t\tdetails text,\n\t\t\tupdated timestamp DEFAULT CURRENT_TIMESTAMP,\n\t\t\ttime real DEFAULT NULL,\n\t\t\tprotocol text,\n\t\t\tnotes text,\n\t\t\tPRIMARY KEY(branch,script,suite,test)\n\t\t)');\n\t}\n\t// update schema, if necessary\n\tswitch($db->query('SELECT label FROM labels WHERE id=1')->fetchColumn())\n\t{\n\t\tcase '1.0':\n\t\t\t$db->exec('ALTER TABLE results ADD COLUMN time real DEFAULT NULL');\n\t\t\t// fall through\n\t\tcase '1.1':\n\t\t\t$db->exec('ALTER TABLE results ADD COLUMN protocol text');\n\t\t\t// fall through\n\t\tcase '1.2':\n\t\t\t$db->exec('ALTER TABLE results ADD COLUMN notes text');\n\t\t\t// update version\n\t\t\t$db->exec(\"UPDATE labels SET label='1.3' WHERE id=1\");\n\t}\n\t//error_log('schema_version='.$db->query('SELECT label FROM labels WHERE id=1')->fetchColumn());\n\n\treturn $db;\n}", "private function __construct()\n {\n $driverName = $this->getConfigValue('driver') ? $this->getConfigValue('driver') : 'mysqli';\n switch (strtolower($driverName)) {\n case 'mysqli':\n $this->driver = new Driver\\Mysqli($this->getConfigValue());\n break;\n case 'mssql':\n $this->driver = new Driver\\Mssql($this->getConfigValue());\n break;\n }\n $this->utf = $this->driver->hasUTF();\n if ($this->utf) {\n $this->driver->setUTF();\n }\n }", "public static function load_db_config() {\n\t\tif (Config::instance()->db_config)\n\t\t\treturn Config::instance()->db_config;\n\n\t\t$db_config = parse_ini_file(HALFMOON_ROOT . \"/config/db.ini\", true);\n\n\t\t/* set some reasonable defaults */\n\t\t$ar_config = array();\n\t\tforeach ($db_config as $henv => $db) {\n\t\t\tif ($db[\"adapter\"] == \"sqlite\")\n\t\t\t\t$ar_config[$henv] = $db;\n\t\t\telse\n\t\t\t\t$ar_config[$henv] = array_merge(array(\n\t\t\t\t\t\"adapter\" => \"mysql\",\n\t\t\t\t\t\"username\" => \"username\",\n\t\t\t\t\t\"password\" => \"password\",\n\t\t\t\t\t\"hostname\" => \"localhost\",\n\t\t\t\t\t\"database\" => \"database\",\n\t\t\t\t\t\"socket\" => \"\",\n\t\t\t\t\t\"port\" => 3306,\n\t\t\t\t), $db);\n\t\t}\n\n\t\treturn Config::instance()->db_config = $ar_config;\n\t}", "function __construct( array $db_settings=['dsn'=>'sqlite:mydb.sq3','u'=>null,'p'=>null] )\n {\n $this->pdo=new PDO(\n $db_settings['dsn'],\n $db_settings['u'],\n $db_settings['p']\n );\n //DB set up\n $this->pdo->setAttribute( PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING );\n }", "public function setUp()\n {\n TestConfiguration::setupDatabase();\n }", "public function testGetByKey( )\n\t{\n\t\t$instance = $this->dbConfiguration->newInstance([\n\t\t\t'default' => 'default',\n\t\t\t'connections' => [\n\t\t\t\t'default' => [\n\t\t\t\t\t'hostname' => 'localhost',\n\t\t\t\t\t'driver' => 'mysql',\n\t\t\t\t\t'database' => 'database'\n\t\t\t\t]\n\t\t\t]\n\t\t]);\n\n\t\t$this->assertEquals(null, $instance->get('connections.mysql'));\n\n\t\t$this->assertEquals([\n\t\t\t'hostname' => 'localhost',\n\t\t\t'driver' => 'mysql',\n\t\t\t'database' => 'database'\n\t\t], $instance->get('connections.default'));\n\t}", "protected function setUp () {\n $this->pdoConnection = new \\PDO('mysql:host='.$this->config['server'].';',\n $this->config['user'],\n $this->config['password']);\n $this->pdoConnection->exec('DROP SCHEMA IF EXISTS '.$this->config['name']);\n $this->pdoConnection->exec('CREATE SCHEMA '.$this->config['name']);\n $this->pdoConnection->exec('USE '.$this->config['name']);\n $this->pdoConnection->exec(file_get_contents(__DIR__.'\\ConnectionTestSchema.sql'));\n\n $this->mysqli = new mysqli($this->config['server'],\n $this->config['user'],\n $this->config['password'],\n $this->config['name']);\n\n $this->mysqliConnection = new MysqliConnection($this->mysqli);\n $this->run = true;\n }", "public static function init() {\n $db_file_path = static::get_db_file_path();\n $pdo = new PDO(\"sqlite:\" . $db_file_path);\n $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING);\n $pdo->setAttribute(PDO::ATTR_DEFAULT_FETCH_MODE, PDO::FETCH_ASSOC);\n static::$pdo = $pdo;\n }", "function setup_db_config($configuration){\n // or the user is admin user\n if(_is_db_configured($configuration)){\n _is_admin_or_return($configuration);\n }\n\n // get and validate user input\n $data = json_decode(file_get_contents('php://input'));\n \n $host = parse_url($data->db_server, PHP_URL_HOST);\n if(!isset($host)){\n return Status::errorStatus('no proper hostname specified');\n }\n $port = parse_url($data->db_server, PHP_URL_PORT);\n if(!isset($port)){\n return Status::errorStatus('no port specified');\n }\n if(!preg_match('/^[a-zA-Z0-9-_\\.\\:\\]\\[]+:[0-9]+$/', $data->db_server)){\n return Status::errorStatus('only [ip|hostname]:[port] format supported for database host');\n }\n if(!isset($data->db_name) || !preg_match('/^[a-zA-Z0-9-_]+$/', $data->db_name)){\n return Status::errorStatus('invalid database name');\n }\n if(!isset($data->db_user) || !preg_match('/^[a-zA-Z0-9-_]+$/', $data->db_user)){\n return Status::errorStatus('invalid database user');\n }\n if(!isset($data->db_password) || preg_match('/\\s+/', $data->db_password)){\n return Status::errorStatus('invalid database password (containing spaces)');\n }\n\n // verify that connection works\n $new_config = new Configuration();\n $new_config->db_server = $data->db_server;\n $new_config->db_name = $data->db_name;\n $new_config->db_user = $data->db_user;\n $new_config->db_password = $data->db_password;\n $db = new DBAccess($new_config);\n if(!$db->connect()){\n return Status::errorStatus('DB access not working with the provided settings. Please check for typos, make sure that the database is reachable and that your username and password are correct.');\n }\n\n // check whether tables already exist\n $query = 'SHOW TABLES LIKE \"configuration\"';\n $res = $db->fetch_data_hash($query, 0);\n if(!$res){\n // if the table does not exist, we setup the database\n // setup a new database\n if(!file_exists(\"../config/db/schema.sql\") || !$db->apply_sql_file(\"../config/db/schema.sql\")){\n return Status::errorStatus(\"DB scheme could not be applied to database, please check server error logs\");\n }\n }\n\n // write configuration file (only after schema is applied)// build the configuration for the configuration file\n $configuration->config_file_variables['db_server'] = $data->db_server;\n $configuration->config_file_variables['db_name'] = $data->db_name;\n $configuration->config_file_variables['db_user'] = $data->db_user;\n $configuration->config_file_variables['db_password'] = $data->db_password;\n if(_write_config_file($configuration->config_file_variables)){\n return Status::successStatus(\"configuration applied and database setup\");\n }\n return Status::errorStatus(\"db could not be configured\");\n }", "protected function setUp(): void\n {\n parent::setUp();\n\n $this->table = config('database-config.table');\n }", "public function testConfigOnDefinedInstance()\n {\n $users = TableRegistry::get('Users');\n TableRegistry::config('Users', ['table' => 'my_users']);\n }", "public function setUp(): void\n {\n if ( isset($this->db) )\n {\n return;\n }\n\n (new DBConnect\\Load\\INI(self::DB_CREDENTIALS))->run();\n $this->db = DBConnect\\Connect\\Bank::get();\n\n $this->table = new DBTable\\PostgreSQL(self::TABLE_NAME);\n $this->table->runFieldLookup($this->db);\n }", "public function connect($config = \"database\") {\n $fileName = \"settings/\".$config.\".ini\";\n if (file_exists($fileName)) {\n $settings = parse_ini_file($fileName);\n try {\n $this->db = new PDO('mysql:host='.$settings['host'].';dbname='.$settings['dbname'].';charset=utf8', $settings['username'], $settings['password']);\n return true;\n } catch(PDOException $e) {\n throw new PDOException($e);\n }\n } else {\n throw new Exception(\"Failed to load database config file: \". $config);\n }\n }", "public function testDirWith_DsnIsDriverAndPathOptExt()\n {\n $config = Config_Dir::with(\"dir:{$this->dir}\", array('ext'=>'mock'));\n $this->checkWithResult($config);\n }", "public static function setUpBeforeClass() {\n\t\t$pdo = new \\PDO(PGSQL_DSN, PGSQL_USER, PGSQL_PASSWORD);\n $pdo->exec('SET search_path TO ' . PGSQL_SCHEMA);\n\t\t$r = $pdo->exec('drop table ' . PGSQL_SCHEMA . '.user');\n\t\t$create = 'CREATE TABLE ' .PGSQL_SCHEMA . '.';\n $create2 = <<<SQL\nuser (\n id int,\n name varchar(45) NOT NULL,\n PRIMARY KEY (id)\n );\nSQL;\n $create = $create . $create2;\n\t\t$pdo->exec($create);\n\n\t\t$insert = \"insert into \" . PGSQL_SCHEMA . \".user values(1, 'sato')\";\n $pdo->exec($insert);\n $insert = \"insert into \" . PGSQL_SCHEMA . \".user values(2, 'suzuki')\";\n $pdo->exec($insert);\n $insert = \"insert into \" . PGSQL_SCHEMA . \".user values(3, 'takahashi')\";\n $pdo->exec($insert);\n $insert = \"insert into \" . PGSQL_SCHEMA . \".user values(4, 'tanaka')\";\n $pdo->exec($insert);\n $insert = \"insert into \" . PGSQL_SCHEMA . \".user values(5, 'ito')\";\n $pdo->exec($insert);\n\n\t}", "private static function parseDatabaseUrl(array $params)\n {\n if (!isset($params['url'])) {\n return $params;\n }\n \n // (pdo_)?sqlite3?:///... => (pdo_)?sqlite3?://localhost/... or else the URL will be invalid\n $url = preg_replace('#^((?:pdo_)?sqlite3?):///#', '$1://localhost/', $params['url']);\n \n $url = parse_url($url);\n \n if ($url === false) {\n throw new DBALException('Malformed parameter \"url\".');\n }\n \n if (isset($url['scheme'])) {\n $params['driver'] = str_replace('-', '_', $url['scheme']); // URL schemes must not contain underscores, but dashes are ok\n if (isset(self::$driverSchemeAliases[$params['driver']])) {\n $params['driver'] = self::$driverSchemeAliases[$params['driver']]; // use alias like \"postgres\", else we just let checkParams decide later if the driver exists (for literal \"pdo-pgsql\" etc)\n }\n }\n \n if (isset($url['host'])) {\n $params['host'] = $url['host'];\n }\n if (isset($url['port'])) {\n $params['port'] = $url['port'];\n }\n if (isset($url['user'])) {\n $params['user'] = $url['user'];\n }\n if (isset($url['pass'])) {\n $params['password'] = $url['pass'];\n }\n \n if (isset($url['path'])) {\n if (!isset($url['scheme']) || (strpos($url['scheme'], 'sqlite') !== false && $url['path'] == ':memory:')) {\n $params['dbname'] = $url['path']; // if the URL was just \"sqlite::memory:\", which parses to scheme and path only\n } else {\n $params['dbname'] = substr($url['path'], 1); // strip the leading slash from the URL\n }\n }\n \n if (isset($url['query'])) {\n $query = array();\n parse_str($url['query'], $query); // simply ingest query as extra params, e.g. charset or sslmode\n $params = array_merge($params, $query); // parse_str wipes existing array elements\n }\n \n return $params;\n }", "public function testThatWeCanConnectToDatabase(){\n $this->assertNotEmpty($this->db->connect());\n }", "protected function setUpConfigurationData() {}", "public function __construct()\n {\n // all entries are assumed to exist and be correct\n $config = parse_ini_file('config.ini');\n\n // Create a new conncetion to the database\n $this->db = new PDO(\"mysql:host={$config['db_host']};\" .\n \"dbname={$config['db_name']};charset=utf8mb4\",\n $config['db_user'], $config['db_pass']);\n\n // Throw exceptions on SQL error\n $this->db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n }", "protected function fixture() {\n return new \\rdbms\\pgsql\\PostgreSQLConnection(new \\rdbms\\DSN('pgsql://localhost/'));\n }", "public static function setUpBeforeClass() {\n $dbh = new SQLiteDatabase(__DIR__ . '/../../database/chat_server.db');\n $dbh->query('INSERT INTO Users (username) VALUES(:username)', ['username' => 'Bob']);\n $dbh->query('INSERT INTO Users (username) VALUES(:username)', ['username' => 'Carl']);\n $dbh = null;\n }", "public function __construct(array $config = array())\n\t{\n\t\tif ( is_null(static::$reader) )\n\t\t{\n\t\t\tif ( !file_exists($config['maxmind_db']) )\n\t\t\t{\n\t\t\t\tthrow new UnexpectedValueException(\"Could not find the MaxMind database file at the specified location! Check your paths and try again ({$config['maxmind_db']}).\");\n\t\t\t}\n\n\t\t\tstatic::$reader = new Reader($config['maxmind_db']);\n\t\t}\n\n\t\t$this->databaseType = static::$reader->metadata()->databaseType;\n\n\t\tif ( !in_array($this->databaseType, $this->databaseSupport) )\n\t\t{\n\t\t\tthrow new UnexpectedValueException(\"Unexpected database type '{$this->databaseType}'!\");\n\t\t}\n\t}", "public function testEngine()\n {\n $statement = (new CreateTable($this->mockConnection));\n $return = $statement->engine('InnoDB');\n $array = $statement->toArray();\n\n $this->assertInstanceOf(CreateTable::class, $return);\n $this->assertEquals([\n 'engine' => 'InnoDB',\n ], $array);\n }", "protected static function setupDb()\n\t{\n\t\tif (is_object(self::$db)) {\n\t\t\treturn self::$db;\n\t\t}\n\n\t\t$config = Config::getInstance();\n\t\t$driver = $config->getDatabaseDriver();\n\t\t$host = $config->getDatabaseHostname();\n\t\t$user = $config->getDatabaseUsername();\n\t\t$pass = $config->getDatabasePassword();\n\t\t$dbname = $config->getDatabaseName();\n\t\t$file = $config->getDatabaseFile();\n\n\t\ttry {\n\t\t\tswitch ($driver) {\n\t\t\t\tcase 'sqlite':\n\t\t\t\t\tself::$db = new PDO('sqlite:'.$file);\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\tcase 'mysql':\n\t\t\t\t\tself::$db = new PDO($driver.':dbname='.$dbname.';host='.$host,\n\t\t\t\t\t $user, $pass,array(PDO::ATTR_PERSISTENT => true));\n\t\t\t}\n\t\t\tself::$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n\t\t} catch (PDOException $e) {\n\t\t\tthrow new Exception(\"Kunde inte etablera anslutning till databasen. (\".\n\t\t\t $e->getMessage().')');\n\t\t}\n\t}", "static public function setUpBeforeClass() : void\n\t{\n\t\t$databasePDO = new __\\_Private\\DatabasePDO('sqlite', ':memory:');\n\t\t$databasePDO->exec('\n\t\t\tCREATE TABLE exampleTable (\n\t\t\t\tprimaryKey INTEGER PRIMARY KEY AUTOINCREMENT,\n\t\t\t\tcolumn1 INTEGER,\n\t\t\t\tcolumn2 TEXT\n\t\t\t);\n\t\t\tCREATE TABLE exampleTableExtra (\n\t\t\t\tprimaryKey INTEGER PRIMARY KEY AUTOINCREMENT,\n\t\t\t\tdataJSON TEXT,\n\t\t\t\tupdatedAt INTEGER,\n\t\t\t\tinsertedAt INTEGER\n\t\t\t);\n\t\t\tINSERT INTO exampleTable(column1, column2) VALUES (100, \"hundred\"), (1000, \"thousand\");\n\t\t');\n\t\t__\\WT()->overwrite('database', $databasePDO); // DatabaseObject needs WT()->database.\n\n\t\t// Example class extending abstract DatabaseObject class.\n\t\tself::$_exampleClass = get_class(new class extends __\\DatabaseObject\n\t\t{\n\t\t\tstatic protected $_tableName = 'exampleTable';\n\t\t\tstatic protected $_tablePrimaryKey = 'primaryKey';\n\t\t\tstatic protected $_tableColumns = [\n\t\t\t\t'column1',\n\t\t\t\t'column2',\n\t\t\t];\n\t\t});\n\n\t\t// Second example class with extra features like JSON data encoding.\n\t\tself::$_exampleClassExtra = get_class(new class extends __\\DatabaseObject\n\t\t{\n\t\t\tstatic protected $_tableName = 'exampleTableExtra';\n\t\t\tstatic protected $_tablePrimaryKey = 'primaryKey';\n\t\t\tstatic protected $_tableColumns = [\n\t\t\t\t'dataJSON',\n\t\t\t\t'updatedAt',\n\t\t\t\t'insertedAt',\n\t\t\t];\n\t\t\tstatic protected $_tableColumnsJSON = [\n\t\t\t\t'dataJSON',\n\t\t\t];\n\t\t\tstatic protected $_tableColumnsTimeAtInsert = [\n\t\t\t\t'insertedAt',\n\t\t\t];\n\t\t\tstatic protected $_tableColumnsTimeAtUpdate = [\n\t\t\t\t'updatedAt',\n\t\t\t];\n\t\t});\n\t}", "public function connect() {\n $params = parse_ini_file('Resources/database.ini');\n if ($params === false) {\n throw new \\Exception(\"Error reading database configuration file\");\n }\n // connect to the postgresql database\n $conStr = sprintf(\"pgsql:host=%s;port=%d;dbname=%s;user=%s;password=%s\", \n $params['host'], \n $params['port'], \n $params['database'], \n $params['user'], \n $params['password']);\n\n\t\ttry {\n\t\t\t$pdo = new \\PDO($conStr);\n\t\t\t$pdo->setAttribute(\\PDO::ATTR_ERRMODE, \\PDO::ERRMODE_EXCEPTION);\n\t\t} catch (\\PDOException $e) {\n\t\t\techo \"Error Found\" . $e->getMessage();\n\t\t}\n\n return $pdo;\n }", "public function test_create_table()\n\t{\n\t\t$handler = DB::handler( 'phpunit_sqlite' );\n\t\t\n\t\t$handler->run( \"DROP TABLE IF EXISTS people\" );\n\t\t\n\t\t$handler->run( \n\t\t\"CREATE TABLE people ( \n\t\t\tid INTEGER PRIMARY KEY AUTOINCREMENT, \n\t\t\tname VARCHAR, \n\t\t\tage INTEGER\n\t\t);\");\n\t}", "public function createFromConfig()\n { \n // Begin transation\n $this->pdo->beginTransaction();\n\n // Create tables\n foreach ($this->schema['create'] as $name => $schema) {\n $table = $this->tables[$name];\n $this->pdo->exec($this->getDropTable($table));\n $sql = $this->getCreateTable($table, $schema);\n $this->pdo->exec($sql);\n }\n\n // Commit changes\n $this->pdo->commit();\n }", "public function __construct()\n\t\t\t{\n\t\t\t\t// Set up the database source name (DSN)\n\t\t\t\t$dsn = 'sqlite:./db/test1.db';\n\t\t\t\t\n\t\t\t\t// Then create a connection to a database with the PDO() function\n\t\t\t\ttry {\t\n\t\t\t\t\t// Change connection string for different databases, currently using SQLite\n\t\t\t\t\t$this->dbhandle = new PDO($dsn, 'user', 'password', array(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tPDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tPDO::ATTR_EMULATE_PREPARES => false,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t));\n\t\t\t\t\t// $this->dbhandle->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n\t\t\t\t\t// echo 'Database connection created</br></br>';\n\t\t\t\t}\n\t\t\t\tcatch (PDOEXception $e) {\n\t\t\t\t\techo \"I'm afraid I can't connect to the database!\";\n\t\t\t\t\t// Generate an error message if the connection fails\n\t\t\t\t\tprint new Exception($e->getMessage());\n\t\t\t\t}\n\t\t\t}", "public function setUp()\n {\n parent::setUp();\n\n $this->app['config']->set('database.migrations','migrations');\n $this->app['config']->set('database.default','sqlite');\n $this->app['config']->set('database.connections.sqlite.database', ':memory:');\n\n $this->app['config']->set('iam.jwt_alg', 'HS256');\n $this->app['config']->set('iam.jwt_secret', 'hash');\n $this->app['config']->set('iam.jwt_expiration_minutes_time', 5);\n $this->app['config']->set('iam.jwt_expires', true);\n\n $this->migrate();\n }", "function __construct($database = \"productdisplay\", $server = \"myDB\"){\r\n if (!$settings = parse_ini_file(CONFIGFILE, TRUE)) throw new exception('Unable to open ' . CONFIGFILE . '.');\r\n $dsn = $settings[$server][\"driver\"].':host='.$settings[$server][\"host\"].';dbname='.$database;\r\n parent::__construct($dsn,$settings[$server][\"user\"],$settings[$server][\"password\"]);\r\n }", "public function setUp() {\n\t\t$options = [\n\t\t\t'db' => [\n\t\t\t\t'adapter' => 'Connection',\n\t\t\t\t'connection' => $this->_connection,\n\t\t\t\t'fixtures' => $this->_fixtures\n\t\t\t]\n\t\t];\n\n\t\tFixtures::config($options);\n\t\tFixtures::save('db');\n\t}", "function getDb() {\n\n if (!$this->driver) {\n throw new \\Exception('You must set the $driver public property');\n }\n\n if (array_key_exists($this->driver, DbCache::$cache)) {\n $pdo = DbCache::$cache[$this->driver];\n if ($pdo === null) {\n $this->markTestSkipped($this->driver . ' was not enabled, not correctly configured or of the wrong version');\n }\n return $pdo;\n }\n\n try {\n\n switch ($this->driver) {\n\n case 'mysql' :\n $pdo = new PDO(SABRE_MYSQLDSN, SABRE_MYSQLUSER, SABRE_MYSQLPASS);\n break;\n case 'sqlite' :\n $pdo = new \\PDO('sqlite:' . SABRE_TEMPDIR . '/testdb');\n break;\n case 'pgsql' :\n $pdo = new \\PDO(SABRE_PGSQLDSN);\n $version = $pdo->query('SELECT VERSION()')->fetchColumn();\n preg_match('|([0-9\\.]){5,}|', $version, $matches);\n $version = $matches[0];\n if (version_compare($version, '9.5.0', '<')) {\n DbCache::$cache[$this->driver] = null;\n $this->markTestSkipped('We require at least Postgres 9.5. This server is running ' . $version);\n }\n break;\n\n\n\n }\n $pdo->setAttribute(\\PDO::ATTR_ERRMODE, \\PDO::ERRMODE_EXCEPTION);\n\n } catch (PDOException $e) {\n\n $this->markTestSkipped($this->driver . ' was not enabled or not correctly configured. Error message: ' . $e->getMessage());\n\n }\n\n DbCache::$cache[$this->driver] = $pdo;\n return $pdo;\n\n }", "protected function setUpTestDatabase()\n {\n $this->bootstrap->initializeTypo3DbGlobal();\n\n /** @var DatabaseConnection $database */\n $database = $GLOBALS['TYPO3_DB'];\n if (!$database->sql_pconnect()) {\n throw new Exception(\n 'TYPO3 Fatal Error: The current username, password or host was not accepted when the'\n . ' connection to the database was attempted to be established!',\n 1377620117\n );\n }\n\n $databaseName = $GLOBALS['TYPO3_CONF_VARS']['DB']['database'];\n // Drop database in case a previous test had a fatal and did not clean up properly\n $database->admin_query('DROP DATABASE IF EXISTS `' . $databaseName . '`');\n $createDatabaseResult = $database->admin_query('CREATE DATABASE `' . $databaseName . '`');\n if (!$createDatabaseResult) {\n $user = $GLOBALS['TYPO3_CONF_VARS']['DB']['username'];\n $host = $GLOBALS['TYPO3_CONF_VARS']['DB']['host'];\n throw new Exception(\n 'Unable to create database with name ' . $databaseName . '. This is probably a permission problem.'\n . ' For this instance this could be fixed executing'\n . ' \"GRANT ALL ON `' . substr($databaseName, 0, -10) . '_ft%`.* TO `' . $user . '`@`' . $host . '`;\"',\n 1376579070\n );\n }\n $database->setDatabaseName($databaseName);\n // On windows, this still works, but throws a warning, which we need to discard.\n @$database->sql_select_db();\n }", "function prepConfig() {\n\n global $db;\n global $lang;\n\n if($report = $db->query(\"CREATE DATABASE IF NOT EXISTS \".$lang[\"config_db_name\"].\"\")) {\n\n // Generate safety table\n if($report = $db->query(\"CREATE TABLE IF NOT EXISTS `\".$lang[\"config_db_name\"].\"`.`\".$lang[\"config_table_name\"].\"` ( `id` INT(6) NOT NULL AUTO_INCREMENT, `key` VARCHAR(100) NOT NULL, UNIQUE (`key`), `val` VARCHAR(100) NOT NULL , PRIMARY KEY (`id`)) ENGINE = InnoDB;\")) {\n\n return \"Ready\";\n\n } else {\n\n return \"Failed to create table. Error: \".$db->error;\n\n }\n\n } else {\n\n return \"Failed to create database. Error: \".$db->error;\n\n }\n\n }", "public function supports_traditional_php_config_files()\n {\n $container = new ContainerBuilder;\n $loader = new PhpConfigFileLoader($container, new FileLocator);\n\n $loader->load(__DIR__ . '/Fixtures/traditional-php-config.php');\n\n self::assertEquals('bar', $container->getParameter('foo'));\n }", "public function testDirWith_DsnIsDriverAndPathOptExtArgTr()\n {\n $config = Config_Dir::with(\"dir:{$this->dir}\", array('ext'=>'yaml', 'transformer'=>'from-mock'));\n $this->checkWithTrResult($config);\n }", "public function testGetConfiguration() {\n\n $obj = new WBWJQueryDataTablesExtension();\n\n $this->assertInstanceOf(Configuration::class, $obj->getConfiguration([], $this->containerBuilder));\n }", "public function testConstructWithAlternateDataSource() {\n\t\t$TestModel = ClassRegistry::init(array(\n\t\t\t'class' => 'DoesntMatter', 'ds' => 'test', 'table' => false\n\t\t));\n\t\t$this->assertEquals('test', $TestModel->useDbConfig);\n\n\t\t//deprecated but test it anyway\n\t\t$NewVoid = new TheVoid(null, false, 'other');\n\t\t$this->assertEquals('other', $NewVoid->useDbConfig);\n\t}", "protected function _setup($driver, $path='', $host, $db, $user, $pass) {\n if ($driver == 'sqlite') {\n if ($path == '') {\n show_error('You have configured Redbean to use sqlite, but a path has not been set to the DB.');\n }\n $connectString = $driver.':'.$path.$db;\n } else {\n $connectString = $driver.':host='.$host.';dbname='.$db;\n }\n R::setup($connectString, $user, $pass);\n }", "function db_driver_connect()\n{\n global $_db;\n\n $_db['resource'][$_db['target']]['dbh'] = pg_connect('host=' . $_db['resource'][$_db['target']]['config']['host'] . ($_db['resource'][$_db['target']]['config']['port'] ? ' port=' . $_db['resource'][$_db['target']]['config']['port'] : '') . ' dbname=' . $_db['resource'][$_db['target']]['config']['name'] . ' user=' . $_db['resource'][$_db['target']]['config']['username'] . ' password=' . $_db['resource'][$_db['target']]['config']['password'], true);\n if (!$_db['resource'][$_db['target']]['dbh']) {\n if (LOGGING_MESSAGE) {\n logging('message', 'db: Connect error');\n }\n\n error('db: Connect error');\n }\n\n return;\n}", "public function testWith_DsnIsPathOptExt()\n {\n $config = Config::with($this->dir, array('ext'=>'mock'));\n $this->checkWithResult($config);\n }", "public function setUp()\n {\n parent::setUp();\n\n $this->app['config']->set('database.default', 'sqlite');\n $this->app['config']->set('database.connections.sqlite.database', ':memory:');\n $this->app['config']->set('jsonapi', [EmployeesTransformer::class, OrdersTransformer::class]);\n $this->app['config']->set('app.url', 'http://localhost/');\n $this->app['config']->set('app.debug', true);\n $this->app['config']->set('app.key', \\env('APP_KEY', '1234567890123456'));\n $this->app['config']->set('app.cipher', 'AES-128-CBC');\n\n $this->app->boot();\n\n $this->migrate();\n }", "private function sqlite()\n\t{\n\t\tif (isset($this->_conf['dbname']) AND $this->_conf['dbname'] != '')\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\t$this->_con = new PDO('sqlite:'.$this->_conf['dbname']);\n\t\t\t\t\n\t\t\t\treturn TRUE;\n\t\t\t}\n\t\t\tcatch(PDOException $ex)\n\t\t\t{\n\t\t\t\tif (isset($this->_conf['debug']) AND $this->_conf['debug'] == TRUE)\n\t\t\t\t{\n\t\t\t\t\terror('PDOCON->SQLite', $ex->getMessage(), 500, TRUE);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\twriteLog('Error', $ex->getMessage());\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\twriteLog('Error', \"PDOCON->SQLite: Invalid 'database name'\");\n\t\t\t\n\t\t\treturn FALSE;\n\t\t}\n\t}", "public function testConstructionSettings(): void\n {\n $this->getTableLocator()->clear();\n new DatabaseSession();\n\n $session = $this->getTableLocator()->get('Sessions');\n $this->assertInstanceOf('Cake\\ORM\\Table', $session);\n $this->assertSame('Sessions', $session->getAlias());\n $this->assertEquals(ConnectionManager::get('test'), $session->getConnection());\n $this->assertSame('sessions', $session->getTable());\n }", "public function setUp()\n\t{\n\t\t$this->connection = Db::connection(array(\n\t\t\t'driver' => 'mysql',\n\t\t\t'username' => 'root',\n\t\t\t'password' => isset($_SERVER['DB']) ? '' : 'root',\n\t\t\t'database' => 'test_database',\n\t\t));\n\t}", "private static function test_db( $params_array ) {\n $table_name = ( isset( $params_array[ 'prefix' ] ) ? $params_array[ 'prefix' ] : '' ) . self::DUMMY_TABLE_NAME;\n $dummy_data = str_repeat ( 'Z' , 256 );\n $str_data = sprintf( '(\"%s\")', $dummy_data );\n for ( $i = 1; $i < 63; $i++) {\n $str_data .= sprintf( ',(\"%s\")', $dummy_data );\n }\n call_user_func(array( $params_array[ 'query_object' ], $params_array[ 'query_method' ] ), \"CREATE TABLE if not exists $table_name (dummydata text NOT NULL DEFAULT '')\" );\n call_user_func(array( $params_array[ 'query_object' ], $params_array[ 'query_method' ] ), \"insert into $table_name (dummydata) values \" . $str_data . \";\" );\n call_user_func(array( $params_array[ 'query_object' ], $params_array[ 'query_method' ] ), \"select * from $table_name;\" );\n call_user_func(array( $params_array[ 'query_object' ], $params_array[ 'query_method' ] ), \"update $table_name set dummydata = '\" . __CLASS__ . \"';\" );\n call_user_func(array( $params_array[ 'query_object' ], $params_array[ 'query_method' ] ), \"delete from $table_name;\" );\n call_user_func(array( $params_array[ 'query_object' ], $params_array[ 'query_method' ] ), \"DROP TABLE if exists $table_name;\" );\n }", "function pdoe_mysql_test_db_credentials() {\n\treturn array( \n\t\t'user' => 'pdoe', \n\t\t'password' => 'moomoo', \n\t\t'host' => 'localhost', \n\t\t'database' => 'pdoe_test'\n\t);\n}", "public function testConfigFunctions()\r\n\t{\r\n\t\t// Create new schema\r\n\t\t$index = new Index();\r\n\r\n\t\t// Check return types\r\n\t\t$this->assertTrue(is_array($index->attributeLabels()));\r\n\t\t$this->assertTrue(is_array($index->rules()));\r\n\t\t$this->assertTrue(is_array($index->relations()));\r\n\t\t$this->assertTrue(is_array(Index::getIndexTypes()));\r\n\t}", "public function testConfigPlugin()\n {\n Plugin::load('TestPlugin');\n\n $data = [\n 'connection' => 'testing',\n 'entityClass' => 'TestPlugin\\Model\\Entity\\Comment',\n ];\n\n $result = TableRegistry::config('TestPlugin.TestPluginComments', $data);\n $this->assertEquals($data, $result, 'Returns config data.');\n\n $result = TableRegistry::config();\n $expected = ['TestPluginComments' => $data];\n $this->assertEquals($expected, $result);\n }", "public function testWith_DriverIsPath()\n {\n $config = Config::with($this->dir);\n \n $this->assertType('Q\\Config_Dir', $config);\n\n $refl_path = new \\ReflectionProperty($config, '_path');\n $refl_path->setAccessible(true);\n $this->assertEquals($this->dir, (string)$refl_path->getValue($config));\n\n $refl_tr = new \\ReflectionProperty($config, '_transformer');\n $refl_tr->setAccessible(true);\n $this->assertEquals(null, $refl_tr->getValue($config)); \n \n $refl_ext = new \\ReflectionProperty($config, '_ext');\n $refl_ext->setAccessible(true);\n $this->assertEquals(null, (string)$refl_ext->getValue($config));\n }", "public function testGetDBCon()\n {\n // TODO use a different check, if mariadb or mysql is used\n $this->assertTrue(false !== $this->fixture->getDBCon());\n }", "function connect($dsn, $user, $password, $schema = \"public\")\n{\n try {\n $pdo = new Pdo($dsn, $user, $password);\n if (isset($schema)) {\n $pdo->exec(\"set search_path=\" . $schema);\n }\n return $pdo;\n } catch (PDOException $e) {\n throw new ObjetBDDException(($e->getMessage()));\n }\n}", "protected function loadExtLocalconfDatabaseAndExtTables() {}", "public function testExceptExceptionWithWrongDatabaseInfo()\n {\n $this->expectException(\"Exception\");\n $randomData = (object) array(\n \"user\" => $this->generateRandomString(5),\n \"password\" => $this->generateRandomString(10),\n \"host\" => $this->generateRandomString(120),\n \"database\" => $this->generateRandomString(15),\n \"port\" => random_int(1000, 16200)\n );\n\n /**\n * Creating annomous class,\n * I think I found a caseuse for interfaces now.\n */\n $settings = new class ($randomData) {\n private $data;\n public function __construct($data)\n {\n $this->data = $data;\n }\n public function getDatabaseConfig()\n {\n return $this->data;\n }\n };\n\n $database = new \\Database($settings);\n }", "protected function fixture_setup() {\r\n $this->service = SQLConnectionService::get_instance($this->configuration);\r\n test_data_setup($this->service);\r\n }" ]
[ "0.6428103", "0.62824094", "0.61614174", "0.599849", "0.5904186", "0.58873296", "0.5811624", "0.5788685", "0.576666", "0.57622296", "0.5748987", "0.57202035", "0.57198095", "0.5709778", "0.56632525", "0.56420743", "0.56293744", "0.56224704", "0.5600333", "0.55806273", "0.5572224", "0.5560393", "0.5531703", "0.55124277", "0.5510863", "0.55020314", "0.55005646", "0.5473727", "0.5431454", "0.54131234", "0.5405911", "0.53995085", "0.53888553", "0.5378465", "0.53593403", "0.5355143", "0.5350746", "0.5339748", "0.5339247", "0.5320307", "0.53053945", "0.5280475", "0.5275849", "0.525843", "0.5258354", "0.5254383", "0.52523327", "0.52451295", "0.5229941", "0.52266806", "0.5218408", "0.5217099", "0.521424", "0.5212916", "0.5211046", "0.52100253", "0.51912796", "0.51723135", "0.5168939", "0.5165635", "0.5165412", "0.5159575", "0.51556623", "0.51532143", "0.51514775", "0.5144706", "0.5143458", "0.51381475", "0.5133204", "0.5128667", "0.51023245", "0.50979275", "0.5093542", "0.5089819", "0.50882465", "0.5083274", "0.50823325", "0.50755084", "0.5074275", "0.50693417", "0.5066477", "0.50663245", "0.5066262", "0.5064737", "0.50580066", "0.50511354", "0.5048977", "0.50456816", "0.5042643", "0.50332123", "0.50307536", "0.50287676", "0.5023771", "0.5023629", "0.50179434", "0.50106966", "0.50069886", "0.5005409", "0.5001917", "0.49915504" ]
0.74314004
0
Build a configuration for testing purposes
protected function getConfig($which) { $yaml = ""; switch ($which) { case 'invalid_driver': $yaml .= "driver_type: local\n"; $yaml .= "driver: lmnop\n"; break; case 'invalid_driver_type': $yaml .= "driver_type: lmnop\n"; $yaml .= "driver: sqlite\n"; break; case 'sqlite': $yaml .= "driver_type: local\n"; $yaml .= "driver: sqlite\n"; break; } // Parse the config $parser = new Parser(); return $parser->parse ($yaml, true); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract public function generateConfiguration();", "public function createConfig()\n\t{\n\t}", "public function createLocalConfigurationFromFactoryConfiguration() {}", "public static function getConfiguration();", "abstract protected function defineConfiguration();", "abstract public static function createConfig(): Config;", "protected function buildTypolinkConfiguration() {}", "public function testConstruct()\n {\n $configuration = new Configuration();\n $this->assertInstanceOf(\n 'Pagantis\\OrdersApiClient\\Model\\Order\\Configuration\\Channel',\n $configuration->getChannel()\n );\n $this->assertInstanceOf(\n 'Pagantis\\OrdersApiClient\\Model\\Order\\Configuration\\Urls',\n $configuration->getUrls()\n );\n }", "protected function getConfiguration()\n {\n $container = new ContainerBuilder();\n\n $container->register('vivait_delayed_event.queue.test_queue');\n $container->register('doctrine_cache.providers.test_storage_cache');\n\n return new Configuration($container);\n }", "public function getConfiguration() {}", "public function getConfiguration() {}", "protected function getConfiguration() {}", "public static function config();", "protected function createMockConfig()\n {\n $mockConfig = $this->getMockBuilder('TripodTestConfig')\n ->setMethods(array(\n 'getCollectionForCBD',\n 'getCollectionForView',\n 'getCollectionForTable',\n 'getCollectionForSearchDocument'\n ))\n ->getMock();\n\n return $mockConfig;\n }", "function __construct() {\n if (getenv('VANTIV_DEVHUB_LICENSE')) {\n $config_array = [\n 'api_version' => 1,\n 'base_url' => 'https://apis.cert.vantiv.com',\n 'license' => getenv('VANTIV_DEVHUB_LICENSE')\n ];\n $this->config = new TestConfiguration($config_array);\n }\n else {\n $config = realpath(dirname(dirname(__FILE__))) . '/config.ini';\n if (file_exists($config)) {\n $config_array = parse_ini_file($config);\n $this->config = new TestConfiguration($config_array);\n }\n else {\n throw new \\Exception(\"Error: missing test config.ini. Please copy tests/example.config.ini to tests/config.ini and customize with your app's license.\");\n }\n }\n }", "public function getConfiguration();", "public function getConfiguration();", "public function getConfiguration();", "function getConfiguration() ;", "public function setUp()\r\n {\r\n $this->config += [\r\n 'http_errors' => false,\r\n 'timeout' => 10.0,\r\n 'base_uri' => $this->description->getBaseUri(),\r\n 'apiKey' => 'XXX',\r\n 'projectId' => 000,\r\n ];\r\n }", "public function testConfigAndBuild()\n {\n TableRegistry::clear();\n $map = TableRegistry::config();\n $this->assertEquals([], $map);\n\n $connection = ConnectionManager::get('test', false);\n $options = ['connection' => $connection];\n TableRegistry::config('users', $options);\n $map = TableRegistry::config();\n $this->assertEquals(['users' => $options], $map);\n $this->assertEquals($options, TableRegistry::config('users'));\n\n $schema = ['id' => ['type' => 'rubbish']];\n $options += ['schema' => $schema];\n TableRegistry::config('users', $options);\n\n $table = TableRegistry::get('users', ['table' => 'users']);\n $this->assertInstanceOf('Cake\\ORM\\Table', $table);\n $this->assertEquals('users', $table->table());\n $this->assertEquals('users', $table->alias());\n $this->assertSame($connection, $table->connection());\n $this->assertEquals(array_keys($schema), $table->schema()->columns());\n $this->assertEquals($schema['id']['type'], $table->schema()->column('id')['type']);\n\n TableRegistry::clear();\n $this->assertEmpty(TableRegistry::config());\n\n TableRegistry::config('users', $options);\n $table = TableRegistry::get('users', ['className' => __NAMESPACE__ . '\\MyUsersTable']);\n $this->assertInstanceOf(__NAMESPACE__ . '\\MyUsersTable', $table);\n $this->assertEquals('users', $table->table());\n $this->assertEquals('users', $table->alias());\n $this->assertSame($connection, $table->connection());\n $this->assertEquals(array_keys($schema), $table->schema()->columns());\n }", "protected function setUpConfigurationData() {}", "public function test_build_retrieve_a_configuraion_value() {\n\t\t\t$instanceName = \"value\";\n\t\t\t$value = \"testString\";\n\t\t\t$json = \"{\\\"$instanceName\\\": \\\"$value\\\"}\";\n\t\t\t$obj = new DIFactory(json_decode($json, true));\n\t\t\n\t\t\t# When build is called\n\t\t\t$result = $obj->build($instanceName);\n\t\t\t\n\t\t\t# Then an instance with all dependencies\n\t\t\t# declared in the configuration object is created\n\t\t\t$expected = $value;\n\t\t\t$this->assertEquals($expected, $result);\n\t\t}", "static public function build() {\n if (self::$built == TRUE) {\n return;\n }\n $lastFile = array_pop(debug_backtrace());\n $callingDirectory = dirname($lastFile['file']);\n $jsonPath = $callingDirectory . '/db.json';\n if (file_exists($jsonPath)) {\n $parsedJson = json_decode(file_get_contents($jsonPath), TRUE);\n print_r('Building with custom config ' . $jsonPath . PHP_EOL);\n }\n else {\n $jsonPath = __DIR__ . '/db.json';\n if (!file_exists($jsonPath)) {\n self::fail('Cannot locate default db.json file in ' . __DIR__);\n }\n $parsedJson = json_decode(file_get_contents($jsonPath), TRUE);\n }\n if (empty($parsedJson)) {\n self::fail('Invald Json found in ' . $jsonPath);\n }\n self::$config = $parsedJson;\n self::finalizeDbPath($callingDirectory);\n }", "public static function unit_test_configuration() {\n return array();\n }", "public function testGetConfiguration() {\n\n $obj = new WBWJQueryDataTablesExtension();\n\n $this->assertInstanceOf(Configuration::class, $obj->getConfiguration([], $this->containerBuilder));\n }", "protected function mockConfig()\n {\n $config = $this->getMock('Contao\\\\CoreBundle\\\\Adapter\\\\ConfigAdapter', ['isComplete']);\n\n $config\n ->expects($this->any())\n ->method('isComplete')\n ->willReturn(true)\n ;\n\n $config\n ->expects($this->any())\n ->method('get')\n ->willReturnCallback(function ($key) {\n switch ($key) {\n case 'characterSet':\n return 'UTF-8';\n\n case 'timeZone':\n return 'Europe/Berlin';\n\n default:\n return null;\n }\n })\n ;\n\n return $config;\n }", "abstract public function getConfig();", "protected function mockConfig()\n {\n $GLOBALS['container'] = new \\Pimple();\n\n $stub = $this->getMock(\n 'Config',\n array(\n 'getInstance',\n 'get'\n )\n );\n\n $stub->expects($this->any())\n ->method('get')\n ->with('dbDriver')\n ->will($this->returnValue('mySQL'));\n\n $GLOBALS['container']['config'] = $stub;\n }", "protected function initializeConfiguration() {}", "abstract public function configure();", "public function testWith()\n {\n $config = Config::with(\"dir:ext=mock;path={$this->dir}\");\n $this->checkWithResult($config);\n }", "private function runConfig()\n {\n $configs = [\n [\n 'name' => 'sub_title',\n 'alias_name' => 'SubTitle',\n 'value' => 'SubTitle',\n ],\n [\n 'name' => 'title',\n 'alias_name' => 'Title',\n 'value' => 'Title',\n ],\n ];\n\n foreach ($configs as $config) {\n factory(Config::class)->create($config);\n }\n }", "public function testConfigGetter(): void {\n $expected = new Config(\"$this->root/source\", \"$this->root/target\");\n $actual = $this->configUpdateManager->getConfig();\n self::assertEquals($expected, $actual);\n }", "public function makeConfig() : Config\n {\n if($this->makeConfig) {\n return $this->makeConfig;\n }\n return $this->makeConfig = factory(Config::class)->make();\n }", "protected function configure()\n {\n // load config\n $config = new \\Phalcon\\Config(array(\n 'base_url' => '/',\n 'static_base_url' => '/',\n ));\n\n if (file_exists(APPPATH.'config/static.php')) {\n $static = include APPPATH.'config/static.php';\n $config->merge($static);\n }\n\n if (file_exists(APPPATH.'config/setup.php')) {\n $setup = include APPPATH.'config/setup.php';\n $config->merge($setup);\n }\n\n return $config;\n }", "public function configuration(): SdkConfiguration;", "abstract protected function getConfig();", "public function testConstructor()\n {\n $configuration = new GenerationConfiguration();\n\n $this->assertEquals(4, $configuration->getMinLength());\n $this->assertEquals(8, $configuration->getMaxLength());\n $this->assertEquals(true, $configuration->isLowercase());\n $this->assertEquals(true, $configuration->isUppercase());\n $this->assertEquals(true, $configuration->isDigits());\n $this->assertEquals(true, $configuration->isPunctuation());\n $this->assertEquals(false, $configuration->isBrackets());\n $this->assertEquals(false, $configuration->isSpace());\n $this->assertEquals(false, $configuration->isSpecialCharacters());\n $this->assertEquals(null, $configuration->getExtraCharacters());\n }", "public function buildConfigurationSummary();", "function merchantConfigObject()\n{\n $config = new \\CyberSource\\Authentication\\Core\\MerchantConfiguration();\n $runEnv = \"api-matest.cybersource.com\";\n #OAuth related config\n $enableClientCert = true;\n $clientCertDirectory = \"Resources/\";\n $clientCertFile = \"\"; // p12 certificate\n $clientCertPassword = \"\"; // password used to encrypt p12\n $clientId = \"\";\n $clientSecret = \"\";\n\n $confiData = $config->setEnableClientCert($enableClientCert);\n $confiData = $config->setClientCertDirectory($clientCertDirectory);\n $confiData = $config->setClientCertFile($clientCertFile);\n $confiData = $config->setClientCertPassword($clientCertPassword);\n $confiData = $config->setClientId($clientId);\n $confiData = $config->setClientSecret($clientSecret);\n $confiData = $config->setRunEnvironment($runEnv);\n $config->validateMerchantData($confiData);\n return $config;\n}", "public function configure()\n {\n if ($this->getTestMode()) {\n $this->braintree->config->environment('sandbox');\n } else {\n $this->braintree->config->environment('production');\n }\n\n // Set the keys\n $this->braintree->config->merchantId($this->getMerchantId());\n $this->braintree->config->publicKey($this->getPublicKey());\n $this->braintree->config->privateKey($this->getPrivateKey());\n }", "public function getConfig(): Configuration;", "abstract protected function configure();", "abstract protected function configure();", "public function getConfigTreeBuilder()\n {\n }", "public function it_can_be_configured()\n {\n $this->beConstructedWith(self::CONFIG_BASIC);\n $this->getWrappedObject();\n }", "public function testSetconfiguration() {\n\n\t\t$hashConfig = array(\n\t\t\t'key_left' \t\t=>\t'custom_left',\n\t\t\t'key_right'\t\t=>\t'custom_right',\n\t\t\t'key_id'\t\t=>\t'custom_id',\n\t\t\t'key_parent'\t=>\t'custom_parent'\n\t\t);\n\t\t$objBuilder = new LeftRightTreeTraversal\\TreeBuilder();\n\t\t$objBuilder->setConfiguration($hashConfig);\n\n\t\t$objBuilder->addNode(new LeftRightTreeTraversal\\Node(0));\n\t\t$objBuilder->addNode(new LeftRightTreeTraversal\\Node(1));\n\t\t$objBuilder->setChildById(1, 0);\n\n\t\t$arrayResult = $objBuilder->compute()->export();\n\n\t\t$this->array($arrayResult)\n\t\t\t->size->isEqualTo(2);\n\n\t\tforeach ($arrayResult as $hash) {\n\t\t\t$this->array($hash)\n\t\t\t\t->hasKey('custom_id')\n\t\t\t\t->hasKey('custom_left')\n\t\t\t\t->hasKey('custom_right');\n\t\t}\n\n\t\t/*\n\t\t * Same test, using __construct() to set the configuration\n\t\t */\n\n\t\t$hashConfig = array(\n\t\t\t\t'key_left' \t\t=>\t'custom_left',\n\t\t\t\t'key_right'\t\t=>\t'custom_right',\n\t\t\t\t'key_id'\t\t=>\t'custom_id',\n\t\t\t\t'key_parent'\t=>\t'custom_parent'\n\t\t);\n\t\t$objBuilder = new LeftRightTreeTraversal\\TreeBuilder($hashConfig);\n\n\t\t$objBuilder->addNode(new LeftRightTreeTraversal\\Node(0));\n\t\t$objBuilder->addNode(new LeftRightTreeTraversal\\Node(1));\n\t\t$objBuilder->setChildById(1, 0);\n\n\t\t$arrayResult = $objBuilder->compute()->export();\n\n\t\t$this->array($arrayResult)\n\t\t->size->isEqualTo(2);\n\n\t\tforeach ($arrayResult as $hash) {\n\t\t\t$this->array($hash)\n\t\t\t->hasKey('custom_id')\n\t\t\t->hasKey('custom_left')\n\t\t\t->hasKey('custom_right');\n\t\t}\n\t}", "public function config(): Config;", "public function setUp()\n {\n $this->config = array(\n 's1' => 'string',\n 's2' => 'str',\n 'i1' => 'integer',\n 'i2' => 'int',\n 'i3' => '+integer',\n 'i4' => '+int',\n 'i5' => '-integer',\n 'i6' => '-int',\n 'f1' => 'float',\n 'f2' => '+float',\n 'f3' => '-float',\n 'b' => 'boolean',\n 'a' => 'array',\n 'm' => array(true, 'false'),\n 'r' => '/^member/',\n );\n $this->helper = new ConfigValidator($this->config);\n }", "public function configureBuilder();", "public function testThatCanGetConfigTreeBuilder()\n{\n$configuration = new Configuration();\n$this->assertInstanceOf('Symfony\\Component\\Config\\Definition\\Builder\\TreeBuilder', $configuration->getConfigTreeBuilder());\n}", "private function createConfiguration()\n {\n $this->createVrpayecommercePluginConfig();\n $this->Form();\n }", "private function generateConfig() {\n $config_json = array(\n 'version' => '1.0.0',\n 'name' => $this->gateway_name,\n 'description' => '',\n 'authors' => [],\n 'currencies' => ['USD'],\n 'signup_url' => 'https://google.com'\n );\n\n foreach($config_json as $key => $value) {\n if($key == 'authors' && isset($this->config['authors'])) {\n foreach($this->config[\"authors\"] as $config_author) {\n $config_entry = array(\n \"name\" => \"\",\n \"url\" => \"\"\n );\n \n if(isset($config_author['name'])) {\n $config_entry[\"name\"] = $config_author['name'];\n \n if(isset($config_author[\"url\"])) {\n $config_entry[\"url\"] = $config_author['url'];\n }\n $config_json[\"authors\"][] = $config_entry;\n }\n }\n }\n else {\n if(isset($this->config[$key])) {\n $config_json[$key] = $this->config[$key];\n }\n }\n }\n\n return json_encode($config_json);\n }", "public function testConfigReturnsDefault()\n {\n $unique = uniqid();\n $connection = new MockConnection($this->mockConnector, $this->mockCompiler);\n $this->assertEquals($unique, $connection->config('foobar', $unique));\n }", "private function setUpConfig() {\n\n //Get the file where the configs are and process the arrays\n require($this->_data['pathtodata']);\n\n $this->_data = array_merge($this->_data,$acs_confdata);\n\n if (empty($this->_data['indexfile']))\n $this->_data['indexfile'] = 'index';\n\n if (empty($this->_data['common_extension']))\n $this->_data['common_extension'] = COMMON_EXTENSION;\n \n $this->setUriData($this->_data); \n \n //Create the cache file of the config\n if (isset($this->_data['cache_config']) && $this->_data['cache_config'])\n $this->saveConfig();\n else\n if (file_exists($this->_data['cache_config_file']))\n unlink($this->_data['cache_config_file']); \n }", "static function getConfiguration(array $environment): Configuration {\n return new Configuration([\n 'commit_sha' => $environment['CI_COMMIT_ID'] ?? null,\n 'git_committer_email' => $environment['CI_COMMITTER_EMAIL'] ?? null,\n 'git_committer_name' => $environment['CI_COMMITTER_NAME'] ?? null,\n 'git_message' => $environment['CI_COMMIT_MESSAGE'] ?? null,\n 'service_job_id' => $environment['CI_BUILD_NUMBER'] ?? null,\n 'service_name' => 'codeship'\n ]);\n }", "public function testGetConfig()\n {\n $sut = new TestFixtureConfigTrait;\n $result = $sut->getConfig();\n $this->assertInstanceOf('\\MvcLite\\Config', $result);\n }", "static public function factory($config) {}", "public function configure();", "public function testInitWithIncludePathConfiguration()\n {\n set_include_path(get_include_path() . PATH_SEPARATOR . __DIR__ . \"/../data/\");\n\n ConfigurationRegistry::classConstructor();\n $configuration = ConfigurationRegistry::getConfiguration();\n\n $this->assertInstanceOf(\"malkusch\\bav\\Configuration\", $configuration);\n $this->assertEquals(\"test\", $configuration->getTempDirectory());\n\n restore_include_path();\n }", "protected function config()\n {\n if (! $this->config) {\n $this->config = Mockery::mock(Repository::class);\n }\n\n return $this->config;\n }", "private function initConfig()\n {\n return $this->config = [\n 'api' => 'https://api.gfycat.com/v1',\n ];\n }", "public function setUp()\n\t{\n\t\t$this->config = include __DIR__ . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'src' .\n\t\t DIRECTORY_SEPARATOR . 'config' . DIRECTORY_SEPARATOR . 'config.php';\n\t}", "public function make($environment = '')\n\t{\n\t\treturn new Config($this->getConfigLoader(), $this->env);\n\t}", "public function make(array $config);", "private function createConfigurationDefinition()\n {\n $id = $this->getServiceId('configuration');\n if (!$this->container->has($id)) {\n $definition = new Definition(self::CONFIGURATION);\n $definition\n ->setFactory([new Reference('ekyna_admin.pool_factory'), 'createConfiguration'])\n// ->setFactoryService('ekyna_admin.pool_factory')\n// ->setFactoryMethod('createConfiguration')\n ->setArguments([\n $this->prefix,\n $this->resourceName,\n $this->options['entity'],\n $this->buildTemplateList($this->options['templates']),\n $this->options['event'],\n $this->options['parent']\n ])\n ->addTag('ekyna_admin.configuration', [\n 'alias' => sprintf('%s_%s', $this->prefix, $this->resourceName)]\n )\n ;\n $this->container->setDefinition($id, $definition);\n }\n }", "final public static function buildDefault(): Config {\n\n\t\t// If not running in CLI, enable sandbox mode by default.\n\t\tif (!EnvInfo::isRunningInCli()) {\n\t\t\treturn new self;\n\t\t}\n\n\t\t$config = new self;\n\t\t$config->setSandboxMode(false);\n\t\t$config->setStdIoDriver(new TerminalIoDriver);\n\t\treturn $config;\n\n\t}", "public function it_gets_config_values()\n {\n $expectedConfig = [\n 'cluster' => false,\n 'default' => [\n 'host' => $this->masters[0]['host'],\n 'port' => $this->masters[0]['port']\n ]\n ];\n\n Config::shouldReceive('get')->once()->with('database.redis.nodeSetName')->andReturn('node-set');\n Config::shouldReceive('get')->once()->with('database.redis.masters')->andReturn($this->masters);\n Config::shouldReceive('get')->with('database.redis.backoff-strategy')->andReturn($this->backOffStrategy);\n Config::shouldReceive('get')->with('database.redis.cluster')->andReturn(false);\n\n $this->HAClient->shouldReceive('getIpAddress')->once()->andReturn($this->masters[0]['host']);\n $this->HAClient->shouldReceive('getPort')->once()->andReturn($this->masters[0]['port']);\n\n $this->driverUnderTest = new Driver();\n\n $configUnderTest = $this->driverUnderTest->getConfig();\n\n $this->assertEquals($expectedConfig, $configUnderTest);\n }", "public function populateLocalConfiguration() {}", "public function processConfiguration() {}", "public function getConfiguration(): Configuration {\n }", "public function testConfig()\n {\n $connection = new MockConnection($this->mockConnector, $this->mockCompiler);\n $this->assertEquals('mock', $connection->config('driver'));\n }", "protected function setUpFromConfig()\n\t{\n\t\t$timeLimit = 4 * 60 * 60;\n\n\t\t$parameters = $this->container->getParameters();\n\t\tif (is_array($parameters) and array_key_exists(\"taskManager\", $parameters)) {\n\t\t\t/// ***** TIMELIMIT ****** //\n\t\t\tif (isset($parameters[\"taskManager\"][\"timeLimit\"])) {\n\t\t\t\t$timeLimit = $parameters[\"taskManager\"][\"timeLimit\"];\n\t\t\t}\n\t\t\t/// ***** MAX HISTORY DAYS ****** //\n\t\t\tif (isset($parameters[\"taskManager\"][\"history\"][\"maxDays\"])) {\n\t\t\t\t$this->maxHistoryDays = (int)$parameters[\"taskManager\"][\"history\"][\"maxDays\"];\n\t\t\t}\n\t\t\t/// ***** MAX HISTORY RECORDS ****** //\n\t\t\tif (isset($parameters[\"taskManager\"][\"history\"][\"maxRecords\"])) {\n\t\t\t\t$this->maxHistoryRecords = (int)$parameters[\"taskManager\"][\"history\"][\"maxRecords\"];\n\t\t\t}\n\t\t}\n\n\t\tset_time_limit($timeLimit);\n\t}", "public static function getInstance($settings = null, $overwriteSettings = null)\n {\n if (is_array($settings) && count($settings)) {\n $configurationBuilderMock = new ConfigurationBuilderMock($settings);\n } else {\n $settings = [\n 'listIdentifier' => 'test',\n\n 'abc' => '1',\n 'prototype' => [\n\n 'backend' => [\n 'mysql' => [\n 'dataBackendClass' => 'MySqlDataBackend_MySqlDataBackend',\n 'dataMapperClass' => 'Mapper_ArrayMapper',\n 'dataSourceClass' => 'DataSource_MySqlDataSource',\n 'queryInterpreterClass' => 'MySqlDataBackend_MySqlInterpreter_MySqlInterpreter',\n ]\n ],\n 'column' => [\n 'xy' => 'z',\n ],\n ],\n 'listConfig' => [\n 'test' => [\n\n 'default' => [\n 'sortingColumn' => 'column3',\n ],\n\n\n 'headerPartial' => 'List/ListHeader',\n 'bodyPartial' => 'List/ListBody',\n 'aggregateRowsPartial' => 'List/AggregateRows',\n 'useIterationListData' => 1,\n\n 'backendConfig' => [\n 'dataBackendClass' => 'Typo3DataBackend_Typo3DataBackend',\n 'dataMapperClass' => 'Mapper_ArrayMapper',\n 'dataSourceClass' => 'DataSource_Typo3DataSource',\n 'queryInterpreterClass' => 'MySqlDataBackend_MySqlInterpreter_MySqlInterpreter',\n\n\n 'dataSource' => [\n 'testKey' => 'testValue',\n 'username' => 'user',\n 'password' => 'pass',\n 'host' => 'localhost',\n 'port' => 3306,\n 'databaseName' => 'typo3',\n ],\n\n 'baseFromClause' => 'companies',\n 'baseGroupByClause' => 'company',\n 'baseWhereClause' => 'employees > 0'\n ],\n\n 'abc' => '2',\n 'def' => '3',\n\n 'controller' => [\n 'Export' => [\n 'download' => [\n 'view' => 'export.exportConfigs.test'\n ]\n ]\n ],\n\n 'fields' => [\n 'field1' => [\n 'table' => 'tableName1',\n 'field' => 'fieldName1',\n 'isSortable' => '0',\n 'access' => '1,2,3,4'\n ],\n 'field2' => [\n 'table' => 'tableName2',\n 'field' => 'fieldName2',\n 'isSortable' => '1',\n 'access' => '1,2,3,4'\n ],\n 'field3' => [\n 'special' => 'special',\n 'isSortable' => '1',\n 'access' => '1,2,3,4'\n ],\n 'field4' => [\n 'table' => 'tableName4',\n 'field' => 'fieldName4',\n ]\n ],\n 'columns' => [\n 10 => [\n 'columnIdentifier' => 'column1',\n 'fieldIdentifier' => 'field1',\n 'label' => 'Column 1',\n 'isSortable' => '0',\n\n 'excelExport' => [\n 'wrap' => 0,\n 'vertical' => 'top',\n ],\n ],\n 20 => [\n 'columnIdentifier' => 'column2',\n 'fieldIdentifier' => 'field2',\n 'label' => 'Column 2',\n 'isSortable' => '1',\n 'isVisible' => '0',\n 'sorting' => 'field1, field2',\n 'showInHeader' => 0,\n\n ],\n 30 => [\n 'columnIdentifier' => 'column3',\n 'fieldIdentifier' => 'field3',\n 'label' => 'Column 3',\n 'isSortable' => '1',\n 'sorting' => 'field1 asc, field2 !DeSc',\n 'accessGroups' => '1,2,3,4',\n 'cellCSSClass' => 'class',\n ],\n 40 => [\n 'columnIdentifier' => 'column4',\n 'fieldIdentifier' => 'field4',\n 'label' => 'Column 4',\n //'renderTemplate' => 'typo3conf/ext/pt_extlist/Configuration/TypoScript/Demolist/Demolist_Typo3_02.hierarchicStructure.html',\n ],\n\n // We use this column for testing sortingFields setup\n 50 => [\n 'columnIdentifier' => 'column5',\n 'fieldIdentifier' => 'field4',\n 'label' => 'Column 5',\n 'sortingFields' => [\n 10 => [\n 'field' => 'field1',\n 'direction' => 'desc',\n 'forceDirection' => 1,\n 'label' => 'Sorting label 1'\n ],\n 20 => [\n 'field' => 'field2',\n 'direction' => 'asc',\n 'forceDirection' => 0,\n 'label' => 'Sorting label 2'\n ],\n 30 => [\n 'field' => 'field3',\n 'direction' => 'desc',\n 'forceDirection' => 0,\n 'label' => 'Sorting label 3'\n ]\n ]\n ],\n\n // This column configuration tests objectMapper\n 60 => [\n 'columnIdentifier' => 'column6',\n 'fieldIdentifier' => 'field4',\n 'label' => 'Column 6',\n 'objectMapper' => [\n 'class' => 'Bookmark',\n 'mapping' => [\n 'label' => 'name'\n ]\n ]\n ]\n\n ],\n\n 'rendererChain' => [\n 'enabled' => 1,\n 'rendererConfigs' => [\n 100 => [\n 'rendererClassName' => 'Tx_PtExtlist_Tests_Domain_Renderer_DummyRenderer',\n ]\n ]\n ],\n\n 'filters' => [\n 'testfilterbox' => [\n 'filterConfigs' => [\n '10' => [\n 'filterIdentifier' => 'filter1',\n 'filterClassName' => 'Tx_PtExtlist_Domain_Model_Filter_StringFilter',\n 'fieldIdentifier' => 'field1',\n 'partialPath' => 'Filter/StringFilter',\n 'defaultValue' => 'default',\n ],\n '20' => [\n 'filterIdentifier' => 'filter2',\n 'filterClassName' => 'Tx_PtExtlist_Domain_Model_Filter_StringFilter',\n 'fieldIdentifier' => 'field1',\n 'partialPath' => 'Filter/StringFilter',\n 'accessGroups' => '1,2,3'\n ]\n ]\n ]\n ],\n 'pager' => [\n 'itemsPerPage' => '10',\n 'pagerConfigs' => [\n 'default' => [\n 'templatePath' => 'EXT:pt_extlist/',\n 'pagerClassName' => 'DefaultPager',\n 'enabled' => '1'\n ],\n ],\n ],\n\n\n 'aggregateData' => [\n 'sumField1' => [\n 'fieldIdentifier' => 'field1',\n 'method' => 'sum',\n 'scope' => 'page',\n ],\n 'avgField2' => [\n 'fieldIdentifier' => 'field2',\n 'method' => 'avg',\n ],\n ],\n\n\n 'aggregateRows' => [\n 10 => [\n 'column2' => [\n 'aggregateDataIdentifier' => 'sumField1',\n ]\n ]\n ],\n\n 'export' => [\n 'exportConfigs' => [\n 'test' => [\n 'downloadType' => 'D',\n 'fileName' => 'testfile',\n 'fileExtension' => 'ext',\n 'addDateToFilename' => 1,\n 'pager' => ['enabled' => 0],\n 'viewClassName' => 'Tx_PtExtlist_View_Export_CsvListView',\n ]\n ]\n ]\n ]\n ]\n ];\n\n if (is_array($overwriteSettings)) {\n ArrayUtility::mergeRecursiveWithOverrule($settings, $overwriteSettings);\n }\n\n $configurationBuilderMock = new ConfigurationBuilderMock($settings);\n $configurationBuilderMock->settings = $configurationBuilderMock->origSettings['listConfig'][$configurationBuilderMock->origSettings['listIdentifier']];\n }\n return $configurationBuilderMock;\n }", "public function testConfigurationFromFile()\n {\n $path = __DIR__ . '/files/file1.config.php';\n\n $configuration = Factory::fromFile($path);\n\n $this->assertInstanceOf(Configuration::class, $configuration);\n $this->assertEquals(include $path, $configuration->getInternalContainer());\n }", "public function buildJavascriptConfiguration() {}", "public function buildJavascriptConfiguration() {}", "public function buildJavascriptConfiguration() {}", "public function buildJavascriptConfiguration() {}", "public function buildJavascriptConfiguration() {}", "public function buildJavascriptConfiguration() {}", "public function buildJavascriptConfiguration() {}", "public function buildJavascriptConfiguration() {}", "public function buildJavascriptConfiguration() {}", "public function buildJavascriptConfiguration() {}", "public function buildJavascriptConfiguration() {}", "public function buildJavascriptConfiguration() {}", "public function buildJavascriptConfiguration() {}", "public function buildJavascriptConfiguration() {}", "public function buildJavascriptConfiguration() {}", "public function buildJavascriptConfiguration() {}", "public function buildJavascriptConfiguration() {}", "public function buildJavascriptConfiguration() {}", "public function buildJavascriptConfiguration() {}", "public function buildJavascriptConfiguration() {}", "public function buildJavascriptConfiguration() {}", "public function buildJavascriptConfiguration() {}", "public function buildJavascriptConfiguration() {}", "public function buildJavascriptConfiguration() {}", "public function buildJavascriptConfiguration() {}" ]
[ "0.72673887", "0.68251795", "0.6821133", "0.660792", "0.65654856", "0.6565071", "0.6535437", "0.6508393", "0.646699", "0.6451548", "0.6451091", "0.64481735", "0.63985837", "0.63977766", "0.63615143", "0.6344345", "0.6344345", "0.6344345", "0.63364255", "0.6328226", "0.6275281", "0.6273538", "0.6239268", "0.6177539", "0.61402273", "0.61280614", "0.6124826", "0.610412", "0.60807526", "0.60801536", "0.6076816", "0.60659814", "0.6052761", "0.60389656", "0.60386366", "0.5998537", "0.59855634", "0.5976819", "0.5959619", "0.5941166", "0.5897648", "0.5883155", "0.5875086", "0.58619744", "0.58619744", "0.58574486", "0.5855422", "0.58506906", "0.5846128", "0.5842974", "0.582462", "0.58191943", "0.5816772", "0.58148617", "0.5810699", "0.58079296", "0.58073676", "0.57908523", "0.57885826", "0.57849246", "0.578054", "0.5765453", "0.57654405", "0.57646996", "0.5763374", "0.5746141", "0.57432604", "0.57425827", "0.57202685", "0.5718602", "0.5703206", "0.5700129", "0.5679726", "0.56787395", "0.56781554", "0.5669171", "0.5657921", "0.5657921", "0.5657921", "0.5657921", "0.5657921", "0.5657921", "0.5657921", "0.5657921", "0.5657921", "0.5657921", "0.5657921", "0.5657921", "0.5657921", "0.5657921", "0.5657921", "0.5657921", "0.5657921", "0.5657921", "0.5657921", "0.5657921", "0.5657921", "0.5657921", "0.5657921", "0.5657921", "0.5657921" ]
0.0
-1
Rewind the path item pointer position.
public function rewind() { if (count($this->pathItemList) > 0) { $this->index = 0; } else { $this->index = NULL; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function rewind(): void\n {\n $this->pointer = 0;\n }", "public function rewind(): void\n {\n $this->key = 0;\n $this->current = $this->start;\n }", "public function rewind(): void {\n reset($this->items);\n }", "public function rewind(): void\n {\n reset($this->_items);\n }", "function rewind (){ $this->key = -1; }", "public function rewind() {}", "public function rewind() {}", "public function rewind() {}", "public function rewind() {}", "public function rewind() {}", "public function rewind() {}", "public function rewind() {}", "public function rewind() {}", "public function rewind() {}", "public function rewind(): void\n {\n if ($this->_index === 0) {\n return;\n }\n\n $this->_index = 0;\n }", "public function rewind()\n {\n $this->current = $this->bottom();\n }", "public function rewind() \n {\n $this->pointer = 0;\n if (isset($this->list[$this->pointer])) {\n $this->list[$this->pointer]->rewind();\n }\n }", "public function rewind(): void\n {\n $this->position = 0;\n }", "public function rewind() {\n $this->_key = 0;\n }", "public function rewind()\n {\n $this->pointer = 0;\n }", "public function rewind()\n {\n $this->pointer = 0;\n }", "public function rewind() {\r\n reset($this->itemList);\r\n }", "public function rewind()\n {\n $this->pointer = -1;\n $this->next();\n }", "public function rewind() {\n $this->pos = 0;\n }", "public function performRewind() {\n $this->data = array();\n $this->currentPage = 0;\n $this->currentCount = 0;\n }", "public function rewind();", "public function rewind();", "public function rewind();", "public function rewind();", "public function rewind();", "public function rewind() {\n if($this->items!==false)\n reset($this->items);\n }", "public function rewind()\n {\n $this->current = null;\n }", "public function rewind()\n {\n $this->currentKey = 0;\n }", "public function rewind() {\n\t\t$this->position = 0;\n\t}", "public function rewind() {\n\t\t$this->position = 0;\n\t}", "public function rewind()\n {\n $this->key = 0;\n }", "public function rewind()\n {\n $this->key = 0;\n }", "private function resetCurrentItem()\n {\n $this->current_item = 0;\n }", "public function rewind(){\n $this->index = 0;\n }", "public function rewind_items() {\n\n\t\t$this->{$this->loop_vars['current_item']} = -1;\n\n\t\tif ( $this->{$this->loop_vars['item_count']} > 0 ) {\n\t\t\t$this->{$this->loop_vars['item_name']} = $this->{$this->loop_vars['item_name_plural']}[0];\n\t\t}\n\t}", "public function rewind()\n\t{\n\t\t$this->__position = 0;\n\t}", "public function rewind() {\n $this->_position = 0;\n }", "public function rewind()\n {\n reset($this->_items);\n }", "public function rewind() {\n\t\t\t$this->index = 0;\n\t\t}", "public function rewind() {\n return reset($this->_path);\n }", "public function rewind()\r\n {\r\n reset($this->children);\r\n }", "public function rewind()\n {\n $this->current = 0;\n }", "public function rewind() {\n\n\t\t\t$this->position = 0;\n\t\t}", "public function rewind(): void\n {\n reset($this->array);\n }", "public function rewind(): void\n {\n reset($this->data);\n }", "public function rewind()\n {\n rewind($this->_handle);\n $this->_currentIndex = -1;\n $this->next();\n }", "public function rewind() {\r\n\t\t$this->position = 0;\r\n\t\trewind($this->handle);\r\n\t\t$this->next();\r\n\t}", "function rewind() {\r\n $this->_position = 0;\r\n }", "public function rewind(): void;", "public function rewind(): void;", "public function rewind() {\n $this->index = 0;\n }", "public function rewind()\n {\n $this->_previous = 1;\n $this->_current = 0;\n $this->_key = 0;\n }", "public function rewind()\n {\n }", "public function rewind() {\n\t\t}", "public function rewind(): void\n {\n if ($this->position != 1) {\n $this->position = 1;\n $this->data = [];\n $this->fetchMore();\n }\n }", "function rewind() {\n $this->position = 0;\n }", "public function rewind(): void\n {\n $this->selection->rewind();\n }", "public function rewind()\n\t{\n\t\t$this->_position = 0;\n\t}", "public function rewind() {\n reset($this->elements);\n $this->pointer = 0;\n }", "function rewind() {\n $this->resetKeys();\n $this->position = 0;\n }", "public function rewind()\n {\n $this->position = 0;\n $this->getOrigin()->data_seek($this->position);\n }", "public function rewind()\n {\n $this->offset = 0;\n }", "public function rewind()\n {\n $this->_position = 0;\n }", "public function rewind() {\n\t\t/** Nothing do */\n\t}", "public function rewind()\n {\n $this->position = 0;\n }", "public function rewind()\n {\n $this->position = 0;\n }", "public function rewind()\n {\n $this->position = 0;\n }", "public function rewind()\n {\n $this->position = 0;\n }", "public function rewind()\n {\n $this->position = 0;\n }", "public function rewind()\n {\n $this->position = 0;\n }", "public function rewind()\n {\n $this->position = 0;\n }", "public function rewind()\n {\n $this->position = 0;\n }", "public function rewind()\n {\n $this->position = 0;\n }", "public /*void*/ function rewind(){}", "#[\\ReturnTypeWillChange]\n public function rewind()\n {\n }", "#[\\ReturnTypeWillChange]\n public function rewind()\n {\n }", "public function rewind()\n {\n $this->rewind = 0;\n }", "public function rewind()\n {\n }", "public function rewind()\n {\n $this->index = 0;\n }", "public function rewind(): void\n {\n /** @psalm-suppress MissingThrowsDocblock - 0 is within bound. */\n $this->seek(0);\n }", "public function rewind() {\n do {\n $this->collections[$this->_current]->rewind(); \n } while ($this->_current-- > 0);\n }", "public function rewind()\n\t{\n\t\techo'Rewinding \\n';\n\t\treset($this ->var);\n\t}", "public function rewind()\n {\n reset($this->data);\n $this->current_index = 0;\n }", "public function rewind() {\n\t\treset($this->_value);\n\t}", "public function rewind() {\n\t\tif( $this->isDirty() ) { $this->executeQuery(); }\n\t\t$this->_currentRow = 0;\n\t}", "public function rewind() {\n reset($this->data);\n }", "public function rewind() {\n reset($this->data);\n }", "public function rewind(){\n return reset($this->items);\n }", "public function rewind(){\n return reset($this->items);\n }", "public function rewind() {\n\t\treset($this->_data);\n\t}", "public function rewind()\n {\n $this->seek(0);\n }", "public function rewind()\n {\n $this->seek(0);\n }", "public function rewind()\n {\n $this->seek(0);\n }", "public function rewind(): void\n {\n $this->_skipNextIteration = false;\n reset($this->_data);\n $this->_index = 0;\n }", "public function rewind()\n {\n $this->iCurrentKey = 0;\n $this->strCurrentValue = $this->strStart;\n }" ]
[ "0.6687653", "0.6668656", "0.66587275", "0.65899634", "0.6424432", "0.6401199", "0.6401199", "0.6400935", "0.6400935", "0.6400935", "0.6400935", "0.6400935", "0.6400935", "0.6400935", "0.63929397", "0.6369804", "0.6313952", "0.63007313", "0.6296135", "0.62805766", "0.62805766", "0.622882", "0.62236136", "0.620304", "0.61986107", "0.6190657", "0.6190657", "0.6190657", "0.6190657", "0.6190657", "0.61821574", "0.61800706", "0.6179727", "0.61734134", "0.61734134", "0.61448944", "0.61448944", "0.6131371", "0.6115979", "0.60980505", "0.60879254", "0.6070103", "0.60651934", "0.6060226", "0.6058937", "0.6058299", "0.6054443", "0.6051101", "0.6050478", "0.60359055", "0.6034244", "0.60290813", "0.6024797", "0.6012947", "0.6012947", "0.59852105", "0.5984666", "0.5971151", "0.596129", "0.5935339", "0.59146905", "0.5906317", "0.59030735", "0.5894954", "0.5866457", "0.5864143", "0.58529854", "0.5851785", "0.5851223", "0.5850102", "0.5850102", "0.5850102", "0.5850102", "0.5850102", "0.5850102", "0.5850102", "0.5850102", "0.5850102", "0.58226734", "0.5821961", "0.5821961", "0.5821155", "0.57826835", "0.5780952", "0.57790923", "0.57781875", "0.5773035", "0.57718974", "0.57572424", "0.5744364", "0.57408774", "0.57408774", "0.5735373", "0.5735373", "0.57219005", "0.5715121", "0.5715121", "0.5715121", "0.56952065", "0.56839293" ]
0.6619746
3
Move the path item pointer to next position.
public function next() { if ($this->index !== NULL) { $val = $this->pathItemList[$this->index]; $this->index = $this->index + 1 < count($this->pathItemList) ? $this->index + 1 : NULL; return $val; } return NULL; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function MoveNext() {}", "public function next()\n {\n $current = $this->current();\n\n if ($current) {\n $this->current = $current->getAfter();\n }\n }", "public function next(): void {\n next($this->items);\n }", "protected function _moveNext()\n {\n if ($nextRow = $this->_getNextRow()) {\n $this->_currentRow = $this->_formatRow($nextRow);\n } else {\n $this->_currentRow = array();\n }\n \n if (!$this->_currentRow) {\n fclose($this->_handle);\n $this->_valid = false;\n $this->_handle = null;\n }\n }", "public function next(): void\n {\n ++$this->key;\n\n if ($this->next) {\n $this->current = $this->current->next();\n } else {\n $this->current = $this->current->previous();\n }\n }", "public function next() {\n\t\t++$this->position;\n\t}", "public function column_next_steps( $item ) {}", "function next() {\n $this->position++;\n }", "public function next() {\n\t\t$this->position ++;\n\t}", "public function next()\n {\n next($this->_items);\n }", "public function next()\n {\n $this->pointer++;\n }", "public function next()\n {\n $this->position++;\n }", "public function next()\n {\n $this->position++;\n }", "public function next(): void\n {\n ++$this->position;\n }", "public function next(): void\n {\n ++$this->position;\n }", "public function next(): void\n {\n ++$this->position;\n }", "public function next() {\n ++ $this->_position;\n }", "public function next(): void\n {\n $this->position++;\n if (null === $this->generator || !$this->generator->valid()) {\n return;\n }\n\n if (contains_key($this->entries, $this->position + 1)) {\n return;\n }\n\n $this->progress();\n $this->saved = false;\n if ($this->generator) {\n $this->generator->next();\n }\n\n $this->progress();\n }", "public function moveNext() {\n\t\tif($this->getPointer() <= $this->getLast()) {\n\t\t\t$this->pointer++;\n\t\t\t\n\t\t\treturn $this->pointer;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public function next() {\n next($this->elements);\n $this->pointer++;\n }", "public function next()\n {\n $this->_position++;\n }", "public function next()\n {\n $newPrevious = $this->_current;\n $this->_current += $this->_previous;\n $this->_previous = $newPrevious;\n $this->_key++;\n }", "public function next() {\n $this->pos++;\n }", "public function column_next_steps($item)\n {\n }", "public function column_next_steps($item)\n {\n }", "public function column_next_steps($item)\n {\n }", "public function next(): void\n {\n $this->_index++;\n }", "public function next(): void\n {\n ++$this->pointer;\n }", "public function next()\r\n {\r\n next($this->children);\r\n }", "public function next()\n\t{\n\t\t$this->_position++;\n\t}", "public function next()\n\t{\n\t\t$this->__position++;\n\t}", "public function next(): void\n {\n if ($this->index < count($this->objectListKeys)) {\n $this->index++;\n }\n }", "function next()\n {\n ++$this->_position;\n }", "public function moveItemAt($currentPosition, $newPosition = 0);", "public function next()\n \t{\n \t\t$handle = $this->getHandle();\n \t\t$handle->current = readdir($handle->resource);\n \t}", "public function next()\n {\n ++$this->position;\n }", "public function next()\n {\n ++$this->position;\n }", "public function next()\n {\n ++$this->position;\n }", "public function next()\n {\n ++$this->position;\n }", "public function next()\n {\n ++$this->position;\n }", "public function next()\n {\n ++$this->position;\n }", "public function next()\n {\n ++$this->position;\n }", "public function next()\n {\n ++$this->position;\n }", "public function next()\n {\n ++$this->position;\n }", "public function next()\n {\n $this->index++;\n }", "public function next() {\n $this->_key++;\n }", "public function next()\n {\n # Pegando a posição atual do array e com ternario, verificando se é reverso e aplicando a operação.\n $this->posicao = $this->posicao + ($this->reverso ? -1 : 1);\n }", "function moveNext() {\r\n\r\n $row = $this->result->fetchRow( MDB2_FETCHMODE_ASSOC );\r\n $this->EOF = !is_array( $row );\r\n $this->fields = $row;\r\n\r\n }", "final public function next(): void\n {\n $this->sort();\n\n next($this->index);\n }", "public function next(){\n $this->index ++;\n }", "public function setNext($key, \\RKW\\RkwSearch\\TreeTagger\\TreeTaggerRecord $item) {\n\n if ($this->checkData($item, 'next', $key)) {\n $this->next[$key] = $item;\n $this->bases[] = $item->getBase();\n }\n }", "public function next()\n {\n $this->key++;\n }", "public function next()\n {\n $this->key++;\n }", "function moveItemUp()\r\n\t{\r\n\t\t$this->content_obj->moveItemUp();\r\n\t\t$_SESSION[\"il_pg_error\"] = $this->pg_obj->update();\r\n\t\t$this->ctrl->returnToParent($this, \"jump\".$this->hier_id);\r\n\t}", "public function next ()\n {\n if ( isset($this->iterator) && $this->offset == $this->internalOffset ) {\n $this->internalOffset++;\n $this->iterator->next();\n $this->storeNext();\n }\n\n $this->offset++;\n }", "public function moveToNextLine($x, $y, $setLeading = false) {}", "public function moveToNextLine($x, $y, $setLeading = false) {}", "public function next()\n {\n do {\n $this->iterated->attach($this->current());\n parent::next();\n } while ($this->valid() && (!$this->passes($this->current()) || $this->iterated->contains($this->current())));\n }", "public function next()\n {\n $this->storage->next();\n }", "function moveToNextRow();", "public function next() {\n return next($this->_path);\n }", "public function next() {\n\t\t$this->_currentRow++;\n\t}", "public function next()\n {\n $this->currentKey++;\n }", "public function setNextPosition(Position $position): void;", "public function next()\n\t{\n\t\t$this->_idx++;\n\t}", "public function next()\n {\n\t\tnext($this->_data);\n $this->_index++;\n\t}", "public abstract function moveToNext($referenceId = null);", "public function next()\n {\n $this->fileObject->next();\n }", "public function next()\n {\n $this->position++;\n $this->fileIterator->seek($this->position);\n }", "public function next()\n\t{\n\t\t$pageSize = count($this->_items);\n\t\t$this->_currentIndex++;\n\t\tif ($this->_currentIndex >= $pageSize) {\n\t\t\t$this->_currentPage++;\n\t\t\t$this->_currentIndex = 0;\n\t\t\t$this->loadPage();\n\t\t}\n\t}", "public function next(): void\n {\n $this->cursor++;\n }", "public function next()\n\t{\n\t\t$this->current = $this->runFetch();\n\n\t\tif ($this->current) {\n\t\t\t$this->index++;\n\t\t}\n\t}", "function moveItemDown()\r\n\t{\r\n\t\t$this->content_obj->moveItemDown();\r\n\t\t$_SESSION[\"il_pg_error\"] = $this->pg_obj->update();\r\n\t\t$this->ctrl->returnToParent($this, \"jump\".$this->hier_id);\r\n\t}", "public function next()\n {\n $this->iteratorPosition++;\n }", "public function next()\n {\n ++$this->offset;\n }", "public function next()\n {\n $this->currentElement = $this->readNextElement();\n $this->atStart = FALSE;\n }", "public function next(): mixed\n {\n $item = false;\n if ($this->getItemPointer() < $this->Length()) {\n $item = $this->Current();\n $this->setItemPointer($this->getItemPointer() + 1);\n }\n\n return $item;\n }", "public function next()\r\n {\r\n if ($this->index < $this->aggregate->size()) {\r\n $this->index = $this->index+1;\r\n }\r\n }", "function moveRight()\n {\n $this->position++;\n if ($this->position >= count($this->line)) {\n array_push($this->line, '_');\n }\n }", "public function moveToNextAttribute(): bool\n {\n $moved = FALSE;\n $node = $this->currentNode->nextSibling;\n \n if ($node instanceof \\DOMAttr) {\n $this->currentNode = $node;\n $moved = TRUE;\n }\n \n return $moved;\n }", "public function next ()\n {\n $this->inputs->next();\n $this->offset++;\n }", "public function next()\n {\n $this->current = ($result = ldap_next_entry($this->handle, $this->current())) ? $result : null;\n }", "public function next()\n {\n $this->cursor++;\n }", "public function next()\n\t\t{\n\t\t\tnext($this->source);\n\t\t}", "public function next()\n {\n $this->_currentElement = fgets($this->_handle, self::LINE_LENGTH);\n $this->_currentIndex++;\n }", "public function moveToStartOfNextLine() {}", "public function moveToStartOfNextLine() {}", "public function moveAsNextSiblingOf(Doctrine_Record $dest);", "public function next()\n {\n fseek($this->resource, 1, SEEK_CUR);\n }", "public function next_step() {\r\n\t\t$this->step ++;\r\n\t}", "public function next(): void\n {\n next($this->array);\n }", "#[\\ReturnTypeWillChange]\n public function next()\n {\n $this->index++;\n return next($this->items);\n }", "private function next()\n {\n $this->m++;\n $this->init();\n }", "public function nextSibling($path)\n {\n return $this->adjacentSibling($path, 1);\n }", "public function next()\n {\n next($this->iterator_data);\n }", "public function next()\n {\n do {\n ++$this->pointer;\n } while ($this->valid() && !$this->current()->isEnabled());\n }", "protected function moveToStep($step)\n {\n reset($this->steps);\n while (key($this->steps))\n {\n $current=current($this->steps); \n if ($step->get('name')==$current->get('name'))\n break; \n next($this->steps); \n } \n }", "public function next()\n {\n $this->dataSource->next();\n $this->position++;\n }", "public function next(): void\n {\n if (count($this->data) > 0) {\n array_shift($this->data);\n }\n ++$this->position;\n\n if ($this->position > $this->numberOfRecords()) {\n return;\n }\n\n if (count($this->data) == 0) {\n $this->fetchMore();\n }\n }", "public function moveToNextSiblingOf(BaseObject $node, BaseObject $dest_node)\n {\n $node->setParentIdValue($dest_node->getParentIdValue());\n $node->setScopeIdValue($dest_node->getScopeIdValue());\n $this->addPreSaveStackEntries(self::getUpdateTreeQueries($node, $dest_node->getRightValue() + 1));\n }" ]
[ "0.6853416", "0.67404604", "0.6497399", "0.6381864", "0.6372711", "0.6343457", "0.6342514", "0.6318614", "0.6311823", "0.6301679", "0.62687165", "0.6265535", "0.6265535", "0.62346184", "0.62346184", "0.62346184", "0.62332654", "0.6221572", "0.6220621", "0.6209093", "0.61933404", "0.6182375", "0.6157522", "0.6125343", "0.6124328", "0.61239344", "0.61225873", "0.611899", "0.61010104", "0.60876036", "0.6074487", "0.6029666", "0.6012985", "0.5960955", "0.5952251", "0.5939004", "0.5939004", "0.5939004", "0.5939004", "0.5939004", "0.5939004", "0.5939004", "0.5939004", "0.5939004", "0.593666", "0.590694", "0.5897575", "0.58779603", "0.587136", "0.5861275", "0.5851966", "0.58386976", "0.58386976", "0.58372736", "0.58362365", "0.58317196", "0.58317196", "0.58252776", "0.5823615", "0.5818037", "0.58082205", "0.5797299", "0.57754624", "0.5764413", "0.57601", "0.5758671", "0.5750035", "0.5735756", "0.5732237", "0.57312477", "0.572924", "0.5724586", "0.5718583", "0.5712542", "0.5695304", "0.56782347", "0.5653802", "0.565164", "0.56463224", "0.56284255", "0.5621313", "0.56198645", "0.560969", "0.5600697", "0.5594845", "0.5579604", "0.5579604", "0.55660176", "0.55634356", "0.5562639", "0.5554716", "0.5553566", "0.5551164", "0.5544531", "0.5538766", "0.5535361", "0.55327356", "0.5516734", "0.5508739", "0.55063546" ]
0.6377709
4
Get the path id.
public function getPathId() { return $this->pathId; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function pathId($path);", "public function id(): string\n {\n return $this->model->getRouteKey();\n }", "public function pId()\n {\n static $id = null;\n\n if (!is_null($id)) {\n return $id;\n }\n\n $id = $this->property('id');\n\n if (strpos($id, 'http') === 0) {\n $path = explode('/', parse_url($id, PHP_URL_PATH));\n\n if ($path[1] == 'gallery') {\n $id = $path[2];\n }\n elseif ($path[1] == 'a') {\n $id = 'a/'.$path[2];\n }\n else {\n $id = $path[1];\n }\n }\n\n return $id;\n }", "public function getIdentifier()\n {\n if ($this->identifierType === self::URL_REWRITE)\n {\n return $this->request->path();\n }\n return $this->request->get();\n }", "public function getIdentifier()\n {\n return $this->getUri()->toString();\n }", "public function getUserRoutePathId()\n {\n return $this->userRoutePathId;\n }", "public function getId()\n {\n return $this->file->get('id');\n }", "private function parsePathId($path)\n {\n $matches = [];\n $regex = '/^' .\n '(' .\n Path::REGEX_PATH_INTERNAL_ID_CHAR . '?' .\n Path::REGEX_PATH_ID_NAME .\n Path::REGEX_PATH_ID_SEPARATOR .\n ')(.*)$/';\n $match_result = preg_match($regex, $path, $matches);\n if ($match_result) {\n $this->pathId = substr($matches[1], 0, -1);\n $path = $matches[2];\n }\n return $path;\n }", "private function getId(): int|string\n {\n return '/'.($_SESSION['rfe']['lastUsedItemId']++);\n }", "public function getPath($id);", "public static function getId() {\n return isset(self::$id)\n ? self::$id\n : (self::$id = base_convert(crc32(self::getBaseDir()),16,32));\n\t}", "public static function getPath($id);", "protected function GetId() {\n\n $Id= $this->GetOption('Id');\n if (!$Id) {\n $Id= $this->GetName(); // let id be same as name\n $Id= str_replace(array('[',']'),'_', $Id); // id cannot contain '[' and ']'\n $Id= trim($Id, '_'); // id cannot start with '_'\n }\n return $Id;\n }", "public function getFileId(): string\n {\n return $this->file_id;\n }", "public function getPidPath();", "public function get_id();", "public function get_id();", "protected function getIdentifier()\n {\n if ($this->parameters->scheme === 'unix') {\n return $this->parameters->path;\n }\n\n return \"{$this->parameters->host}:{$this->parameters->port}\";\n }", "function get_id() {\n\t\treturn $this->get_data( 'id' );\n\t}", "function fs_get_page_id_from_path( $path ) {\r\n\t$page = get_page_by_path( $path );\r\n\tif ( $page ) {\r\n\t\treturn $page->ID;\r\n\t} else {\r\n\t\treturn null;\r\n\t};\r\n}", "public function getID();", "public function getID();", "public function getID();", "public function getFileID()\n {\n return $this->get('FileID');\n }", "protected function getFolderId()\n\t{\n\t\tif(!$this->folderId)\n\t\t{\n\t\t\t$id = basename(Route::current()->uri());\n\t\t\t\n\t\t\tif(!$id || !in_array($id, $this->folders))\n\t\t\t{\n\t\t\t\t$this->folderId = 'sent';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->folderId = $id;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $this->folderId;\n\t}", "public function id(): string\n {\n return $this->id;\n }", "public function id(): string\n {\n return $this->id;\n }", "public function id(): string\n {\n return $this->id;\n }", "function setID($path);", "public static function getPath($id) {\n\t\treturn self::$defaultInstance->getPath($id);\n\t}", "public function id()\n {\n return $this->resource->getKey();\n }", "public function getId()\n\t{\n\t\treturn $this->googleDriveFile->getId();\n\t}", "public function getIdentifier()\n {\n return $this->id;\n }", "public function getRouteKey(): string\n {\n if (!empty($this->slug)) {\n return $this->slug;\n }\n return $this->id;\n }", "public function getRouteKey(): string\n {\n if (!empty($this->slug)) {\n return $this->slug;\n }\n return $this->id;\n }", "public static function id(){\n return self::info('id');\n }", "public function id(): string\n {\n return $this->getAttribute('id');\n }", "public function getId(): string\n {\n return $this->id;\n }", "public function getId(): string\n {\n return $this->id;\n }", "public function getId(): string\n {\n return $this->id;\n }", "public function getId(): string\n {\n return $this->id;\n }", "public function getId(): string\n {\n return $this->id;\n }", "public function getId(): string\n {\n return $this->id;\n }", "public function getId(): string\n {\n return $this->id;\n }", "public function getId(): string\n {\n return $this->id;\n }", "public function getId(): string\n {\n return $this->id;\n }", "public function getId(): string\n {\n return $this->id;\n }", "public function getId(): string\n {\n return $this->id;\n }", "public function identifier()\n {\n return $this->id;\n }", "public function getID(): string;", "public function getStepId();", "public function get_id() {\n\n\t\treturn $this->id;\n\t}", "public function get_id() {\n\n\t\treturn $this->id;\n\t}", "function get_id() {\n return $this->get_mapped_property('id');\n }", "public function get_id () {\r\n\t\treturn $this->id;\r\n\t}", "abstract public function get_id();", "public function id()\n {\n return $this->read($this->metadata['pk']->name);\n }", "public function get_id() {\n\t\t\treturn $this->id;\n\t\t}", "public function getid()\n {\n return $this->id;\n }", "public function getid()\n {\n return $this->id;\n }", "static function id()\n\t{\n\t\treturn self::data('id');\n\t}", "public function get_id() {\n\t\treturn $this->id;\n\t}", "public function get_id() {\n\t\treturn $this->id;\n\t}", "public function get_id() {\n\t\treturn $this->id;\n\t}", "public function get_id() {\n\t\treturn $this->id;\n\t}", "public function getId()\n {\n return isset($this->id) ? $this->id : '';\n }", "public function getId()\n {\n return isset($this->id) ? $this->id : '';\n }", "public function get_id() {\r\n\t\treturn ($this->id);\r\n\t}", "public function get_id() {\r\n\t\treturn ($this->id);\r\n\t}", "public function getId() {\n\t\treturn (string) $this->photo['id'];\n\t}", "public function getid() {\n\t\treturn $this->id;\n\t}", "function getStorageFolderPid()\n {\n // global $_GET;\n $positionPid = \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::htmlspecialchars_decode(\\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::_GET('id'));\n // $pid = t3lib_div::_GP('id');\n // print_r($pid);\n if(empty($positionPid)) {\n $siteid = \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::_GET('returnUrl');\n $siteid = \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::explodeUrl2Array($siteid);\n $siteid = $siteid['db_list.php?id'];\n $positionPid = $siteid;\n }\n // print_r($positionPid);\n // Negative PID values is pointing to a page on the same level as the current.\n if ($positionPid<0) {\n $pidRow = \\TYPO3\\CMS\\Backend\\Utility\\BackendUtility::getRecord('pages', abs($positionPid), 'pid');\n $positionPid = $pidRow['pid'];\n }\n $row = \\TYPO3\\CMS\\Backend\\Utility\\BackendUtility::getRecord('pages', $positionPid);\n $TSconfig = \\TYPO3\\CMS\\Backend\\Utility\\BackendUtility::getTCEFORM_TSconfig('pages', $row);\n return intval($TSconfig['_STORAGE_PID']);\n }", "function get_page_id_from_path( $path ) {\n\t$page = get_page_by_path( $path );\n\tif( $page ) {\n\t\treturn $page->ID;\n\t} else {\n\t\treturn null;\n\t};\n}", "function get_page_id_from_path( $path ) {\n\t$page = get_page_by_path( $path );\n\tif( $page ) {\n\t\treturn $page->ID;\n\t} else {\n\t\treturn null;\n\t};\n}", "public function getId() : string\n {\n return $this->id;\n }", "public function getId() : string\n {\n return $this->id;\n }", "public function getId() : string {\n return $this->id;\n }", "protected function getID() {\n return $this->id;\n }", "public function get_id() {\n return $this->id;\n }", "public function get_id() {\n return $this->id;\n }", "public function get_id() {\n return $this->id;\n }", "public function getId() : string\n {\n $rtn = $this->data['id'];\n\n return $rtn;\n }", "protected function _getPath()\n {\n if (!empty($this->_path)) {\n return $this->_path;\n }\n\n $id = $this->_config['id'];\n $dir0 = $id % 10000;\n $dir1 = $dir0 % 100;\n $dir2 = $dir0 - $dir1 * 100;\n if ($dir2 < 0) {\n $dir2 = 0;\n }\n $path = 'apps/';\n\n switch ($this->_config['section']) {\n case 1 :\n $path .= 'scripteditor/' . $dir2 . '/' . $dir1 . '/';\n break;\n \tcase 2 :\n $path .= 'slave/' . $dir2 . '/' . $dir1 . '/';\n break;\n default :\n $path .= 'tmp/';\n break;\n }\n $this->_path = $path;\n return $this->_path;\n }", "public function getId():string {\n return $this->id;\n }", "public function getId()\n {\n return $this->identifier;\n }", "public function get_path(): string\n {\n return $this->path;\n }", "public function getPath(){\n $ext = $this->getExt();\n $filename = $this->id.'.'.$ext;\n return str_replace( $filename, '', $this->filename ); \n }", "public function getRouteId()\n {\n return $this->routeId;\n }", "public function getID() : string;", "public function determineId() {}", "function getFileId() {\n\t\treturn $this->getData('fileId');\n\t}", "public function get_id()\n {\n return $this->id;\n }", "public function get_id()\n {\n return $this->id;\n }", "public function get_id()\n {\n return $this->id;\n }", "public function get_path() {\n\t\treturn $this->path;\n\t}", "public function get_path() {\n\t\treturn $this->path;\n\t}", "final public function getId(){\n\t\tif($this->_id === false){\n\t\t\t$this->_id = $this->getNextId();\n\t\t}\n\t\treturn get_class($this) . \"_\" . $this->_id;\n\t}", "private function GetID()\n\t\t{\n\t\t\treturn $this->id;\n\t\t}", "public function id()\n {\n return $this->id;\n }", "public function id()\n {\n return $this->id;\n }" ]
[ "0.80842286", "0.7258421", "0.72510105", "0.69766724", "0.67906255", "0.6788335", "0.67761177", "0.67111737", "0.6703957", "0.6674791", "0.66741014", "0.6620274", "0.6618237", "0.66124815", "0.65950114", "0.6580198", "0.6580198", "0.65272", "0.65016", "0.64786416", "0.6428973", "0.6428973", "0.6428973", "0.6423731", "0.6423434", "0.64092934", "0.64092934", "0.64092934", "0.639187", "0.63850296", "0.63631964", "0.6359701", "0.63207257", "0.63201404", "0.63201404", "0.63148576", "0.63133514", "0.6307265", "0.6307265", "0.6307265", "0.6307265", "0.6307265", "0.6307265", "0.6307265", "0.6307265", "0.6307265", "0.6307265", "0.6307265", "0.62910795", "0.62786585", "0.62783223", "0.62758875", "0.62758875", "0.62716967", "0.6256853", "0.6250942", "0.6249313", "0.6246615", "0.62328464", "0.62328464", "0.6227159", "0.62264943", "0.62264943", "0.62264943", "0.62264943", "0.62260073", "0.62260073", "0.6223867", "0.6223867", "0.62225425", "0.6220832", "0.62203217", "0.62182117", "0.62182117", "0.62180376", "0.62180376", "0.6216593", "0.62088096", "0.6208542", "0.6208542", "0.6208542", "0.6206999", "0.620622", "0.6201764", "0.61990243", "0.6198842", "0.61942804", "0.6193578", "0.61927307", "0.61900234", "0.6185882", "0.6180259", "0.6180259", "0.6180259", "0.61794525", "0.61794525", "0.61705846", "0.6161021", "0.61553305", "0.61553305" ]
0.85693645
0
Getter for mutipleMatching property. mutipleMatching indicates whether path contains items leading to produce multiple results.
public function isMutipleMatching() { return $this->mutipleMatching; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getMultiple()\n {\n return $this->multiple;\n }", "public function getIsMultiple();", "public function isMultiple() {\n return (bool) $this->_multiple;\n }", "public function getIsMultiple()\n {\n return $this->_isMultiple;\n }", "public function multiple()\n {\n /** @var self $elt */\n $elt = with(clone $this)->attribute('multiple');\n $name = $elt->getAttribute('name');\n\n return $elt->if($name && ! Str::endsWith($name->value(), '[]'), function (self $elt) use ($name) {\n return $elt->name($name->value().'[]');\n })->applyValueToOptions();\n }", "public function getMultiple() {}", "public function treeLevelConditionMatchesMultipleValues() {}", "public function treeLevelConditionMatchesMultipleValues() {}", "public function isAllowMultiple()\n {\n return $this->allowMultiple ? true : false;\n }", "public function getMultiOptions() {\n\t\treturn $this->_multioption;\n\t}", "public static function dataPathMatch() {\n\t\treturn [\n\t\t\t'Exact match: \"/\"' => [\n\t\t\t\t'original' => '/',\n\t\t\t\t'check' => '/',\n\t\t\t\t'matches' => true,\n\t\t\t],\n\t\t\t'Exact match: \"/test\"' => [\n\t\t\t\t'original' => '/test',\n\t\t\t\t'check' => '/test',\n\t\t\t\t'matches' => true,\n\t\t\t],\n\t\t\t'Exact match: \"/test/\" (with trailing slash' => [\n\t\t\t\t'original' => '/test/',\n\t\t\t\t'check' => '/test/',\n\t\t\t\t'matches' => true,\n\t\t\t],\n\n\t\t\t'Partial match: \"/\" vs \"/test\"' => [\n\t\t\t\t'original' => '/',\n\t\t\t\t'check' => '/test',\n\t\t\t\t'matches' => true,\n\t\t\t],\n\t\t\t'Partial match: \"/\" vs \"/test/\" (with trailing slash)' => [\n\t\t\t\t'original' => '/',\n\t\t\t\t'check' => '/test/',\n\t\t\t\t'matches' => true,\n\t\t\t],\n\t\t\t'Partial match: \"/test/\" (with trailing slash) vs \"/test/ing\"' => [\n\t\t\t\t'original' => '/test/',\n\t\t\t\t'check' => '/test/ing',\n\t\t\t\t'matches' => true,\n\t\t\t],\n\t\t\t'Partial match: \"/test\" vs \"/test/\" (without vs with trailing slash)' => [\n\t\t\t\t'original' => '/test',\n\t\t\t\t'check' => '/test/',\n\t\t\t\t'matches' => true,\n\t\t\t],\n\t\t\t'Partial match: \"/test\" vs \"/test/ing\"' => [\n\t\t\t\t'original' => '/test',\n\t\t\t\t'check' => '/test/ing',\n\t\t\t\t'matches' => true,\n\t\t\t],\n\t\t\t'Partial match: \"/test\" vs \"/test/ing/\" (with trailing slash)' => [\n\t\t\t\t'original' => '/test',\n\t\t\t\t'check' => '/test/ing/',\n\t\t\t\t'matches' => true,\n\t\t\t],\n\n\t\t\t'Partial non-match: \"/test\" vs \"/\"' => [\n\t\t\t\t'original' => '/test',\n\t\t\t\t'check' => '/',\n\t\t\t\t'matches' => false,\n\t\t\t],\n\t\t\t'Partial non-match: \"/test\" vs \"/testing\"' => [\n\t\t\t\t'original' => '/test',\n\t\t\t\t'check' => '/testing',\n\t\t\t\t'matches' => false,\n\t\t\t],\n\t\t\t'Partial non-match: \"/test/\" (with trailing slash) vs \"/\"' => [\n\t\t\t\t'original' => '/test/',\n\t\t\t\t'check' => '/',\n\t\t\t\t'matches' => false,\n\t\t\t],\n\t\t];\n\t}", "public function multiple($multiple = true)\n {\n $this->attributes->establish(MultipleAttribute::class)->setValue($multiple);\n return $this;\n }", "public function multiple($multiple = 'multiple') {\r\n\t\t$this->setAttribute('multiple',$multiple);\r\n\t\treturn $this;\r\n\t}", "public function multiple($multiple = true)\n {\n $this->multiple = $multiple;\n\n return $this;\n }", "public function isMultipleMode()\n {\n return ($this->getMode() == 'multiple') ? true : false;\n }", "public function isMultivalue();", "public function setAllowMult($allowMult) {}", "public function multiple(bool $multiple = true): self\n {\n $this->multiple = $multiple;\n\n return $this;\n }", "public function isMultiple($bMultiple = null)\n {\n if (!is_null($bMultiple))\n {\n $this->bMultiple = (boolean)$bMultiple;\n $this->setParam('multiple', ($this->bMultiple ? \"multiple\" : ''));\n $this->setParam('name', ($this->bMultiple ? $this->sName . '[]' : $this->sName));\n }\n\n return $this->bMultiple;\n }", "protected function isMulti()\n\t{\n \treturn isset($this->results[0]);\n\t}", "public function getIsMultiplePhotoAttribute($is_multiple_photo)\n {\n return $is_multiple_photo == 1 ? true : false;\n }", "public function multiple(){\n\t\t$this->lastItem->isArray = true;\n\t\treturn $this;\n\t}", "public function isMultiSelect() {}", "public function getAllowsMultipleAnswers(): bool\n {\n return $this->allowsMultipleAnswers;\n }", "public function multiple(bool $multiple = true): static\n {\n $this->multiple = $multiple;\n\n return $this;\n }", "public static function MultipleGet($params){\n if ($params) {\n $post = $_POST;\n $params_paths = explode('/', $params); //Remove the path seperetor /\n\n foreach ($params_paths as $param_path) { //Loop through the path\n //print_r($config[$path]);\n if (isset($post[$param_path])) { // Check if the path is exist in the GLOBALS config \n $post = $post[$param_path];\n }\n }\n\n return $post;\n }\n return false;\n }", "public function usergroupConditionMatchesMultipleUserGroupId() {}", "public function usergroupConditionMatchesMultipleUserGroupId() {}", "public function isMulti()\n {\n return $this->filter('is_scalar')->length !== $this->length;\n }", "public function getParticipantMultiplicity()\n {\n return $this->getProperty(ParticipantInterface::BPMN_PROPERTY_PARTICIPANT_MULTIPICITY);\n }", "function isMultipleKey(): bool;", "public function setMultiple($values) : bool;", "public function multiple(): bool\n {\n return count($this->queries) > 1;\n }", "public function partOfMultiplePayment() {\n\t\t// not 100% correct: What is all payments are form the same sale... should check how many distinct sales there are. Later.\n\t\tif($account = $this->getAccount()->one()) {\n\t\t\treturn $account->getPayments()->count() > 1;\n\t\t}\n\t\treturn false;\n\t}", "public function setMultiSelect($multiSelect = true) {}", "function test_countRepeats_multiWord_multiMatch()\n {\n $test_Repeat = new RepeatCounter;\n $input1 = 'and';\n $input2 = 'cats and dogs and elephants';\n\n $result = $test_Repeat->countRepeats($input1, $input2);\n\n $this->assertEquals(2, $result);\n }", "public function providerMatchesRolePath(): array\n {\n return [\n 'match' => [\n '/dirA/match.txt',\n [\n '/dirA/*.txt',\n '/dirB/*.txt',\n ],\n true,\n ],\n 'no match' => [\n '/dirA/nomatch.zip',\n [\n '/dirA/*.txt',\n '/dirB/*.txt',\n ],\n false,\n ],\n ];\n }", "public function make_multianswer_question_multiple() {\n question_bank::load_question_definition_classes('multianswer');\n $q = new qtype_multianswer_question();\n test_question_maker::initialise_a_question($q);\n $q->name = 'Multichoice multiple';\n $q->questiontext = 'Please select the fruits {#1} and vegetables {#2}';\n $q->generalfeedback = 'You should know which foods are fruits or vegetables.';\n $q->qtype = question_bank::get_qtype('multianswer');\n\n $q->textfragments = array(\n 'Please select the fruits ',\n ' and vegetables ',\n ''\n );\n $q->places = array('1' => '1', '2' => '2');\n\n // Multiple-choice subquestion.\n question_bank::load_question_definition_classes('multichoice');\n $mc = new qtype_multichoice_multi_question();\n test_question_maker::initialise_a_question($mc);\n $mc->name = 'Multianswer 1';\n $mc->questiontext = '{1:MULTIRESPONSE:=Apple#Good~%-50%Burger~%-50%Hot dog#Not a fruit~%-50%Pizza' .\n '~=Orange#Correct~=Banana}';\n $mc->questiontextformat = FORMAT_HTML;\n $mc->generalfeedback = '';\n $mc->generalfeedbackformat = FORMAT_HTML;\n\n $mc->shuffleanswers = 0;\n $mc->answernumbering = 'none';\n $mc->layout = qtype_multichoice_base::LAYOUT_VERTICAL;\n $mc->single = 0;\n\n $mc->answers = array(\n 16 => new question_answer(16, 'Apple', 0.3333333,\n 'Good', FORMAT_HTML),\n 17 => new question_answer(17, 'Burger', -0.5,\n '', FORMAT_HTML),\n 18 => new question_answer(18, 'Hot dog', -0.5,\n 'Not a fruit', FORMAT_HTML),\n 19 => new question_answer(19, 'Pizza', -0.5,\n '', FORMAT_HTML),\n 20 => new question_answer(20, 'Orange', 0.3333333,\n 'Correct', FORMAT_HTML),\n 21 => new question_answer(21, 'Banana', 0.3333333,\n '', FORMAT_HTML),\n );\n $mc->qtype = question_bank::get_qtype('multichoice');\n $mc->maxmark = 1;\n\n // Multiple-choice subquestion.\n question_bank::load_question_definition_classes('multichoice');\n $mc2 = new qtype_multichoice_multi_question();\n test_question_maker::initialise_a_question($mc2);\n $mc2->name = 'Multichoice 2';\n $mc2->questiontext = '{1:MULTIRESPONSE:=Raddish#Good~%-50%Chocolate~%-50%Biscuit#Not a vegetable~%-50%Cheese' .\n '~=Carrot#Correct}';\n $mc2->questiontextformat = FORMAT_HTML;\n $mc2->generalfeedback = '';\n $mc2->generalfeedbackformat = FORMAT_HTML;\n\n $mc2->shuffleanswers = 0;\n $mc2->answernumbering = 'none';\n $mc2->layout = qtype_multichoice_base::LAYOUT_VERTICAL;\n $mc2->single = 0;\n\n $mc2->answers = array(\n 22 => new question_answer(22, 'Raddish', 0.5,\n 'Good', FORMAT_HTML),\n 23 => new question_answer(23, 'Chocolate', -0.5,\n '', FORMAT_HTML),\n 24 => new question_answer(24, 'Biscuit', -0.5,\n 'Not a vegetable', FORMAT_HTML),\n 25 => new question_answer(25, 'Cheese', -0.5,\n '', FORMAT_HTML),\n 26 => new question_answer(26, 'Carrot', 0.5,\n 'Correct', FORMAT_HTML),\n );\n $mc2->qtype = question_bank::get_qtype('multichoice');\n $mc2->maxmark = 1;\n\n $q->subquestions = array(\n 1 => $mc,\n 2 => $mc2,\n );\n\n return $q;\n }", "public function testSPLIT_PATTERN_VALUEMULTILINELITERAL() {\n\t\t$pattern = \\TYPO3\\TypoScript\\Core\\Parser::SPLIT_PATTERN_VALUEMULTILINELITERAL;\n\t\t$this->assertEquals(preg_match($pattern, \"\\${'col-sm-'+\"), 0, 'This should not match; but it does');\n\t}", "public function multiple($bool = 1) {\n\t\t$this->options['multiple'] = $bool;\n\t\treturn $this;\n\t}", "public function getIsMultipleSelect(){\n return true;\n }", "public function containsOr()\n\t{\n\t\t$args = (new static(func_get_args()))->flattenIt();\n\n\t\t$found = $args->detect(function($value) {\n\t\t\treturn in_array($value, $this->attributes);\n\t\t});\n\n\t\treturn !is_null($found);\n\t}", "public function is_multiselect() {\n return $this->multiselect;\n }", "private function renderMultiples() {\n\n $tpl = \"\";\n foreach ($this->_selectoresOpcion as $id => $selector) {\n $input = $selector->render(TRUE);\n\n $data = [\n 'input' => $input,\n 'label' => $selector->labelOpcion,\n 'type' => $selector->type,\n\n ];\n if ($this->inline) {\n $tpl .= $this->_obtTemplate($this->estructura('MultiplesInline'), $data);\n } else {\n $data['class'] = Estructura::$cssMultiples;\n $tpl .= $this->_obtTemplate($this->estructura('controlMultiple'), $data);\n }\n\n\n }\n\n return $tpl;\n }", "protected function _match()\n {\n // SMART/TNT\n $smart = $this->_smart();\n if( $this->name == 'smart' ) return in_array($this->args, $smart) ? true : false;\n // GLOBE/TM\n $globe = $this->_globe();\n if( $this->name == 'globe' ) return in_array($this->args, $globe) ? true : false;\n // SUN\n $sun = $this->_sun();\n if( $this->name == 'sun' ) return in_array($this->args, $sun) ? true : false;\n }", "public function multiselectItems($data = array(), $values = array())\n\t{\n\t\t\n\t\t$ids = array();\n\t\tif(isset($data['multiple']))\n\t\t{\n\t\t\t$ids = $data['multiple'];\n\t\t}\n\t\t\n\t\tif(!$ids)\n\t\t\treturn false;\n\t\t\n\t\t$results = $this->find('list', array(\n\t\t\t'recursive' => -1,\n\t\t\t'fields' => array('EolResult.id', 'EolResult.notes'),\n\t\t\t'conditions' => array(\n\t\t\t\t'EolResult.id' => $ids,\n\t\t\t),\n\t\t));\n\t\t\n\t\t$notes_info = __(\"\\n\\n---- %s - %s - user_id:%s ----\\n\",\n\t\t\tdate('Y-m-d H:i:s'),\n\t\t\tAuthComponent::user('name'),\n\t\t\tAuthComponent::user('id')\n\t\t);\n\t\t\n\t\t$saveMany_data = array();\n\t\tforeach($results as $result_id => $result_notes)\n\t\t{\t\n\t\t\t$saveMany_data[$result_id] = array('id' => $result_id);\n\t\t\t\n\t\t\tif(isset($values['EolResult']['notes']))\n\t\t\t{\n\t\t\t\tif(trim($values['EolResult']['notes']))\n\t\t\t\t\t$saveMany_data[$result_id]['notes'] = $result_notes. $notes_info. $values['EolResult']['notes'];\n\t\t\t\telse\n\t\t\t\t\tunset($values['EolResult']['notes']);\n\t\t\t}\n\t\t\t\n\t\t\t$saveMany_data[$result_id] = array_merge($values['EolResult'], $saveMany_data[$result_id]);\n\t\t}\n\t\t\n\t\treturn $this->saveMany($saveMany_data);\n\t}", "public function allowMultiple() {\n return false;\n }", "public function isMultiSelection()\n {\n if ($this->getType() == 'checkbox' || $this->getType() == 'multi') {\n return true;\n } else {\n return false;\n }\n }", "public function hasMultiple($key)\n {\n return $this->doHave($key);\n }", "function isOutputMulti_() {\n return $this->__outIsMultiRow;\n }", "function multiple( $value ) {\n\t\t\n\t\t$value = $this->sanitize($value);\n\n\t\tswitch (substr($value, -1)) {\n\t\t\tcase '+':\n\t\t\tcase '*':\n\t\t\t\tbreak;\n\t\t\t\n\t\t\tdefault:\n\t\t\t\t$value += '+';\n\t\t\t\tbreak;\n\t\t}\n\n\t\t$this->add($value);\n\n\t\treturn $this;\n\t}", "public function isPartialMatch()\n {\n return $this->partialMatch;\n }", "function is_multiple($name)\n\t{\n\t\treturn $this->allow_multiple_values && in_array($this->customfields[$name]['type'],array('select','select-account')) &&\n\t\t\t$this->customfields[$name]['rows'] > 1;\n\t}", "public function getMultivaluedAttributes()\n {\n return $this->multivaluedAttributes;\n }", "function is_property_multi_value($entity_type, $name) {\n $controller = entity_toolbox_controller($entity_type);\n $helper = $controller->getPropsHelper();\n\n return $helper->propIsMulti($name);\n}", "public function acceptsMultipleAnswers() {\n\t\treturn ($this->getMultipleAnswer() == 1);\n\t}", "private function _doDirectMatch(array $path) {}", "protected function handlesMultipleValues() {\n return TRUE;\n }", "public function matches()\n {\n return $this->routeObject->match;\n }", "function setMultiple($bool) {\n\t\t$this->multiple = $bool;\n\t}", "public function getAppends()\n {\n\n return $this->multiRef;\n\n }", "public function setMultiple($multiple) {\n $this->multiple = $multiple;\n }", "protected function getRoomOptionsByPattern($room){ \n if(!isset ($this->config['rooms']) && !is_array($this->config['rooms'])){\n return false;\n }\n foreach($this->config['rooms'] as $roomPattern => $roomConfig){\n if(!is_string($roomPattern) || strpos($roomPattern, '%') === false){\n continue;\n }\n $roomPattern = str_replace('%', '', $roomPattern);\n if(strpos($room, $roomPattern) !== false){\n return $roomConfig;\n }\n }\n return false;\n }", "public static function multiple() {\n $params = func_get_args();\n\n // Null if no arguments passed\n if (count($params) == 0) {\n return new qti_variable('multiple', 'identifier');\n } else {\n $result = new qti_variable('multiple', 'identifier', array('value' => array()));\n }\n \n // Allow a single array as well as a parameter list\n if (count($params) == 1 && is_array($params[0])) {\n $params = $params[0];\n }\n \n $allnull = true;\n foreach ($params as $param) {\n if (is_null($param->value)) {\n continue;\n } else {\n $allnull = false;\n $result->type = $param->type;\n if (is_array($param->value)) {\r\n $result->value = array_merge($result->value, $param->value);\n } else {\n $result->value[] = $param->value;\n }\n }\n }\n if ($allnull) {\n $result->value = null;\n }\n \n return $result;\n }", "public function & GetMatchedParams () {\n\t\treturn $this->matchedParams;\n\t}", "public function getPartialMatchingImages()\n {\n return $this->partial_matching_images;\n }", "public function match($path, $partial = false)\n {\n if (!$partial) {\n $path = trim(urldecode($path), self::URI_DELIMITER);\n $regex = '#^' . $this->_regex . '$#';\n } else {\n $regex = '#^' . $this->_regex . '#';\n }\n\n $res = preg_match($regex, $path, $values);\n\n if ($res === 0) {\n return false;\n }\n\n if ($partial) {\n $this->setMatchedPath($values[0]);\n }\n\n // array_filter_key()? Why isn't this in a standard PHP function set yet? :)\n foreach ($values as $i => $value) {\n if (!is_int($i) || $i === 0) {\n unset($values[$i]);\n }\n }\n\n $this->_values = $values;\n\n $values = $this->_getMappedValues($values);\n $defaults = $this->_getMappedValues($this->_defaults, false, true);\n $return = $values + $defaults;\n\n return $return;\n }", "public function getMatchList()\n {\n return $this->match_list;\n }", "public function multi($bool = true)\n {\n $this->multiMode = (bool)$bool;\n\n return $this;\n }", "protected function _getMatch()\n {\n // match is already set, return that\n if ($this->_match !== null) {\n return $this->_match;\n }\n\n // get the base url\n $base_uri = $this->_request->getBaseUri();\n\n // optimization for the homepage so we don't have to hit the routes\n if ($base_uri === '/' && !$this->_subdomain) {\n $this->_match = array('main', 'index');\n return $this->_match;\n }\n\n $routes = $this->getRoutes();\n\n // direct match optimization\n if (isset($routes[$base_uri])) {\n $this->_setMatch($routes[$base_uri]);\n return $this->_match;\n }\n\n // get all of the keys in the routes file\n $route_keys = array_keys($routes);\n $len = count($route_keys);\n\n // explode the base uri for comparisons\n $base_bits = explode('/', $base_uri);\n\n // loop through all of the routes and check for a match\n $match = false;\n for ($i = 0; $i < $len; ++$i) {\n if ($this->_matches(explode('/', $route_keys[$i]), $base_bits)) {\n $match = true;\n\n // stop after the first match!\n break;\n }\n }\n\n if ($match) {\n $this->_setMatch($routes[$route_keys[$i]]);\n return $this->_match;\n }\n\n $this->_setMatch(null);\n return $this->_match;\n }", "public function instance_allow_multiple() {\n return false;\n }", "public function instance_allow_multiple() {\n return false;\n }", "public function instance_allow_multiple() {\n return false;\n }", "public function instance_allow_multiple() {\n return false;\n }", "public function instance_allow_multiple() {\n return false;\n }", "public function isPriorityMultipleAssignmentMethod()\n {\n return ($this->getMultipleAssignmentMethodCode() == 'priority') ? true : false;\n }", "public function setParticipantMultiplicity(array $array)\n {\n return $this->setProperty(ParticipantInterface::BPMN_PROPERTY_PARTICIPANT_MULTIPICITY, $array);\n }", "function getItemsMultiprop( $field_props=array('image'=>array('originalname', 'existingname')), $value_props=array('image'=>array('filename', 'filename')) , $file_ids=array(), $count_items=false, $ignored=false )\n\t{\n\t\t$app = JFactory::getApplication();\n\t\t$user = JFactory::getUser();\n\t\t$jinput = $app->input;\n\t\t$option = $jinput->get('option', '', 'cmd');\n\n\t\t$filter_uploader = $this->getState('filter_uploader');\n\n\t\t$where = array();\n\n\t\t$file_ids_list = '';\n\n\t\tif (count($file_ids))\n\t\t{\n\t\t\t$file_ids_list = ' AND a.id IN (' . implode(',', ArrayHelper::toInteger($file_ids)) . ')';\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$permission = FlexicontentHelperPerm::getPerm();\n\t\t\t$CanViewAllFiles = $permission->CanViewAllFiles;\n\n\t\t\tif (!$CanViewAllFiles)\n\t\t\t{\n\t\t\t\t$where[] = ' a.uploaded_by = ' . (int) $user->id;\n\t\t\t}\n\t\t\telseif ($filter_uploader)\n\t\t\t{\n\t\t\t\t$where[] = ' a.uploaded_by = ' . (int) $filter_uploader;\n\t\t\t}\n\t\t}\n\n\t\tif (!empty($ignored))\n\t\t{\n\t\t\t$where[] = ' i.id NOT IN (' . implode(',', ArrayHelper::toInteger($ignored)) . ')';\n\t\t}\n\n\t\t$where = count($where)\n\t\t\t? ' WHERE ' . implode(' AND ', $where)\n\t\t\t: '';\n\n\t\t// Group by since file maybe used in more than one fields or ? in more than one values for same field\n\t\t$groupby = !$count_items ? ' GROUP BY i.id' : ' GROUP BY a.id';\n\t\t$orderby = !$count_items ? ' ORDER BY i.title ASC' : '';\n\n\t\t// Serialized values are like : \"__field_propname__\";s:33:\"__value__\"\n\t\t$format_str = 'CONCAT(\"%%\",\"\\\"%s\\\";s:%%:%%\\\"\",%s,\"\\\"%%\")';\n\t\t$items = array();\n\t\t$files = array();\n\n\t\tforeach ($field_props as $field_type => $field_prop_arr)\n\t\t{\n\t\t\tif (!is_array($field_prop_arr))\n\t\t\t{\n\t\t\t\t$field_prop_arr = array($field_prop_arr);\n\t\t\t}\n\n\t\t\tif (!is_array($value_props[$field_type]))\n\t\t\t{\n\t\t\t\t$value_props[$field_type] = array($value_props[$field_type]);\n\t\t\t}\n\n\t\t\tforeach($field_prop_arr as $i => $field_prop)\n\t\t\t{\n\t\t\t\t// Some fields may not be using DB, create a limitation for them\n\t\t\t\t$field_ids = $this->getFieldsUsingDBmode($field_type);\n\t\t\t\t$field_ids_list = !$field_ids ? \"\" : \" AND fi.id IN ('\". implode(\"','\", $field_ids) .\"')\";\n\n\t\t\t\t// Create a matching condition for the value depending on given configuration (property name of the field, and value property of file: either id or filename or ...)\n\t\t\t\t$value_prop = $value_props[$field_type][$i];\n\t\t\t\t$like_str = $this->_db->escape( 'a.'.$value_prop, false );\n\t\t\t\t$like_str = sprintf( $format_str, $field_prop, $like_str );\n\n\t\t\t\t// File field relation sub query\n\t\t\t\t$query = 'SELECT '. ($count_items ? 'a.id as file_id, COUNT(i.id) as item_count' : 'i.id as id, i.title')\n\t\t\t\t\t. ' FROM #__content AS i'\n\t\t\t\t\t. ' JOIN #__flexicontent_fields_item_relations AS rel ON rel.item_id = i.id'\n\t\t\t\t\t. ' JOIN #__flexicontent_fields AS fi ON fi.id = rel.field_id AND fi.field_type IN ('. $this->_db->Quote( $field_type ) .')' . $field_ids_list\n\t\t\t\t\t. ' JOIN #__flexicontent_files AS a ON rel.value LIKE ' . $like_str . ' AND a.'.$value_prop.'<>\"\"' . $file_ids_list\n\t\t\t\t\t//. ' JOIN #__users AS ua ON ua.id = a.uploaded_by'\n\t\t\t\t\t. $where\n\t\t\t\t\t. $groupby\n\t\t\t\t\t. $orderby\n\t\t\t\t\t;\n\t\t\t\t//echo nl2br( \"\\n\".$query.\"\\n\");\n\t\t\t\t$this->_db->setQuery( $query );\n\t\t\t\t$_item_data = $this->_db->loadObjectList($count_items ? 'file_id' : 'id');\n\n\t\t\t\tif ($_item_data) foreach ($_item_data as $item)\n\t\t\t\t{\n\t\t\t\t\tif ($count_items) {\n\t\t\t\t\t\t$items[$item->file_id] = ((int) @ $items[$item->file_id]) + $item->item_count;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$items[$item->title] = $item;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t//echo \"<pre>\"; print_r($_item_data); exit;\n\t\t\t}\n\t\t}\n\n\t\t//echo \"<pre>\"; print_r($items); exit;\n\t\treturn $items;\n\t}", "public function testMultipleSetAndGet()\n {\n $data = array(array(\"title\" => \"A\",\n \"url\" => \"/a\"),\n array(\"title\" => \"B\",\n \"url\" => \"/a/b\"),\n array(\"title\" => \"C\",\n \"url\" => \"/a/b/c\")\n );\n \n $bc = new \\Loom\\Breadcrumbs();\n $this->assertEmpty($bc->get());\n\n $bc->set($data);\n $this->assertCount(3, $bc->get());\n }", "public function multiple(array $params = [])\n {\n return $this->parseQueryString($this->getModel()->query(), $params)->get();\n }", "public function getMultipleValueSeparator()\n {\n if (!empty($this->_parameters[Import::FIELD_FIELD_MULTIPLE_VALUE_SEPARATOR])) {\n return $this->_parameters[Import::FIELD_FIELD_MULTIPLE_VALUE_SEPARATOR];\n }\n return Import::DEFAULT_GLOBAL_MULTI_VALUE_SEPARATOR;\n }", "public function isNotMulti()\n {\n return ! $this->isMulti();\n }", "public function haveMultiple($model, $times, $attributes = null, $name = null) {\n return $this->getScenario()->runStep(new \\Codeception\\Step\\Action('haveMultiple', func_get_args()));\n }", "private function getMultiLineSeparatorForRegexp()\n {\n if (!$this->multiLineSeparatorForRegexp) {\n $this->multiLineSeparatorForRegexp = in_array(self::PSEUDO_MULTI_LINE_SEPARATOR, str_split('[\\^$.|?*+(){}'))\n ? '\\\\' . self::PSEUDO_MULTI_LINE_SEPARATOR\n : self::PSEUDO_MULTI_LINE_SEPARATOR;\n }\n return $this->multiLineSeparatorForRegexp;\n }", "public function match($path, $partial = false)\n {\n if ($this->_isTranslated) {\n $translateMessages = $this->getTranslator()->getMessages();\n }\n\n $pathStaticCount = 0;\n $values = array();\n $matchedPath = '';\n\n if (!$partial) {\n $path = trim($path, $this->_urlDelimiter);\n }\n\n if ($path !== '') {\n $path = explode($this->_urlDelimiter, $path);\n\n foreach ($path as $pos => $pathPart) {\n // Path is longer than a route, it's not a match\n if (!array_key_exists($pos, $this->_parts)) {\n if ($partial) {\n break;\n } else {\n return false;\n }\n }\n\n $matchedPath .= $pathPart . $this->_urlDelimiter;\n\n // If it's a wildcard, get the rest of URL as wildcard data and stop matching\n if ($this->_parts[$pos] == '*') {\n $count = count($path);\n for($i = $pos; $i < $count; $i+=2) {\n $var = urldecode($path[$i]);\n if (!isset($this->_wildcardData[$var]) && !isset($this->_defaults[$var]) && !isset($values[$var])) {\n $this->_wildcardData[$var] = (isset($path[$i+1])) ? urldecode($path[$i+1]) : null;\n }\n }\n\n $matchedPath = implode($this->_urlDelimiter, $path);\n break;\n }\n\n $name = isset($this->_variables[$pos]) ? $this->_variables[$pos] : null;\n $pathPart = urldecode($pathPart);\n\n // Translate value if required\n $part = $this->_parts[$pos];\n if ($this->_isTranslated && (mb_substr($part, 0, 1, 'UTF-8') === '@' && mb_substr($part, 1, 1, 'UTF-8') !== '@' && $name === null) || $name !== null && in_array($name, $this->_translatable)) {\n if (mb_substr($part, 0, 1, 'UTF-8') === '@') {\n $part = mb_substr($part, 1, null, 'UTF-8');\n }\n\n if (($originalPathPart = array_search($pathPart, $translateMessages)) !== false) {\n $pathPart = $originalPathPart;\n }\n }\n\n if (mb_substr($part, 0, 2, 'UTF-8') === '@@') {\n $part = mb_substr($part, 1, null, 'UTF-8');\n }\n\n // If it's a static part, match directly\n if ($name === null && $part != $pathPart) {\n return false;\n }\n\n // If it's a variable with requirement, match a regex. If not - everything matches\n if ($part !== null && !preg_match($this->_regexDelimiter . '^' . $part . '$' . $this->_regexDelimiter . 'iu', $pathPart)) {\n return false;\n }\n\n // If it's a variable store it's value for later\n if ($name !== null) {\n $values[$name] = $pathPart;\n } else {\n $pathStaticCount++;\n }\n }\n }\n\n // Check if all static mappings have been matched\n if ($this->_staticCount != $pathStaticCount) {\n return false;\n }\n\n $return = $values + $this->_wildcardData + $this->_defaults;\n\n // Check if all map variables have been initialized\n foreach ($this->_variables as $var) {\n if (!array_key_exists($var, $return)) {\n return false;\n } elseif ($return[$var] == '' || $return[$var] === null) {\n // Empty variable? Replace with the default value.\n $return[$var] = $this->_defaults[$var];\n }\n }\n\n $this->setMatchedPath(rtrim($matchedPath, $this->_urlDelimiter));\n\n $this->_values = $values;\n\n return $return;\n\n }", "function test_countRepeats_multiWord_noMultiMatch()\n {\n $test_Repeat = new RepeatCounter;\n $input1 = 'and';\n $input2 = 'cats or dogs or elephants';\n\n $result = $test_Repeat->countRepeats($input1, $input2);\n\n $this->assertEquals(0, $result);\n }", "public static function getMutatables()\n {\n return [];\n }", "public function getPatterns()\n {\n return $this->patterns;\n }", "public function getPatterns()\n {\n return $this->patterns;\n }", "public function hasMutualFriends(): bool\n {\n return $this->mutualFriendCount() > 0;\n }", "public function hasMutualFriends(): bool\n {\n return $this->mutualFriendCount() > 0;\n }", "public function getMultiple(array $filepaths);", "public function setParticipantMultiplicity(\\Bpmn\\Model\\ParticipantMultiplicity $participantMultiplicity)\n {\n $this->participantMultiplicity = $participantMultiplicity;\n return $this;\n }", "public static function getMemberInSet () {\n\t\treturn \"'\" . implode(\"','\",self::$member_array) . \"'\";\n\t}", "public function setIsMultiplePhotoAttribute($is_multiple_photo)\n {\n $this->attributes['is_multiple_photo'] = $is_multiple_photo == 1 || $is_multiple_photo === 'true' || $is_multiple_photo === true ? true : false;\n }", "public function PIDupinRootlineConditionMatchesMultiplePageIdsInRootline() {}", "public function getAllPossiblePairMatches()\n {\n\n $opp_side = ($this->side == 'Left') ? 'Right' : 'Left';\n return SkeletalElement::where('sb_id', $this->sb_id)->where('side', $opp_side)->get();\n }", "public function PIDupinRootlineConditionMatchesMultiplePageIdsInRootline() {}", "public function testRouteMatchesAndMultipleParamsExtracted()\n {\n $resource = '/hello/Josh/and/John';\n $route = new \\Slim\\Route('/hello/:first/and/:second', function () {});\n $result = $route->matches($resource);\n $this->assertTrue($result);\n $this->assertEquals(array('first' => 'Josh', 'second' => 'John'), $route->getParams());\n }", "public function setParallelMultiple($parallelMultiple)\n {\n $this->parallelMultiple = $parallelMultiple;\n return $this;\n }" ]
[ "0.59893477", "0.5616541", "0.5524921", "0.54527247", "0.5412447", "0.51424927", "0.50644183", "0.50641847", "0.5037784", "0.49973792", "0.4952482", "0.48710933", "0.48463872", "0.47122332", "0.46932825", "0.4688786", "0.4684103", "0.46818247", "0.46420565", "0.46381837", "0.46355376", "0.46188322", "0.45846307", "0.4580203", "0.45555946", "0.45199344", "0.45131823", "0.45124492", "0.44678262", "0.4460916", "0.4436148", "0.44216186", "0.44136834", "0.43976027", "0.43827796", "0.43802086", "0.43564168", "0.4340829", "0.43385875", "0.43315646", "0.43222293", "0.4316637", "0.42947823", "0.42853832", "0.42378438", "0.42367125", "0.42150584", "0.42033726", "0.42018497", "0.41946197", "0.41772828", "0.4176622", "0.4175226", "0.41739252", "0.4173833", "0.41686237", "0.4164425", "0.41489848", "0.41407934", "0.41368458", "0.4136013", "0.41238818", "0.41235077", "0.4099545", "0.40985256", "0.4086947", "0.4068203", "0.40613776", "0.40543902", "0.4051181", "0.4040772", "0.4040772", "0.4040772", "0.4040772", "0.4040772", "0.40385038", "0.4033049", "0.40238234", "0.4018204", "0.4015722", "0.3985286", "0.39616242", "0.39584434", "0.39564204", "0.39450422", "0.39316875", "0.392982", "0.39294678", "0.39294678", "0.3921455", "0.3921455", "0.39190155", "0.39180565", "0.39171904", "0.39169452", "0.39162567", "0.39156806", "0.3915611", "0.39141414", "0.39103606" ]
0.7328771
0
Parse the path id part of a path. In some case, path can have path id part. The path id part is located on start of the path : "thePathId:the/rest/of/my/path"
private function parsePathId($path) { $matches = []; $regex = '/^' . '(' . Path::REGEX_PATH_INTERNAL_ID_CHAR . '?' . Path::REGEX_PATH_ID_NAME . Path::REGEX_PATH_ID_SEPARATOR . ')(.*)$/'; $match_result = preg_match($regex, $path, $matches); if ($match_result) { $this->pathId = substr($matches[1], 0, -1); $path = $matches[2]; } return $path; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function pathId($path);", "public static function parseID($id){ }", "public static function parseId($id){\n return $id;\n }", "function parse_id($id) {\n\n }", "public static function getIdFromString($str)\n {\n $location = explode('/', $str);\n\n return $location[count($location) - 1];\n }", "public function buildPageIdFromPathAndTitle($path) {\n\t\t// MiondTouch uses double slashes to escape slashes in page titles.\n\t\t$double_slash_pos = strrpos($path, '//');\n\t\tif ($double_slash_pos !== false) {\n\t\t\t// A double-slash was found. Find the slash before it.\n\t\t\t$path_title_start = substr($path, 0, $double_slash_pos);\n\t\t\t$title_end = substr($path, $double_slash_pos + 1);\n\n\t\t\t// Break apart the path according to the slash.\n\t\t\t$path = explode('/', $path_title_start);\n\n\t\t\t// The title will be the last element of the array.\n\t\t\t$title_start = array_pop($path);\n\t\t\t$title = $title_start . $title_end;\n\t\t} else {\n\t\t\t// Break apart the path according to the slash.\n\t\t\t$path = explode('/', $path);\n\n\t\t\t// The title will be the last element of the array.\n\t\t\t$title = array_pop($path);\n\t\t}\n\n\t\t// Combine the path.\n\t\t$path = implode('/', $path);\n\n\t\t// Build the ID and return.\n\t\treturn $this->buildPageId($title, $path);\n\t}", "public function pId()\n {\n static $id = null;\n\n if (!is_null($id)) {\n return $id;\n }\n\n $id = $this->property('id');\n\n if (strpos($id, 'http') === 0) {\n $path = explode('/', parse_url($id, PHP_URL_PATH));\n\n if ($path[1] == 'gallery') {\n $id = $path[2];\n }\n elseif ($path[1] == 'a') {\n $id = 'a/'.$path[2];\n }\n else {\n $id = $path[1];\n }\n }\n\n return $id;\n }", "public function getPathId()\n {\n return $this->pathId;\n }", "protected function parse_id() {\n\n\t\tif ( ! empty( $this->args['id'] ) ) {\n\t\t\t$this->args['id__in'] = array( $this->args['id'] );\n\t\t}\n\n\t\treturn $this->parse_in_or_not_in_query( 'id', $this->args['id__in'], $this->args['id__not_in'] );\n\t}", "function setID($path);", "public function getIdsFromPath(string $path) // TODO: add return type\r\n {\r\n if (strlen($path) == 0)\r\n return false;\r\n\r\n // strip off leading slash\r\n if ($path[0] == '/')\r\n $path = substr($path, 1);\r\n\r\n $parts = explode('/', $path);\r\n if (count($parts) < 1)\r\n return false;\r\n\r\n $objs = $this->list('/'.$parts[0]);\r\n if (count($objs) < 1)\r\n return false;\r\n\r\n foreach ($objs as $obj)\r\n {\r\n if (count($parts) < 2 || $parts[1]=='' || 0 == strcasecmp($parts[1], $obj['name']))\r\n {\r\n return array('spreadsheet_id' => $obj['spreadsheet_id'],\r\n 'worksheet_id' => $obj['worksheet_id'],\r\n 'worksheet_title' => $obj['name']);\r\n }\r\n }\r\n\r\n return false;\r\n }", "function getPathParser();", "protected function parsePath() {\n\t}", "public static function getPath($id);", "public function getPath($id);", "public function retornaCaminhoDoDiretorioPeloId($id) {\n\t\treturn (string) implode(DIRECTORY_SEPARATOR, str_split($id));\n\t}", "protected function _evalPath($id = 0){\n\t\t$db = new DB_WE();\n\t\t$path = '';\n\t\tif($id == 0){\n\t\t\t$id = $this->ParentID;\n\t\t\t$path = $this->Text;\n\t\t}\n\n\t\t$result = getHash('SELECT Text,ParentID FROM ' . $this->_table . ' WHERE ' . $this->_primaryKey . '=' . intval($id), $db);\n\t\t$path = '/' . (isset($result['Text']) ? $result['Text'] : '') . $path;\n\t\t$pid = isset($result['ParentID']) ? intval($result['ParentID']) : 0;\n\t\twhile($pid > 0){\n\t\t\t$result = getHash('SELECT Text,ParentID FROM ' . $this->_table . ' WHERE ' . $this->_primaryKey . '=' . $pid, $db);\n\t\t\t$path = '/' . $result['Text'] . $path;\n\t\t\t$pid = intval($result['ParentID']);\n\t\t}\n\t\treturn $path;\n\t}", "private static function parseId($string) {\n\t\t$string = preg_replace('/[^a-zA-Z0-9]/', '-', $string);\n\t\t$string = strtolower(trim($string, '-'));\n\n\t\tif (self::$model) {\n\t\t\t$string = 'sq-form-'.self::$mark.'-'.$string;\n\t\t}\n\n\t\treturn $string;\n\t}", "private function parsePath() {\n\n $parsed = array();\n $request_path = strtok($this->uri, '?');\n $base_path_len = strlen(rtrim(dirname($this->script_name), '\\/'));\n\n // Unescape and strip $base_path prefix, leaving q without a leading slash.\n $path = substr(urldecode($request_path), $base_path_len + 1);\n \n //make it clean\n $parsed = filter_var_array(explode('/', trim($path, '/')), FILTER_SANITIZE_STRING);\n\n $this->parsed_path = $parsed; \n\n }", "function get_id_from_link($link)\n\t{\n\t\t$link_bits = explode('/', $link);\n\t\treturn $link_bits[(count($link_bits)-1)];\n\t}", "public function getElementArbitragePath()\n\t{\n\t\treturn preg_replace('/^[^\\.]+\\.(.*)$/', '$1', $this->_id);\n\t}", "public function getPath($path, $entity_id);", "public function findPath($id)\n {\n $entry = $this->find($id, ['path']);\n return $entry ? $entry->getRawOriginal('path') : '';\n }", "function get_page_id_from_path( $path ) {\n\t$page = get_page_by_path( $path );\n\tif( $page ) {\n\t\treturn $page->ID;\n\t} else {\n\t\treturn null;\n\t};\n}", "function get_page_id_from_path( $path ) {\n\t$page = get_page_by_path( $path );\n\tif( $page ) {\n\t\treturn $page->ID;\n\t} else {\n\t\treturn null;\n\t};\n}", "function getParamFromPath($path, $variableName, $default=\"\", $remainingData=false) {\r\n\tif ($remainingData==true) {\r\n\t\t// return \"/cid/xxx/seg/v1/i.mp4\" -> \"v1/i.mp4\"\r\n\t\t$position = strpos($path, \"/\".$variableName.\"/\", 0);\t\t\r\n\t\tif ($position===false) return $default;\r\n\t\treturn substr($path, $position+strlen($variableName)+2);\r\n\t} else {\r\n\t\t$urlParts = explode('/', preg_replace('/\\?.+/', '', $path));\r\n\t\t$position = array_search($variableName, $urlParts);\r\n\t\tif($position !== false && array_key_exists($position+1, $urlParts))\r\n\t\t\treturn $urlParts[$position+1];\r\n\t\treturn $default;\r\n\t}\r\n}", "private function parseIdFromTweetUrl($tweetUrl)\n {\n $path = parse_url($tweetUrl)['path']; \n return explode('/', $path)[3];\n }", "public function testParse_request_url__single_domain_w_id() {\n\t$result = $this->object->parse_request_url('/domain1/42');\n $this->assertTrue($result==array(0 => array(\n\t\t'name' => 'domain1',\n\t\t'id' => '42',\n\t\t'ext' => null\n\t )),\n\t '$result did not match:'.print_r($result,1)\n\t);\n }", "protected function scanId()\n {\n return $this->scanInput('/^#([\\w-]+)/', 'id');\n }", "protected static function massageMediaId($mediaId)\n {\n $comps = explode('/', $mediaId);\n return end($comps);\n }", "function getRecordId($str){\n\t\t$arr = explode(\"_\",$str);\n\t\t$recId = $arr[count($arr)-1];\n\t\treturn $recId;\n\t}", "function fs_get_page_id_from_path( $path ) {\r\n\t$page = get_page_by_path( $path );\r\n\tif ( $page ) {\r\n\t\treturn $page->ID;\r\n\t} else {\r\n\t\treturn null;\r\n\t};\r\n}", "private function getIdFromRedirectedUrl(): string\n {\n $url = $this->getResponse()\n ->getHeader('Location')\n ->getFieldValue();\n $pattern = '!/id/(.*?)/!';\n $result = preg_match($pattern, $url, $matches);\n\n return $result ? $matches[1] : '';\n }", "function lrl_extract_pid($rel_str) {\n $part = explode('(', trim($rel_str));\n if (count($part) > 1) {\n return substr($part[1], 0, -1);\n }\n else {\n return NULL;\n }\n}", "function tep_parse_section_path($sPath) {\r\n// make sure the section IDs are integers\r\n $sPath_array = array_map('tep_string_to_int', explode('_', $sPath));\r\n\r\n// make sure no duplicate section IDs exist which could lock the server in a loop\r\n $tmp_array = array();\r\n $n = sizeof($sPath_array);\r\n for ($i=0; $i<$n; $i++) {\r\n if (!in_array($sPath_array[$i], $tmp_array)) {\r\n $tmp_array[] = $sPath_array[$i];\r\n }\r\n }\r\n\r\n return $tmp_array;\r\n }", "public function getServerIdFromPath($path)\n {\n return Crypt::encryptString($path);\n }", "public static function path(string ...$_ids): string\n {\n return \\implode(self::PATH_DELIMITER, $_ids);\n }", "private function getNodePath($id, $path = false, $part = false){\n $query = \"\n SELECT\n `structure`.`pid`,\n `structure_data`.`part`\n FROM\n `structure`,\n `structure_data`\n WHERE\n `structure`.`id` = '\".$id.\"' &&\n `structure`.`id` = `structure_data`.`id`\n \";\n $result = mysql_fetch_assoc(mysql_query($query));\n\n\n if($result['pid'] > 1){\n $path .= $this->getNodePath($result['pid'], $path);\n }else{\n $path .= '/';\n };\n\n if($part){\n $path .= $part.'/';\n }else{\n $path .= $result['part'].'/';\n };\n\n return Utilities::removePathDoubleSlashes($path);\n }", "public function path(/* array */$id) {\n $key = strrev(sprintf('%04d', $id));\n $k1 = substr($key, 0, 2);\n $k2 = substr($key, 2, 2);\n return sprintf('%s/%02d/%02d/%d.torrent', self::STORAGE, $k1, $k2, $id);\n }", "public function parse($id){ }", "function split2($path) {\n\t// Album is everything after\n\treturn preg_split(\"/\\/+/\", $path, 2);\n}", "protected function GetId() {\n\n $Id= $this->GetOption('Id');\n if (!$Id) {\n $Id= $this->GetName(); // let id be same as name\n $Id= str_replace(array('[',']'),'_', $Id); // id cannot contain '[' and ']'\n $Id= trim($Id, '_'); // id cannot start with '_'\n }\n return $Id;\n }", "function get_path($url) {\n preg_match('/^([^?]+)(\\?path.*?)?(&content.*)?$/', $url, $matches);\n if (isset($matches[2])) {\n\t\tparse_str(substr($matches[2], 1), $path);\n\t\t$parse_path = preg_split(\"/[-]+/\", $path['path']);\n\t} else {\n\t\t$parse_path[0] = '';\n\t\t$parse_path[1] = '';\n\t\t$parse_path[2] = '';\n\t\t$parse_path[3] = '';\n\t}\n return $parse_path;\n}", "function pathToString($id, $separator = ' > ') {\n\t\tif ($path = $this->getPath($id)) {\n\t\t\t$path = Set::extract('/Category/name', $path);\n\t\t\tunset($path[0]);\n\t\t\tif (!empty($path)) {\n\t\t\t\t$path = implode($separator, $path);\n\t\t\t\treturn $path;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "function is_id($str)\n{\n $regex = \"/([a-f0-9]{8}\\-[a-f0-9]{4}\\-4[a-f0-9]{3}\\-[8|9|a|b][a-f0-9]{3}\\-[a-f0-9]{12})/\";\n\n return preg_match($regex, $str) === 1;\n}", "public function parse_path($uri) {\n\n\t\t/**\n\t\t * Strip away the GET string from the URI if it's around.\n\t\t * @todo Do something with the GET string here eventually, or completely deprecate it.\n\t\t */\n\t\tlist($path, $get) = explode('?', $uri);\n\n\t\t/**\n\t\t * trim the path to make sure there's not a hanging empty array item after exploding...\n\t\t * however the path string is expected to always start with / so we add it back\n\t\t */\n\t\t$path = explode(\"/\", '/'.trim($path,'/'));\n\n\t\t/**\n\t\t * Because the string starts with a \"/\", array[0] is empty. This is important because\n\t\t * we actually want array 1 to be the first var\n\t\t * @todo I think it would be better to have a proper array here and +1 to the pointer later\n\t\t */\n\t\tunset($path[0]);\t\t\n\n\t\t/**\n\t\t * Return the parsed array of segments.\n\t\t */\n\t\treturn $path;\n\t}", "function urlSegment($int=''){\n $input = get('url');\n $input = explode('/', $input);\n $int--;\n return $input[$int];\n }", "private function extractName($path)\n {\n $segments = explode('/', $path);\n\n return array_pop($segments);\n }", "function cmp_dataid2path($dataid)\n{\n return PLX_ROOT.'data/zb/'.substr($dataid,0,2).'/'.substr($dataid,2,2).'/';\n}", "function cmp_dataid2discussionpath($dataid)\n{\n return cmp_dataid2path($dataid).$dataid.'.discussion/';\n}", "protected function parseUrl($path)\n {\n return parse_url($path);\n }", "public function getUserRoutePathId()\n {\n return $this->userRoutePathId;\n }", "public static function parser (string $path): string\n {\n return self::getDomainUrl() . '/' . $path;\n }", "public function filterRoute($path){\n $exploded_path = explode('/', $path);\n foreach($exploded_path as $key => $path_element){\n if(is_numeric($path_element)){\n $exploded_path[$key] = '%';\n $this->actionParameter = (int)$path_element;\n }\n }\n return implode('/', $exploded_path);\n }", "public function fieldID($field) {\n\t\tif (strstr($field, \".\")) {\n\t\t\t// use the path to get to the data poing\n\t\t\t$fieldParts = explode(\".\", $field);\n\t\t\t$key = array_pop($fieldParts);\n\t\t\t\n\t\t\t// add the field parts to the entityPath to get the correct model\n\t\t\t$this->_setEntityPath($fieldParts);\n\t\t} else {\n\t\t\t$key = $field;\n\t\t\t$fieldParts = array();\n\t\t}\n\t\t\n\t\t$fieldId = $this->currentPathID().Inflector::camelize($field);\n\t\t\n\t\t$this->_revertEntityPath(count($fieldParts));\n\t\t\n\t\treturn $fieldId;\n\t}", "protected function _normalizePath($path) { \n $p= preg_replace('#//#', '/', $path);\n $p= preg_replace('#/\\./#', '/', $p);\n $p= preg_replace('#[^/]+/\\.\\./#', '', $p);\n $p= preg_replace('#//#', '/', $p);\n $p= preg_replace('#/$#', '', $p);\n return $p;\n }", "public function _parsePath ($path)\n {\n if ( !is_string ($path) || !$path )\n {\n throw new InvalidArgumentException ();\n }\n \n $dot = '.'; \n \n $result = array_filter (explode ($dot, $path), function ($element)\n {\n return ((boolean) $element) && ('.' != $element);\n });\n \n // updating indexes...\n $result = array_values ($result);\n \n if (0 == count ($result))\n {\n throw new InvalidArgumentException ();\n }\n \n return $result;\n }", "public\n function delimiter($data)\n {\n if ($data) {\n $idsOfTimeSlot = explode(\"/\", $data, -1);\n return $idsOfTimeSlot;\n }\n\n }", "public static function getPath($id) {\n\t\treturn self::$defaultInstance->getPath($id);\n\t}", "function text_to_id($text, $prepend = null, $delimiter = '-')\n{\n $text = strtolower($text);\n $id = preg_replace('/\\s/', $delimiter, $text);\n $id = preg_replace('/[^\\w\\-]/', '', $id);\n $id = trim($id, $delimiter);\n $prepend = (string) $prepend;\n return !empty($prepend) ? join($delimiter, array($prepend, $id)) : $id;\n}", "public function getIdentifier()\n {\n if ($this->identifierType === self::URL_REWRITE)\n {\n return $this->request->path();\n }\n return $this->request->get();\n }", "function LastValidArticle($path, $id)\n\t{\n\t\t$new_id = (int)$id;\n\t\tif ($new_id == 0){\n\t\t\treturn $new_id;\n\t\t}else if (file_exists($path . $new_id) == FALSE){\n\t\t\treturn LastValidArticle($path, $new_id - 1);\n\t\t}else{\n\t\t\treturn $new_id;\n\t\t}\n\t}", "function getItemsIdByRawString($string){\n\t$tmps = explode('|', $string);\n\t\n\t$result = array();\n\t\n\tforeach($tmps as $tmp){\n\t\t$id = substr($tmp, 1);\n\t\t$result[count($result)] = $id;\n\t}\n\t\n\treturn $result;\n}", "protected function getIdFromValue(string $value)\n {\n try {\n //if ($item = $this->iriConverter->getItemFromIri($value)) {\n //return $this->propertyAccessor->getValue($item, 'id');\n //}\n } catch (InvalidArgumentException $e) {\n // Do nothing, return the raw value\n }\n\n return $value;\n }", "function pick_one_string($str, $delimiter = \"/\")\n{\n\t$parts = preg_split('/\\s*\\/\\s*/', $str);\n\t\n\treturn $parts[0];\n}", "function tep_parse_category_path($cPath) {\n// make sure the category IDs are integers\n $cPath_array = array_map(function ($string) {\n return (int)$string;\n }, explode('_', $cPath));\n\n// make sure no duplicate category IDs exist which could lock the server in a loop\n $tmp_array = array();\n $n = sizeof($cPath_array);\n for ($i=0; $i<$n; $i++) {\n if (!in_array($cPath_array[$i], $tmp_array)) {\n $tmp_array[] = $cPath_array[$i];\n }\n }\n\n return $tmp_array;\n }", "public function path(/* array */ $id): string {\n $torrentId = $id[0];\n $logId = $id[1];\n $key = strrev(sprintf('%04d', $torrentId));\n return sprintf('%s/%02d/%02d', self::STORAGE, substr($key, 0, 2), substr($key, 2, 2))\n . '/' . $torrentId . '_' . $logId . '.html';\n }", "public function getKeyFromId($id)\n {\n $id = $this->removePrefix($id);\n $key = substr($id, 1, strrpos($id, '/') - 1);\n $this->checkMappingExistence($key);\n\n return $key;\n }", "static public function get_key_from_path( $path ) {\n\t\t$sets = self::get_sets();\n\n\t\tforeach ( $sets as $key => $set ) {\n\t\t\tif ( $path == $set['path'] ) {\n\t\t\t\treturn $key;\n\t\t\t}\n\t\t}\n\t}", "private static function prepareRoutePath($prefix, $givenPath) {\r\n if ($givenPath[0] == '/') {\r\n $path = $givenPath;\r\n } else {\r\n $lastChar = substr($prefix, -1);\r\n \r\n if ($lastChar == '/') {\r\n $path = \"{$prefix}{$givenPath}\"; \r\n } else {\r\n $path = \"{$prefix}/{$givenPath}\";\r\n }\r\n }\r\n return $path;\r\n }", "function field_name_to_id($name) {\n if (preg_match('/^([^\\[\\]]+)\\[(.*)\\]$/', $name, $matches)) {\n return $matches[1] . '.' . $matches[2];\n } else {\n return $name;\n }\n}", "function clean_id($text) {\n $text = strtolower($text);\n $text = str_replace('/', '-', $text);\n $text = preg_replace('/[^0-9a-zA-Z-_]/', '', $text);\n return $text;\n}", "public function getPathParts()\n {\n if (empty($this->path)) {\n $this->path = $this->composeDefaultPath();\n }\n if (is_array($this->path)) {\n return $this->path;\n }\n return explode('.', $this->path);\n }", "public function getPathEncoded();", "function getPath($path) {\n\t\tif (substr($path,0,4)=='EXT:') {\n\t\t\t$keyEndPos = strpos($path, '/', 6);\n\t\t\t$key = substr($path,4,$keyEndPos-4);\n\t\t\t$keyPath = t3lib_extMgm::siteRelpath($key);\n\t\t\t$newPath = $keyPath.substr($path,$keyEndPos+1);\n\t\treturn $newPath;\n\t\t}\telse {\n\t\t\treturn $path;\n\t\t}\n\t}", "public function getId(): int\n {\n return (int)substr($this->token, 0, strpos($this->token, ':'));\n }", "public function getNaturalPath($path){\n\t\t$path = explode('/',$path);\n\t\t$slug = '';\n\t\tforeach($path as $item){\n\t\t\tif( (!is_numeric($item)) && ($item != 'create') && !empty($item) ){\n\t\t\t\t$slug .= '/'.$item;\n\t\t\t}else{\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn $slug;\n\t}", "function getPath($path) {\n if (substr($path,0,4)=='EXT:') {\n $keyEndPos = strpos($path, '/', 6);\n $key = substr($path,4,$keyEndPos-4);\n $keyPath = t3lib_extMgm::siteRelpath($key);\n $newPath = $keyPath.substr($path,$keyEndPos+1);\n return $newPath;\n }\telse {\n return $path;\n }\n }", "private function setPath($id){\n $query = \"\n UPDATE\n `structure_data`\n SET\n `path` = '\".$this->getNodePath($id).\"'\n WHERE\n `id` = \".$id.\"\n \";\n mysql_query($query);\n }", "private function pathPreparation(string $path): string\n {\n return str_pad($path, 3, '0', STR_PAD_LEFT);\n }", "protected function resolvePath($path)\n {\n /** @var BaseActiveRecord $model */\n $model = $this->owner;\n return preg_replace_callback('/{([^}]+)}/', function ($matches) use ($model) {\n $name = $matches[1];\n $attribute = ArrayHelper::getValue($model, $name);\n if (is_string($attribute) || is_numeric($attribute)) {\n return $attribute;\n } else {\n return $matches[0];\n }\n }, $path);\n }", "function opensky_get_pid_from_request () {\n $pat = 'islandora/object';\n\n if (substr (request_path(), 0, strlen($pat)) != $pat) {\n return null;\n }\n $path_parts = explode('/', request_path());\n $tail = array_pop($path_parts);\n $parts = explode (':', $tail);\n if (count($parts) == 2) {\n return $tail;\n }\n return null;\n}", "protected function validate($path)\n {\n $this->assertValidComponent($path);\n\n return preg_replace_callback(\n $this->getReservedRegex(),\n [$this, 'decodeSegmentPart'],\n $path\n );\n }", "protected function extractId($url)\n {\n $parts = explode('/', $url);\n return end($parts);\n }", "public function normalizePath($path)\n {\n $path = str_replace(['\\\\', '//'], '/', $path);\n $prefix = preg_match('|^(?P<prefix>([a-zA-Z]+:)?//?)|', $path, $matches) ? $matches['prefix'] : '';\n $path = substr($path, strlen($prefix));\n $parts = array_filter(explode('/', $path), 'strlen');\n $tokens = [];\n\n foreach ($parts as $part) {\n if ('..' === $part) {\n array_pop($tokens);\n } elseif ('.' !== $part) {\n array_push($tokens, $part);\n }\n }\n\n return $prefix . implode('/', $tokens);\n }", "public function getValueArrayFromIndexString($data, $path) {\n $temp = $data;\n foreach(explode(\":\", $path) as $ndx) {\n $temp = isset($temp[$ndx]) ? $temp[$ndx] : null;\n }\n return $temp;\n }", "public function getAdditionalServicesIdFromInput($paramName = 'aservices', $idDelimeter = '-')\n {\n $route = Request::route();\n\n $additionalServicesStr = $route->getParameter($paramName);\n\n if (!preg_match('#^[0-9'.$idDelimeter.']+$#s', $additionalServicesStr)) {\n return null;\n }\n $additionalServicesIds = collect(explode('-', $additionalServicesStr));\n\n $additionalServicesIds->transform(function ($item) {\n return (int)$item;\n });\n\n return $additionalServicesIds;\n }", "private static function splitPathInTwo($path)\n {\n // find the point where we want to merge\n $firstPart = FilterDotNotationParts::fromString($path, 0, -1);\n $finalPart = FilterDotNotationParts::fromString($path, -1, 1);\n\n return [ $firstPart, $finalPart ];\n }", "function segment_explode($uri){\n\t\t$len = strlen($uri);\n\n\t\t//If there is a '/' at the first index,\n\t\t//Set new $uri starting from index 1.\n\t\tif(substr($uri, 0, 1) == '/'){\n\t\t\t$uri = $substr($uri, 1, $len);\n\t\t}\n\n\t\t//If there is a '/' at the end,\n\t\t//Set new $uri from index 0 to length -1.\n\t\tif(substr($uri, -1) == '/'){\n\t\t\t$uri = $substr($uri, 0, $len-1);\n\t\t}\n\n\t\treturn explode('/', $uri);\n\t}", "private function processJsonPath($path)\n {\n $path_length = strlen($path);\n\n if (substr($path, $path_length - 6) == '~first') {\n return [substr($path, 0, $path_length - 6), true];\n } else {\n return [$path, false];\n }\n }", "public static function cleanId($id) {\n\t\tstatic $seen;\n\t\t$id = str_replace(array('][', '_', ' '), '-', $id);\n\t\tif(isset($seen[$id]))\n\t\t\t$id .= '-'.$seen[$id]++;\n\t\telse\n\t\t\t$seen[$id] = 0;\n\t\treturn $id;\n\t}", "public function getPath($path);", "public function getUnusedPath($storeId, $requestPath, $idPath)\r\n {\r\n if (Mage::getVersion() < '1.6.0.0') {\r\n return parent:: getUnusedPath($storeId, $requestPath, $idPath);\r\n }\r\n if (strpos($idPath, 'product') !== false) {\r\n $suffix = $this->getProductUrlSuffix($storeId);\r\n } else {\r\n $suffix = $this->getCategoryUrlSuffix($storeId);\r\n }\r\n if (empty($requestPath)) {\r\n $requestPath = '-';\r\n } elseif ($requestPath == $suffix) {\r\n $requestPath = '-' . $suffix;\r\n }\r\n\r\n /**\r\n * Validate maximum length of request path\r\n */\r\n if (strlen($requestPath) > self::MAX_REQUEST_PATH_LENGTH + self::ALLOWED_REQUEST_PATH_OVERFLOW) {\r\n $requestPath = substr($requestPath, 0, self::MAX_REQUEST_PATH_LENGTH);\r\n }\r\n\r\n if (isset($this->_rewrites[$idPath])) {\r\n $this->_rewrite = $this->_rewrites[$idPath];\r\n if ($this->_rewrites[$idPath]->getRequestPath() == $requestPath) {\r\n return $requestPath;\r\n }\r\n }\r\n else {\r\n $this->_rewrite = null;\r\n }\r\n\r\n $rewrite = $this->getResource()->getRewriteByRequestPath($requestPath, $storeId);\r\n if ($rewrite && $rewrite->getId()) {\r\n if ($rewrite->getIdPath() == $idPath) {\r\n $this->_rewrite = $rewrite;\r\n return $requestPath;\r\n }\r\n // match request_url abcdef1234(-12)(.html) pattern\r\n $match = array();\r\n $regularExpression = '#^([0-9a-z/-]+?)(-([0-9]+))?('.preg_quote($suffix).')?$#i';\r\n if (!preg_match($regularExpression, $requestPath, $match)) {\r\n return $this->getUnusedPath($storeId, '-', $idPath);\r\n }\r\n $match[1] = $match[1] . '-';\r\n $match[4] = isset($match[4]) ? $match[4] : '';\r\n\r\n $lastRequestPath = $this->getResource()\r\n ->getLastUsedRewriteRequestIncrement($match[1], $match[4], $storeId);\r\n if ($lastRequestPath) {\r\n $match[3] = $lastRequestPath;\r\n }\r\n //************fix magento bug with the same category name**************************\r\n if (strpos($idPath, 'category') !== false) {\r\n $requestPathExist = $match[1]\r\n . (isset($match[3]) ? ($match[3]) : '1')\r\n . $match[4];\r\n\r\n $rewriteExist = $this->getResource()->getRewriteByRequestPath($requestPathExist, $storeId);\r\n if ($rewriteExist && $rewriteExist->getIdPath() && $rewriteExist->getIdPath() == $idPath) {\r\n return $requestPathExist;\r\n }\r\n }\r\n //**********************************************************************************\r\n return $match[1]\r\n . (isset($match[3]) ? ($match[3]+1) : '1')\r\n . $match[4];\r\n }\r\n else {\r\n return $requestPath;\r\n }\r\n }", "public function getPath(int $id): string\n {\n $section_url = '';\n $section = (new NewsSection())->find($id);\n if ($section !== null) {\n $path = [\n $section->code,\n ];\n $parent = $section->parentSection;\n while ($parent !== null) {\n $path[] = $parent->code;\n $parent = $parent->parentSection;\n }\n krsort($path);\n\n $section_url = implode('/', $path);\n }\n\n return $section_url;\n }", "private function slashPath(string $path) : string\n {\n return trim($path, '/');\n }", "function tep_parse_category_path($cPath) {\n// make sure the category IDs are integers\n $cPath_array = array_map('tep_string_to_int', explode('_', $cPath));\n\n// make sure no duplicate category IDs exist which could lock the server in a loop\n $tmp_array = array();\n $n = sizeof($cPath_array);\n for ($i=0; $i<$n; $i++) {\n if (!in_array($cPath_array[$i], $tmp_array)) {\n $tmp_array[] = $cPath_array[$i];\n }\n }\n\n return $tmp_array;\n }", "protected static function getPath($id) {\n\t\treturn self::FILES_DIR.DIRECTORY_SEPARATOR.$id;\n\t}", "public function getPathId($a_endnode_id, $a_startnode_id = 0)\n\t{\n\t\tif(!$a_endnode_id)\n\t\t{\n\t\t\t$GLOBALS['ilLog']->logStack();\n\t\t\tthrow new InvalidArgumentException(__METHOD__.': No endnode given!');\n\t\t}\n\t\t\n\t\t// path id cache\n\t\tif ($this->isCacheUsed() && isset($this->path_id_cache[$a_endnode_id][$a_startnode_id]))\n\t\t{\n//echo \"<br>getPathIdhit\";\n\t\t\treturn $this->path_id_cache[$a_endnode_id][$a_startnode_id];\n\t\t}\n//echo \"<br>miss\";\n\n\t\t$pathIds = $this->getTreeImplementation()->getPathIds($a_endnode_id, $a_startnode_id);\n\t\t\n\t\tif($this->__isMainTree())\n\t\t{\n\t\t\t$this->path_id_cache[$a_endnode_id][$a_startnode_id] = $pathIds;\n\t\t}\n\t\treturn $pathIds;\n\t}", "private function getEntityId()\n\t{\n\t\t$id = $this->GetDocumentId();\n\t\t$pairs = explode('_', $id[2]);\n\n\t\treturn count($pairs) > 1 ? $pairs[1] : $pairs[0];\n\t}", "protected function preprocessPathString($path)\r\n {\r\n // If the path is null, make sure to give it our match-all value\r\n $path = (null === $path) ? static::NULL_PATH_VALUE : (string) $path;\r\n\r\n // If a custom regular expression (or negated custom regex)\r\n if ($this->namespace &&\r\n (isset($path[0]) && $path[0] === '@') ||\r\n (isset($path[0]) && $path[0] === '!' && isset($path[1]) && $path[1] === '@')\r\n ) {\r\n // Is it negated?\r\n if ($path[0] === '!') {\r\n $negate = true;\r\n $path = substr($path, 2);\r\n } else {\r\n $negate = false;\r\n $path = substr($path, 1);\r\n }\r\n\r\n // Regex anchored to front of string\r\n if ($path[0] === '^') {\r\n $path = substr($path, 1);\r\n } else {\r\n $path = '.*' . $path;\r\n }\r\n\r\n if ($negate) {\r\n $path = '@^' . $this->namespace . '(?!' . $path . ')';\r\n } else {\r\n $path = '@^' . $this->namespace . $path;\r\n }\r\n\r\n } elseif ($this->namespace && $this->pathIsNull($path)) {\r\n // Empty route with namespace is a match-all\r\n $path = '@^' . $this->namespace . '(/|$)';\r\n } else {\r\n // Just prepend our namespace\r\n $path = $this->namespace . $path;\r\n }\r\n\r\n return $path;\r\n }" ]
[ "0.7118369", "0.6247984", "0.6191228", "0.61846733", "0.604478", "0.5838041", "0.57488704", "0.57348263", "0.5731591", "0.5686438", "0.561997", "0.5598752", "0.5572126", "0.5566351", "0.55111706", "0.549561", "0.54875237", "0.5469193", "0.5468001", "0.5399036", "0.53955424", "0.5391231", "0.5345343", "0.532312", "0.532312", "0.5318318", "0.527864", "0.5273602", "0.5263739", "0.5254215", "0.5237914", "0.52266544", "0.5223419", "0.516077", "0.51456743", "0.51274055", "0.5101416", "0.50897956", "0.50855476", "0.50720346", "0.50663066", "0.5060791", "0.5052911", "0.50285286", "0.5018262", "0.5008807", "0.5001724", "0.4999897", "0.4985903", "0.49380934", "0.49063608", "0.49002042", "0.4891936", "0.48728937", "0.48595", "0.48593915", "0.4848563", "0.4844773", "0.48392582", "0.48205608", "0.4813575", "0.478477", "0.47801933", "0.4778585", "0.47577327", "0.4754522", "0.4753625", "0.47534522", "0.4745554", "0.47435144", "0.47407156", "0.47393522", "0.47258", "0.47244242", "0.47180572", "0.47142422", "0.47116265", "0.47098726", "0.4706963", "0.4699899", "0.4681149", "0.46790722", "0.4670749", "0.4667071", "0.46670142", "0.46655494", "0.4653932", "0.4653636", "0.4652155", "0.46503532", "0.46481588", "0.46446693", "0.46408218", "0.46377182", "0.46348214", "0.46323565", "0.46278113", "0.46239066", "0.46209648", "0.46178135" ]
0.86308074
0
/================================ Edit difficulty ===========================
public function editdifficulty($id) { if($this->uri->segment(3)=="") { $this->session->set_flashdata('err_msg', 'Dont Change the URL physically'); redirect('admin/recipe/viewdifficulty'); } if ($this->input->server('REQUEST_METHOD') == 'POST') { $data['name']= strip_tags($this->input->post('name')); $name=strip_tags($this->input->post('slug')); $data['slug'] = strtolower(trim(preg_replace('/[^A-Za-z0-9-]+/', '-', $name))); $data['description']= strip_tags($this->input->post('description')); $data['status']= strip_tags($this->input->post('status')); $this->form_validation->set_rules('name', 'Name', 'trim|required'); $this->form_validation->set_rules('description', 'Description', 'trim|required'); $this->form_validation->set_rules('slug', 'Slug', 'trim|required'); if ($this->form_validation->run() == TRUE) { $data_inserted = $this->Difficulty_model->edit_data($data,$id); $this->session->set_flashdata('success_msg', 'Slider edited Successfully'); redirect('admin/recipe/viewdifficulty'); } } $site_name=$this->config->item('site_name'); $this->template->set('title', 'Edit Difficulty | '.$site_name); $data_single = $this->Difficulty_model->get_data_by_id($id); $data['difficulty']=$data_single ; //print_r($data_single);die(); $this->template->set_layout('layout_main', 'front'); $this->template->build('editdifficulty',$data); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function edit()\n\t{\n\t\t//\n\t}", "public function edit()\n\t{\n\t\t\n\t}", "public function edit() {\n\t\t\t\n\t\t}", "public function edit( )\r\n {\r\n //\r\n }", "public function Edit()\n\t{\n\t\t\n\t}", "public function edit_toko(){\n\t}", "public function edit()\n {\n \n }", "protected function editar()\n {\n }", "public function edit(Problem $problem)\n {\n //\n }", "public function edit()\r\n {\r\n //\r\n }", "public function edit()\r\n {\r\n //\r\n }", "public function edit()\n {\n \n }", "public function edit()\n {\n \n }", "public function edit()\n {\n \n }", "public function edit()\n {\n }", "public function edit()\n {\n }", "public function edit()\n {\n }", "public function edit()\n {\n \n \n }", "public function edit() {\n }", "public function edit()\n { \n }", "public function edit()\n { }", "abstract protected function renderEdit();", "public function edit(Game $game)\n {\n \t//\n }", "abstract function allowEditAction();", "public function edit(Answer $Answer)\n {\n echo \"i am in edit\";exit();\n //\n }", "public function edit()\n {\n //\n\t\treturn 'ini halaman edit';\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "public function modelDoEdit(){\n\t\t\t$maphongban = isset($_GET[\"maphongban\"])&&is_numeric($_GET[\"maphongban\"])?$_GET[\"maphongban\"]:0;\n\t\t\t$tenphongban = $_POST[\"tenphongban\"];\n\t\t\t//lay bien ket noi de thao tac csdl\n\t\t\t$conn = Connection::getInstance();\n\t\t\t//chuan bi truy van\n\t\t\t$query = $conn->prepare(\"update phongban set tenphongban=:ten where maphongban=:ma\");\n\t\t\t$query->execute(array(\"ten\"=>$tenphongban,\"ma\"=>$maphongban));\n\t\t}", "public function editar()\n {\n }", "public function editstepsAction(){\n\n\t echo $this->ModelObj->updatesteps($this->Request); exit;\n\n\t}", "function doEdit()\n {\n global $_POST;\n$regs=explode(\":::\",$_POST[\"DROWS\"]);\n$id= $regs[0];\n if (strlen($id) <= 0)\n {\n echo \"Nao existe valores a serem editados\";\n echo \"<a href=./cadastra.php>Voltar</a> \";\n exit();\n }\n$result = lookup($id);\n\n presentInputForm(\n mysql_result($result, 0, \"id\"),\n mysql_result($result, 0, 1),\n mysql_result($result, 0, 2),\n mysql_result($result, 0, 3),\n mysql_result($result, 0, 4),\n mysql_result($result, 0, 5),\n mysql_result($result, 0, 6),\n mysql_result($result, 0, 7),\n mysql_result($result, 0, 8),\n mysql_result($result, 0, 9),\n mysql_result($result, 0, 10),\n mysql_result($result, 0, 11),\n\"E\");\n }", "public function edit()\n {\n\n }", "public function edit()\n {\n\n }", "public function edit()\n {\n\n }", "public function edit()\n {\n\n }", "public function edit(Python $python)\n {\n //\n }", "public function testUpdateChallenge()\n {\n }", "public function edit()\n {\n //\n }", "public function edit() {\n\n }", "protected function canEdit() {}", "public function edit()\n {\n return \"Ini Halaman Edit\";\n }", "public function edit(Run $run)\n {\n //\n }", "public function edit(Run $run)\n {\n //\n }", "function edithistory_edit_page()\n{\n\tglobal $db, $lang, $mybb, $post, $templates, $post_errors, $reason, $postreason;\n\t$lang->load(\"edithistory\");\n\n\tif($mybb->input['previewpost'] || $post_errors)\n\t{\n\t\t$postreason = htmlspecialchars_uni($mybb->input['reason']);\n\t}\n\telse\n\t{\n\t\t$postreason = htmlspecialchars_uni($post['reason']);\n\t}\n\n\teval(\"\\$reason = \\\"\".$templates->get(\"editpost_reason\").\"\\\";\");\n}", "public function edit(Tivy $tivy)\n {\n //\n }", "public function testUpdateSurveyQuestionChoice0()\n {\n }", "public function testUpdateSurveyQuestionChoice0()\n {\n }", "function editCorrectiveAction($correctiveAction) {\n\n //$this->perm_desc = $_POST['correctiveAction_desc'];\n\n // $modifieddate = date(\"d-m-Y H:i:s\");\n $modifiedby_id = $_SESSION[\"loggedid\"];\n\n $query = \"UPDATE corrective_action SET finding_num='$correctiveAction->finding_num',status='$correctiveAction->status',description='$correctiveAction->description',finding_priority='$correctiveAction->finding_priority',start_date='$correctiveAction->start_date',finding_priority_date='$correctiveAction->finding_priority_date',finish_date='$correctiveAction->finish_date',\n \t\t\tmodifiedby_id='$modifiedby_id' WHERE id=\" . \"'$correctiveAction->id'\";\n mysqli_query($this->plink, $query);\n // close connection\n // mysqli_close($this->plink);\n $url = \"../view/correctiveActionList.php\";\n\n redirect($url);\n }", "function EDIT()\r\n{\r\n\t// se construye la sentencia de busqueda de la tupla en la bd\r\n $sql = \"SELECT * FROM NOTICIA WHERE (idNoticia = '$this->idNoticia')\";\r\n // se ejecuta la query\r\n $result = $this->mysqli->query($sql);\r\n // si el numero de filas es igual a uno es que lo encuentra\r\n if ($result->num_rows == 1)\r\n {\t// se construye la sentencia de modificacion en base a los atributos de la clase\r\n\t\t$sql = \"UPDATE NOTICIA SET \r\n\t\t\t\t\tidNoticia = '$this->idNoticia',\r\n\t\t\t\t\timageURL = '$this->imageURL',\r\n\t\t\t\t\tenlace = '$this->enlace',\r\n\t\t\t\t\ttexto = '$this->texto'\t\t\t\t\t\r\n\t\t\t\tWHERE ( idNoticia = '$this->idNoticia')\";\r\n\t\t// si hay un problema con la query se envia un mensaje de error en la modificacion\r\n if (!($resultado = $this->mysqli->query($sql))){\r\n\t\t\treturn 'Error en la modificación'; \r\n\t\t}\r\n\t\telse{ \r\n\t\t\treturn 'Modificado correctamente.';\r\n\t\t\t\r\n\t\t}\r\n }\r\n else // si no se encuentra la tupla se manda el mensaje de que no existe la tupla\r\n \treturn 'No existe en la base de datos';\r\n}", "public function edit(Game $game)\n {\n \n }", "function edit_info()\n\t{\n\t\tif ($this->ipsclass->input['id'] == \"\")\n\t\t{\n\t\t\t$this->ipsclass->admin->error(\"Невозможно определить ID языка\");\n\t\t}\n\n\t\t//-----------------------------------------\n\n\t\t$this->ipsclass->DB->simple_construct( array( 'select' => '*', 'from' => 'languages', 'where' => \"lid='\".$this->ipsclass->input['id'].\"'\" ) );\n\t\t$this->ipsclass->DB->simple_exec();\n\n\t\tif ( ! $row = $this->ipsclass->DB->fetch_row() )\n\t\t{\n\t\t\t$this->ipsclass->admin->error(\"Невозможно найти язык по введенному ID\");\n\t\t}\n\n\t\t$final['lname'] = stripslashes($_POST['lname']);\n\n\t\tif (isset($_POST['lname']))\n\t\t{\n\t\t\t$final['lauthor'] = stripslashes($_POST['lauthor']);\n\t\t\t$final['lemail'] = stripslashes($_POST['lemail']);\n\t\t}\n\n\t\t$this->ipsclass->DB->do_update( 'languages', $final, \"lid='\".$this->ipsclass->input['id'].\"'\" );\n\n\t\t$this->rebuild_cache();\n\n\t\t$this->ipsclass->admin->done_screen(\"Языковой модуль обновлен\", \"Управление языками\", \"{$this->ipsclass->form_code}\" );\n\n\t}", "public function edit(Turn $turn)\n {\n //\n }", "public function getEditInput();", "public function canBeEdited() {}", "public function quickEdit() {\n if ($this->request->is('post')) {\n $rq_data = $this->request->data;\n $type = $rq_data['type'];\n\n if ($type == 2) {\n $ids = $rq_data['id'];\n $input = $rq_data['input'];\n $now = date('Y-m-d H:i:s');\n if ($this->Team->updateAll(array('name' => \"'$input'\", 'cdate' => \"'$now'\"), array('Team.id' => $ids))) {\n $this->Session->setFlash(__('プロジェクトのアップデートに成功しました。'), 'alert-box', array('class' => 'alert-success'));\n } else {\n $this->Session->setFlash(__('プロジェクトをアップデートすることはできません。'), 'alert-box', array('class' => 'alert-danger'));\n }\n } elseif ($type == 3) {\n $id = $rq_data['id'];\n $input = $rq_data['input'];\n $cr_data = $rq_data['cr_data'];\n $cr_date = date('Y-m-d H:i:s');\n// $this->Management->query(\"UPDATE management SET team_id = {$id}, update_date = '{$cr_date}' WHERE id = {$input}\");\n\n if ($this->Management->updateAll(array('team_id' => $id, 'update_date' => \"'{$cr_date}'\"), array('id' => $input))) {\n $this->Session->setFlash(__('プロジェクトのアップデートに成功しました。'), 'alert-box', array('class' => 'alert-success'));\n } else {\n $this->Session->setFlash(__('プロジェクトをアップデートすることはできません。'), 'alert-box', array('class' => 'alert-danger'));\n }\n } elseif ($type == 5) {\n $id = $rq_data['id'];\n $input = $rq_data['input'];\n if ($this->Team->save(array('id' => $id, 'code' => $input))) {\n $this->Session->setFlash(__('プロジェクトのアップデートに成功しました。'), 'alert-box', array('class' => 'alert-success'));\n } else {\n $this->Session->setFlash(__('プロジェクトをアップデートすることはできません。'), 'alert-box', array('class' => 'alert-danger'));\n }\n } elseif ($type == 6) {\n $ids = $rq_data['ids'];\n foreach ($ids as $v_id) {\n $visible = $this->Team->find('first', array(\n 'conditions' => array('id' => $v_id),\n 'fields' => array('valid')\n ));\n $status = ($visible['Team']['valid'] == 1) ? 0 : 1;\n\n if ($this->Team->save(array('id' => $v_id, 'valid' => $status))) {\n $this->Session->setFlash(__('プロジェクトのアップデートに成功しました。'), 'alert-box', array('class' => 'alert-success'));\n } else {\n $this->Session->setFlash(__('プロジェクトをアップデートすることはできません。'), 'alert-box', array('class' => 'alert-danger'));\n }\n }\n }\n\n echo json_encode(1);\n exit;\n }\n }", "public function edit(Exercice $exercice)\n {\n //\n }", "public function edit(){\r\n\r\n\t\t// create info\r\n\t\t$info[] = JText::_('Size').': '.$this->getSize();\r\n\t\t$info[] = JText::_('Hits').': '.(int) $this->get('hits', 0);\r\n\t\t$info = ' ('.implode(', ', $info).')';\r\n\r\n if ($layout = $this->getLayout('edit.php')) {\r\n return $this->renderLayout($layout,\r\n array(\r\n\t\t\t\t\t'info' => $info,\r\n 'hits' => $this->get('hits', 0)\r\n )\r\n );\r\n }\r\n\r\n\t}", "public function edit(Tile $tile)\n {\n //\n }", "public function edit(Tile $tile)\n {\n //\n }", "public function edit(){\r\n\t\t//$this->auth->set_access('edit');\r\n\t\t//$this->auth->validate();\r\n\r\n\t\t//call save method\r\n\t\t$this->save();\r\n\t}", "public function edit(FunFacts $funFacts)\n {\n //\n }", "public function editAction() {}", "public function showEdit()\n {\n\n }", "function EDIT()\n{\n\t// se construye la sentencia de busqueda de la tupla en la bd\n $sql = \"SELECT * FROM PAREJA WHERE (idpareja= $this->idpareja)\";\n // se ejecuta la query\n $result = $this->mysqli->query($sql);\n // si el numero de filas es igual a uno es que lo encuentra\n if ($result->num_rows == 1)\n {\t// se construye la sentencia de modificacion en base a los atributos de la clase\n\t\t$sql = \"UPDATE PAREJA SET \n\t\t\t\t\tlogin1 = '$this->login1',\n\t\t\t\t\tlogin2 = '$this->login2'\t\t\t\n\t\t\t\tWHERE ( idpareja = $this->idpareja\n\t\t\t\t)\";\n\n\t\n\t\t// si hay un problema con la query se envia un mensaje de error en la modificacion\n if (!($resultado = $this->mysqli->query($sql))){\n\t\t\treturn 'Error en la modificación de la pareja.'; \n\t\t}\n\t\telse{ \n\t\t\treturn 'Pareja modificada correctamente.';\n\t\t\t\n\t\t}\n }\n else // si no se encuentra la tupla se manda el mensaje de que no existe la tupla\n \treturn 'No existe la pareja en la base de datos';\n}", "public function edit(Bug $bug)\n {\n //\n }", "function fileEdit(){\n\t\t$result = mysql_query(getFile($_GET['file']));\n\t\t$GLOBALS['adminObjectId'] = $_GET['file'];\n\t\tif($row = mysql_fetch_assoc($result)) {\n\t\t\tgetFileGlobals($row);\n\t\t\tfileForm(\"edit\");\n\t\t}\n\t}", "public function canBeEdited()\n {\n return false;\n }", "public function edit() {\n\t\t\n\t\t$data = array(\n\t\t\t'user_id' => $this->_user_id,\n\t\t\t'date' => $this->_date,\n\t\t\t'time_of_day' => $this->_time_of_day,\n\t\t\t'type_id' => $this->_type_id,\n\t\t\t'route_id' => $this->_route_id,\n\t\t\t'distance' => $this->_distance,\n\t\t\t'time' => $this->_time,\n\t\t\t'shoe_id' => $this->_shoe_id,\n\t\t\t'quality' => $this->_quality,\n\t\t\t'effort' => $this->_effort,\n\t\t\t'weather_ids' => $this->_weather_ids,\n\t\t\t'temperature' => $this->_temperature,\n\t\t\t'notes' => $this->_notes,\n\t\t\t'field' => $this->_field,\n\t\t\t'placement' => $this->_placement,\n\t\t\t'group_min_age' => $this->_group_min_age,\n\t\t\t'group_max_age' => $this->_group_max_age,\n\t\t\t'group_age_size' => $this->_group_age_size,\n\t\t\t'group_age_placement' => $this->_group_age_placement,\n\t\t\t'group_gender_size' => $this->_group_gender_size,\n\t\t\t'group_gender_placement' => $this->_group_gender_placement,\n\t\t\t'active' => $this->_active\t\t\t\n\t\t);\n\t\t$this->db->where('id',$this->_id);\n\t\t$this->db->update($this->_table,$data);\n\t\t\n\t\treturn true;\n\t}", "public function edit(bugget $bugget)\n {\n //\n }", "public function edit(Exercise $exercise){\n //\n }", "public function edit(Answere $answere)\n {\n //\n }", "public function edit(Emploitime $emploitime)\n {\n //\n }", "public function edit($obj) {\n\t}", "public function annimalEditAction()\n {\n }", "public function edit(Kumpul_Tp $kumpul_Tp)\n {\n //\n }", "public function edit($sql){\n\t\t$this->db->query($sql) or die ($this->db->error);\n\t}", "function edit(){\n\t@header(\"Location:modifier.php?id=\".$_GET['line']);\n}", "public function edit(Pabellones $pabellones)\n {\n //\n }", "public function edit(Game $game)\n {\n //\n }", "public function edit(Game $game)\n {\n //\n }", "public function edit(Game $game)\n {\n //\n }", "function show_update()\n{\nif (isset($_POST[\"datum\"]))\n{\n$heute = $_POST[\"datum\"];\n}\nelse\n{\n$heute=date(\"Y-m-d\");\n}\n\n$sql_select_heute = \"SELECT * FROM sendeplan WHERE datum='\". $heute . \"' ORDER BY bis ASC\";\n$db = mysql_connect(\"localhost\", \"portal\", \"psacln\") or die(\"Verbindungsfehler\");\n$query_heute = mysql_db_query(\"portal\", $sql_select_heute);\nif (mysql_affected_rows()==\"0\")\n{ echo 'Es wurde kein Sendeplan f&uuml;r diesen Tag gefunden. Zum bearbeiten eines anderen Tages bitte das Datum eingeben nach ISO Norm = YYYY-MM-TT<br />\n<form method=\"post\" action=\"index.php?x=edit\"><button type=\"submit\">Bearbeiten</button>\n<input type=\"text\" name=\"datum\" value=\"'.$heute.'\" />\n<input type=\"hidden\" name=\"userinput\" value=\"' .$_POST[\"userinput\"].'\" />\n<input type=\"hidden\" name=\"passinput\" value=\"' .$_POST[\"passinput\"].'\" /></form>\n'; }\n\n// Generiere Mod Drop-Down\n $sql1=\"SELECT id,nick FROM user WHERE portal_level<10 AND portal_level>4 ORDER BY 'nick'\";\n $db = mysql_connect(\"localhost\", \"portal\", \"psacln\") or die(\"Verbindungsfehler\");\n $result1=mysql_db_query(\"portal\",$sql1);\n \n $drop=\"\";\n while($zeile1=mysql_fetch_array($result1))\n {\n\t $drop.='<option value=\"'.$zeile1[\"id\"].'\">'.$zeile1[\"nick\"].'</option>';\n } \n \n \n $sql1=\"SELECT id,nick FROM user WHERE portal_level>10 ORDER BY 'nick'\";\n $result1=mysql_db_query(\"portal\",$sql1);\n \n // Generiere Admin Drop-Down\n $drop.='<option value=\"0\">----Admins----</option>';\n \n while($zeile1=mysql_fetch_array($result1))\n {\n\t $drop.='<option value=\"'.$zeile1[\"id\"].'\">'.$zeile1[\"nick\"].'</option>';\n } \n// Drop Ende\n\n\n while($zeile = mysql_fetch_array($query_heute))\n {\n\t \n\t \n\t $sql2=\"SELECT nick FROM user WHERE id='\".$zeile[\"userid\"].\"'\";\n\t $result2=mysql_db_query(\"portal\",$sql2);\n\t $zeile2=mysql_fetch_array($result2); \n\t \n echo '\n <table border=\"1\"><tr><td><form method=\"post\" action=\"index.php?x=edit\">\n <input type=\"hidden\" name=\"userinput\" value=\"' .$_POST[\"userinput\"].'\" />\n <input type=\"hidden\" name=\"passinput\" value=\"' .$_POST[\"passinput\"].'\" />\n <input type=\"hidden\" name=\"del\" value=\"'.$zeile[\"id\"].'\" /><button type=\"submit\">Löschen</button>\n </form>\n </td>\n <td><form method=\"post\" action=\"index.php?x=edit\">';\n //kalenderwoche($heute);\n //echo \": \";\n wochentag($heute);\n echo'</td>\n <td><input type=\"text\" name=\"datum\" value=\"'.$heute.'\" size=\"8\" maxlengh=\"8\" /></td>\n <td><input type=\"text\" name=\"von\" value=\"'.$zeile[\"von\"].'\" size=\"4\" maxlengh=\"4\" /></td>\n <td><input type=\"text\" name=\"bis\" value=\"'.$zeile[\"bis\"].'\" size=\"4\" maxlengh=\"4\" /></td>\n <td><input type=\"text\" name=\"titel\" value=\"'.$zeile[\"titel\"].'\" size=\"20\" maxlengh=\"20\" /></td>\n <td><select name=\"stream\">';\n if ($zeile[\"stream\"]==1)\n { echo '<option value=\"1\">Stream 1</option><option value=\"2\">Stream 2</option><option value=\"3\">Stream 3</option>'; }\n\n elseif ($zeile[\"stream\"]==2)\n { echo '<option value=\"2\">Stream 2</option><option value=\"3\">Stream 3</option><option value=\"1\">Stream 1</option>'; }\n \n else\n { echo '<option value=\"3\">Stream 3</option><option value=\"1\">Stream 1</option><option value=\"2\">Stream 2</option>'; }\n\n \n echo '</select><td><select name=\"userid\"><option value=\"'.$zeile[\"userid\"].'\">---'.$zeile2[\"nick\"].'</option>'.$drop.'</select></td>\n <input type=\"hidden\" value=\"' .$_POST[\"userinput\"].'\" name=\"userinput\" size=\"4\" maxlengh=\"4\" />\n <input type=\"hidden\" value=\"' .$_POST[\"passinput\"].'\" name=\"passinput\" size=\"4\" maxlengh=\"4\" />\n <input type=\"hidden\" value=\"'.$heute.'\" name=\"datum\" />\n <input type=\"hidden\" value=\"'.$zeile[\"id\"].'\" name=\"id\" />\n <input type=\"hidden\" value=\"edit\" name=\"do\" />\n <td><button type=\"submit\">Speichern</button></td></form>\n </tr></table><hr />';\n\n\t }\n}", "function showEditMessage($flagedit, $msgedit) {\n if (!empty($msgedit)) {\n if($msgedit=='2'){\n $showEditMsg = \"চার্জটি সফলভাবে পরিবর্তন হয়েছে\";\n }elseif ($msgedit=='3') {\n $showEditMsg = \"চার্জটি সফলভাবে স্থগিত হয়েছে\";\n }elseif ($msgedit=='4') {\n $showEditMsg = \"চার্জটি সফলভাবে পুনরায় চালু হয়েছে\";\n } else {\n $showEditMsg = \"দুঃখিত, আবার চেষ্টা করুন\";\n }\n if ($flagedit == '2') {\n echo '<tr><td colspan=\"3\" height=\"30px\" style=\"text-align:center;\"><b><span style=\"color:green;font-size:15px;\">' . $showEditMsg . '</b></td></tr>';\n } else {\n echo '<tr><td colspan=\"3\" height=\"30px\" style=\"text-align:center;\"><b><span style=\"color:red;font-size:15px;\"><blink>' . $showEditMsg . '</blink></b></td></tr>';\n }\n }\n}", "public function edit(Answer $answer)\n {\n //\n }", "public function edit(Answer $answer)\n {\n //\n }", "public function edit(Answer $answer)\n {\n //\n }", "public function edit(Answer $answer)\n {\n //\n }", "public function edit(Answer $answer)\n {\n //\n }", "function a_edit() {\n\t\tif (isset($_POST[\"btSubmit\"])) {\n\t\t\t$_POST['use_passw']=password_hash($_POST['use_passw'], PASSWORD_DEFAULT);\n\t\t\t$u=new User();\n\t\t\t$u->chargerDepuisTableau($_POST);\n\t\t\t$u->sauver();\n\t\t\theader(\"location:index.php?m=documents\");\n\t\t} else {\t\t\t\t\n\t\t\t$id = isset($_GET[\"id\"]) ? $_GET[\"id\"] : 0;\n\t\t\t$u=new User($id);\n\t\t\textract($u->data);\t\n\t\t\trequire $this->gabarit;\n\t\t}\n\t}" ]
[ "0.7068806", "0.70325893", "0.69628066", "0.6894456", "0.6737955", "0.6717506", "0.6608212", "0.6570998", "0.6522921", "0.64930344", "0.64930344", "0.64582205", "0.64582205", "0.64582205", "0.64286983", "0.64286983", "0.64286983", "0.6426127", "0.6423764", "0.6409085", "0.63653564", "0.6343019", "0.63405097", "0.6305849", "0.6305381", "0.6287232", "0.62737495", "0.62737495", "0.62737495", "0.62737495", "0.62737495", "0.62737495", "0.62737495", "0.62737495", "0.62737495", "0.62737495", "0.62737495", "0.62737495", "0.62668264", "0.62604797", "0.6252809", "0.6246351", "0.6244628", "0.6244628", "0.6244628", "0.6244628", "0.6238677", "0.6230503", "0.62215316", "0.61862993", "0.6186173", "0.6151501", "0.61418456", "0.61418456", "0.6134401", "0.61037135", "0.60944057", "0.60944057", "0.6083626", "0.6057815", "0.6050561", "0.6025204", "0.60056794", "0.5990245", "0.5988395", "0.5986537", "0.5979902", "0.5968343", "0.596239", "0.596239", "0.5954708", "0.59538215", "0.5950774", "0.5942259", "0.59413534", "0.5941076", "0.59389174", "0.5931449", "0.5930015", "0.59267753", "0.59087443", "0.5896415", "0.58947235", "0.58929396", "0.5887641", "0.5887106", "0.58795303", "0.58793634", "0.58786327", "0.58774143", "0.58774143", "0.58774143", "0.5876881", "0.5873472", "0.58662516", "0.58662516", "0.58662516", "0.58662516", "0.58662516", "0.58661866" ]
0.61996275
49
/================================ Edit ingredient ===========================
public function editingredients($id) { if($this->uri->segment(3)=="") { $this->session->set_flashdata('err_msg', 'Dont Change the URL physically'); redirect('admin/recipe/viewingredients'); } if ($this->input->server('REQUEST_METHOD') == 'POST') { $data['name']= strip_tags($this->input->post('name')); $name=strip_tags($this->input->post('slug')); $data['slug'] = strtolower(trim(preg_replace('/[^A-Za-z0-9-]+/', '-', $name))); $data['description']= strip_tags($this->input->post('description')); $data['status']= strip_tags($this->input->post('status')); $this->form_validation->set_rules('name', 'Name', 'trim|required'); $this->form_validation->set_rules('description', 'Description', 'trim|required'); $this->form_validation->set_rules('slug', 'Slug', 'trim|required'); if ($this->form_validation->run() == TRUE) { $data_inserted = $this->Ingredients_model->edit_data($data,$id); $this->session->set_flashdata('success_msg', 'Ingredient edited Successfully'); redirect('admin/recipe/viewingredients'); } } $site_name=$this->config->item('site_name'); $this->template->set('title', 'Edit Ingredients | '.$site_name); $data_single = $this->Ingredients_model->get_data_by_id($id); $data['ingredients']=$data_single ; //print_r($data_single);die(); $this->template->set_layout('layout_main', 'front'); $this->template->build('editingredients',$data); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function editAction(){\n\t\t$recipe = new Recipe();\n\t\t\n\t\t//updating the meal\n\t\tif ($this->_request->isPost()) {\n\t\n\t\t\t$data = $this->_validateRecipe();\n\t\t\t//if no errors validating fields add recipe\n\t\t\tif ($this->view->errorMsg == null) {\n\t\t\t\t$recipe_id = $this->_request->getPost('recipe_idTF');\n\t\t\t\t\n\t\t\t\t//make sure recipe with this name does not already exist\n\t\t\t\t$where = array(\n\t\t\t\t\t$recipe->getAdapter()->quoteInto('user_id = ?', $this->session->user_id),\n\t\t\t\t\t$recipe->getAdapter()->quoteInto('recipe_id != ?', $recipe_id),\n\t\t\t\t\t$recipe->getAdapter()->quoteInto('title = ?', $data['recipe']['title']),\n\t\t\t\t\t'status is null'\n\t\t\t\t); \n\t\t\t\t$recipe_row = $recipe->fetchRow($where);\n\t\t\t\tif($recipe_row != null){\n\t\t\t\t\t$this->view->errorMsg = 'Meal \"'.$data['recipe']['title'].'\" already exists, please use a different title.';\n\t\t\t\t\t$data['recipe']['recipe_id'] = $recipe_id;\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t//update recipe\n\t\t\t\t\t$where = $recipe->getAdapter()->quoteInto('recipe_id = ?', $recipe_id);\n\t\t\t\t\t$recipe->update($data['recipe'], $where);\n\t\n\t\t\t\t\t//delete old recipexquantityxingredients\n\t\t\t\t\t$rxqxi = new RecipexQuantityxIngredient();\n\t\t\t\t\t$where = $rxqxi->getAdapter()->quoteInto('recipe_id = ?', $recipe_id);\n\t\t\t\t\t$rxqxi->delete($where);\n\t\t\t\t\t\n\t\t\t\t\t$this->_saveRecipexQuantityxIngredient($recipe_id, $data);\n\t\t\n\t\t\t\t\t//if successful, redirect to main page\n\t\t\t\t \t$this->_redirect($this->baseUrl.'/meals');\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\n\t\t\t$this->view->recipe_data = $data;\t\t\n\t\t}\n\t\t//get meal to display in edit form\n\t\telse{\n\t\t\t$filter = new Zend_Filter_StripTags();\n\t\t\t$id = trim($filter->filter($this->_request->getQuery('id')));\n\t\t\tif($id != null){\n\t\t\t\t$where = $recipe->getAdapter()->quoteInto('recipe_id = ?', $id);\n\t\t\t\t$row = $recipe->fetchRow($where);\n\t\t\n\t\t\t\t$data = $this->_getRecipe($row);\n\t\t\t\t$this->view->recipe_data = $data;\n\t\t\n\t\t\t}\n\t\t}\n\t\n\n\t\t//populate amounts and ingredients for autocomplete textfields (COPY&PASTE = YUCK!)\n \t$ingredient_arr = array();\n \t$ingredient = new Ingredient();\n\t\t$ingredient_rs = $ingredient->fetchAll();\n\t\t$i = 0;\n\t\twhile($ingredient_rs->valid()){\n\t\t\t$ingredient = $ingredient_rs->current();\n\t\t\t$ingredient_arr[$i] = $ingredient->name;\n\t\t\t$i++;\n\t\t\t$ingredient_rs->next();\n\t\t}\n \t$this->view->ingredient_data = $ingredient_arr;\n\t\n \t$amount_arr = array();\n \t$quantity = new Quantity();\n\t\t$quantity_rs = $quantity->fetchAll();\n\t\t$i = 0;\n\t\twhile($ingredient_rs->valid()){\n\t\t\t$amount = $quantity_rs->current();\n\t\t\tif($amount->measure != null) $amount_arr[$i] = $this->_convertd2f($amount->amount).' '.$amount->measure;\n\t\t\telse $amount_arr[$i] = $amount->amount;\n\t\t\t$i++;\n\t\t\t$quantity_rs->next();\n\t\t}\n \t$this->view->amount_data = $amount_arr;\n \t\n \t\n \t\n \t// additional view fields required by form\n\t\t$this->view->action = 'edit';\n\t\t$this->_helper->viewRenderer->setNoRender();\n\t\t$this->render('add');\n }", "public function edit(Recipe $recipe)\n {\n //\n }", "public function edit(Recipe $recipe)\n {\n //\n }", "public function edit($id) {\n\n\t\t\t$ingredient = Ingredient::where('id',$id)->get();\n\t\t\treturn view('ingredients.modifier-ingredient', ['ingredientAModifier'=>$ingredient[0]]);\n\t}", "public function updateRecipeIngredient($recipeIngredientId, $amountGrams);", "public function update(Request $request, Ingredient $ingredient)\n {\n //\n }", "public function edit($id)\n {\n $suppliers = Supplier::all();\n $ingredient = Ingredient::find($id);\n return view('admin.ingredients.edit',['suppliers'=>$suppliers,'ingredient'=>$ingredient]);\n }", "public function edit($id)\n {\n\t\t\t\ttry {\n\t\t\t\t\t$edit = Ingredient::findOrFail($id);\n\t\t\t\t\t$units = Unit::orderBy('name')->get();\n\t\t\t\t\treturn view('ingredient.edit', compact('edit', 'units'));\n\t\t\t\t} catch (\\Exception $th) {\n\t\t\t\t\treturn redirect()->back();\n\t\t\t\t}\n }", "public function editAction() {\n\t\t$id = $this->getInput('id');\n\t\t$info = Fj_Service_Goods::getGoods(intval($id));\n $this->assign('dir', \"goods\");\n $this->assign('ueditor', true);\n\t\t$this->assign('info', $info);\n\t}", "public function update(Request $request, $id) {\n $validator = Validator::make($request->all(), [\n 'nom' => 'required',\n 'description' => 'required',\n 'prix' => 'min:1|max:5',\n 'difficulte' => 'min:1|max:5',\n 'nbre_personnes' => 'min:1',\n 'image' => 'url'\n ]);\n\n if ($validator->fails()) {\n return redirect('recettes/' . $id . '/edit')->withErrors($validator);\n } else {\n $recette = Recette::findOrFail($id);\n $recette->nom = $request['nom'];\n $recette->description = $request['description'];\n $recette->prix = $request['prix'];\n $recette->difficulte = $request['difficulte'];\n $recette->nbre_personnes = $request['nbre_personnes'];\n $recette->calories = 0;\n $recette->lipides = 0;\n $recette->glucides = 0;\n $recette->protides = 0;\n $recette->duree_totale = 0;\n $recette->save();\n\n $recette->ingredients()->detach();\n //ajout des ingrédients\n $nbr_ing = count($request->ingredient_id);\n for ($i=0; $i<$nbr_ing; $i++) {\n //avoid duplicates entries\n $exists = $recette->ingredients()\n ->where('id_ingredients', $request->ingredient_id[$i])\n ->exists();\n\n if(!$exists) {\n $ingredient = Ingredient::find($request->ingredient_id[$i]);\n $ingredient_qte = $request->ingredient_qte[$i];\n\n //on suppose que les infos d'un ing. sont stockées pour une qté de 1\n $recette->calories += ($ingredient->calories * $ingredient_qte)/$recette->nbre_personnes;\n $recette->glucides += ($ingredient->glucides * $ingredient_qte)/$recette->nbre_personnes;\n $recette->protides += ($ingredient->protides * $ingredient_qte)/$recette->nbre_personnes;\n $recette->lipides += ($ingredient->lipides * $ingredient_qte)/$recette->nbre_personnes;\n\n $recette->ingredients()->attach($request->ingredient_id[$i], [\n 'id_recettes' => $recette->id,\n 'quantite' => $ingredient_qte\n ]);\n }\n }\n\n Etape::where('id_recettes', $recette->id)->delete();\n //ajout des étapes\n $nbr_etapes = count($request->etapes_new);\n\n for ($i=0; $i<$nbr_etapes; $i++) {\n if($request->etapes_new[$i] != NULL) {\n $etape = new Etape;\n $etape->description = $request->etapes_new[$i];\n $etape->nom = $request->titres[$i];\n $etape->duree = $request->durees[$i];\n $etape->ordre = $i;\n $etape->id_recettes = $recette->id;\n $etape->id_etape_types = $request->type[$i];\n $etape->save();\n\n $recette->duree_totale += $etape->duree;\n }\n }\n\n Media::where('id_recettes', $recette->id)->delete();\n //ajout de l'image\n $image = new Media;\n $image->url = $request->image;\n $image->id_recettes = $recette->id;\n $image->id_media_types = 1;\n $image->save();\n\n $recette->save();\n\n return redirect('recettes');\n }\n }", "public function ActualizarIngredientes()\n{\n\tself::SetNames();\n\tif(empty($_POST[\"codingrediente\"]) or empty($_POST[\"nomingrediente\"]) or empty($_POST[\"cantingrediente\"]))\n\t{\n\t\techo \"1\";\n\t\texit;\n\t}\n\t$sql = \" select nomingrediente from ingredientes where codingrediente != ? and nomingrediente = ? \";\n\t$stmt = $this->dbh->prepare($sql);\n\t$stmt->execute( array($_POST[\"codingrediente\"], $_POST[\"nomingrediente\"]) );\n\t$num = $stmt->rowCount();\n\tif($num == 0)\n\t{\n\t\t$sql = \" update ingredientes set \"\n\t\t.\" nomingrediente = ?, \"\n\t\t.\" cantingrediente = ?, \"\n\t\t.\" costoingrediente = ?, \"\n\t\t.\" unidadingrediente = ?, \"\n\t\t.\" codproveedor = ?, \"\n\t\t.\" stockminimoingrediente = ? \"\n\t\t.\" where \"\n\t\t.\" codingrediente = ?;\n\t\t\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->bindParam(1, $nomingrediente);\n\t\t$stmt->bindParam(2, $cantingrediente);\n\t\t$stmt->bindParam(3, $costoingrediente);\n\t\t$stmt->bindParam(4, $unidadingrediente);\n\t\t$stmt->bindParam(5, $codproveedor);\n\t\t$stmt->bindParam(6, $stockminimoingrediente);\n\t\t$stmt->bindParam(7, $codingrediente);\n\n\t\t$nomingrediente = strip_tags($_POST[\"nomingrediente\"]);\n\t\t$cantingrediente = strip_tags($_POST[\"cantingrediente\"]);\n\t\t$costoingrediente = strip_tags($_POST[\"costoingrediente\"]);\n\t\t$unidadingrediente = strip_tags($_POST[\"unidadingrediente\"]);\n\t\t$codproveedor = strip_tags($_POST[\"codproveedor\"]);\n\t\t$stockminimoingrediente = strip_tags($_POST[\"stockminimoingrediente\"]);\n\t\t$codingrediente = strip_tags($_POST[\"codingrediente\"]);\n\t\t$stmt->execute();\n\n\t\techo \"<div class='alert alert-info'>\";\n\t\techo \"<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>&times;</button>\";\n\t\techo \"<span class='fa fa-check-square-o'></span> EL INGREDIENTE FUE ACTUALIZADO EXITOSAMENTE\";\n\t\techo \"</div>\";\n\t\texit;\n\t}\n\telse\n\t{\n\t\techo \"2\";\n\t\texit;\n\t}\n}", "public function edit($id) {\n $ingredients = Ingredient::all()->toArray();\n $ingredients = array_column($ingredients, 'nom', 'id');\n\n $types = Type::all()->toArray();\n $types = array_column($types, 'nom', 'id');\n\n $recette = Recette::findOrFail($id);\n\n return view(\"recettes.edit\")->with([\n 'ingredients' => $ingredients,\n 'recette' => $recette,\n 'types' => $types\n ]);\n }", "public function edit(CustomIngredients $customIngredients, $id)\n {\n// dd($customIngredients->find($id));\n $data = Array();\n $data['record'] = $customIngredients->find($id);\n $data['ingredValues'] = customIngredientCategory();\n// dd($data['record']);\n// dd(json_decode($data['record']->specs));\n return view('admin/custom-ingredients/create-custom-ingredient', $data);\n }", "public function update(Request $request, $id) {\n $ingredient = Ingredients::find($id);\n\n $ingredient->RID = $request->input('RID');\n $ingredient->Name = $request->input('Name');\n $ingredient->Qty = $request->input('Qty');\n $ingredient->Units = $request->input('Units');\n $ingredient->Comments = $request->input('Comments');\n $ingredient->save();\n\n return \"Sucess updating Ingredient #\" . $ingredient->id;\n }", "public function editAction() {\n \t$id = $this->getInput('id');\n \tlist($info, $itemsList) = Admin_Service_Material::getById($id);\n \tforeach ($itemsList as $key=>$value) {\n\t \t$value['type'] = $value['type'] == 1 ? $this->ITEMTYPE[0] : $this->ITEMTYPE[1];//'gift':礼包,'link':链接\n \t $itemsList[$key] = $value;\n \t}\n \t\n \t$this->assign('info', $info);\n \t$this->assign('itemsList', $itemsList);\n $giftNameList = $this->getGiftName($itemsList);\n $this->assign('giftNameList', $giftNameList);\n \n \t$this->assign('dataType', $info[\"type\"] == 1 ?$this->DATATYPE[0] : $this->DATATYPE[1]);\n $this->assign('dataTypes', $this->DATATYPE);\n }", "public function edit(Inmueble $inmueble)\n {\n //\n }", "public function view_ingredients($id) {\n //permittedArea();\n $data['view_assistant'] = $this->db->get_where('product_ingredients', ['product_preparation' => $id]);\n theme('view_ingredients', $data);\n }", "public function edit(Flavor $flavor)\n {\n //\n }", "public function modIngredient($ingredient = null) {\n\n // Redirect user if it doesn't belong to the selected role\n if( ! $this->verify_min_level(6)) {\n\n // Notifies the user that he does not have permissions\n $this->session->set_flashdata(\"alert\", \"<strong>No tienes permisos para acceder a esta página</strong><br/><br/>\n Por motivos de seguridad hemos cerrado tu sesión.<br/>\n Para acceder de nuevo a la aplicación, vuelve a iniciar sesión\");\n\n return redirect( site_url( '/' ) );\n }\n\n\n // no user? show 404 error\n if($ingredient == null) {\n return show_404();\n }\n\n $ingredientData = $this->ingredient_model->getIngredient($ingredient);\n\n // user doesn't exist?\n if($ingredientData == null) {\n return show_404();\n }\n\n $this->template->setTitle('Modificar ' . $ingredientData->name);\n\n // Load validation library, validation config and validation rules\n $this->load->library(\"form_validation\");\n $this->config->load('form_validation/recipe/ingredient');\n $this->form_validation->set_rules(config_item('create_ingredient_rules'));\n\n if($this->form_validation->run()) {\n\n $this->load->library('slug');\n\n // Load user data\n $ingredient_data['id'] = $this->input->post('id');\n $ingredient_data['name'] = $this->input->post('name');\n $ingredient_data['slug'] = $this->slug->parseSlug($this->input->post('name'));\n\n $this->db->update('ingredients', $ingredient_data, array('id' => $ingredient_data['id']));\n\n if( $this->db->affected_rows() == 1 ) {\n\n // Send flash data\n $this->session->set_flashdata(\"notify\", \"Categoría <strong>\".$ingredient_data[\"name\"].\"</strong> modificada con éxito\");\n\n // Redirect to category list\n return redirect(site_url(\"/ingredients\"));\n }\n }\n\n // View data\n $viewData = [\n 'ingredient' => $ingredientData,\n 'hasRecipes' => $this->ingredient_model->ingredient_hasRecipe($ingredientData->id)\n ];\n\n $this->template->printView('recipes/ingredients/update', $viewData);\n }", "public function edit(Meal $meal)\n {\n //\n }", "public function edit(Meal $meal)\n {\n //\n }", "public function edit($id)\n {\n //\n $ingredient = Ingredient::findOrFail($id);\n return view('ingredient.edit', compact('ingredient'))\n ->with('i', (request()->input('page', 1) - 1) * 5);\n \n }", "public function edit() {\n\t\t\t\n\t\t}", "public function update(Request $request, $id)\n {\n $this->validate($request,[\n 'name_ingredient' => 'required',\n 'select_supplier' => 'required',\n ]);\n $ingredient = Ingredient::find($id);\n //записую значення\n $ingredient->name_ingredient = $request->name_ingredient;\n $ingredient->supplier_id = $request->select_supplier;\n //зберігаю в бд\n $ingredient->save();\n return redirect('/ingredients')->with('success', 'Інгредієнт редаговано!');\n }", "public function update(Request $request)\n {\n $ingredient = Ingredient::where('name', $request->name)->first();\n\n if (isset($ingredient)) \n {\n\n if ($ingredient->name != $request->new_name) \n \n {\n if (!$ingredient->ingredient_exist($request->new_name)) {\n $ingredient->name = $request->new_name;\n $ingredient->update();\n return response()->json([\"succes\" => 'el ingrediente se ha modificado'], 200);\n\n }else{\n return response()->json([\"error\" => 'ya existe un ingrediente con ese nombre'], 400);\n }\n \n }else{\n return response()->json([\"error\" => 'el ingrediente ya tiene ese nombre'], 400);\n }\n\n }else{\n return response()->json([\"error\" => 'el ingrediente a modificar no existe'], 400);\n }\n \n }", "public function actionUpdate($id) {\n $model = $this->findModel($id);\n $items = ArrayHelper::map(\\app\\models\\Usuariostbl::find()->all(), 'id', 'username');\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n\n $cantidadIngredientes = 0;\n //verifica que no vengan vacios\n if (Yii::$app->request->post('cantidad') && Yii::$app->request->post('unidad')) {\n //Se reciben los 3 arreglos enviados atraves de post\n $ingredientes = Yii::$app->request->post('ingrediente');\n $cantidades = Yii::$app->request->post('cantidad');\n $unidades = Yii::$app->request->post('unidad');\n $cantidadIngredientes = count($cantidades);\n }\n\n //se deben buscar en la BD todos los ingredientes asociados a esta receta\n $ingredientesEnBD = \\app\\models\\Recetasproducto::find()->where(['recetastbl_id' => $id])->all();\n $index = 0;\n\n //Se recorren los ingredientes que habia en la BD\n foreach ($ingredientesEnBD as $ingrediente) {\n if ($index < $cantidadIngredientes) {\n //se reemplazan sus valores por los contenidos en los arreglos correspondientes.\n $ingrediente->productostbl_id = $ingredientes[$index + 1];\n $ingrediente->cantidad = $cantidades[$index];\n $ingrediente->unidad = $unidades[$index];\n $ingrediente->save(); //se guardan los nuevos datos en la BD\n }\n else {\n //la receta tiene menos ingredientes que antes, lo restantes se eliminaran.\n $ingrediente->delete();\n }\n\n $index++;\n }\n\n //En caso que hayan nuevos ingredientes, este for los genera y guarda en la BD\n for ($index; $index < $cantidadIngredientes; $index++) {\n //para la lista de ingredientes es index+1\n //se crea una nueva variable que guardara el nuevo ingrediente\n $ingredienteModel = new \\app\\models\\Recetasproducto();\n //se asocia a la receta usando la id\n $ingredienteModel->recetastbl_id = $model->id;\n //se asocia el producto (ingrediente) usando su id\n $ingredienteModel->productostbl_id = $ingredientes[$index + 1];\n //se agrega la cantidad\n $ingredienteModel->cantidad = $cantidades[$index];\n //se agrega la unidad de medida\n $ingredienteModel->unidad = $unidades[$index];\n //se guarda el ingrediente en la BD\n $ingredienteModel->save();\n }\n //Mensaje de exito, que se recupera en el index de Recetastbl o el view\n Yii::$app->getSession()->setFlash('success', 'Receta actualizada con exito.');\n\n return $this->redirect(['view', 'id' => $model->id]);\n }\n else {\n return $this->render('update', [\n 'model' => $model,\n 'items' => $items\n ]);\n }\n }", "function UpdateIngredientRecipe($recipe, $old, $ingredient, $qty, $units){\n\t $recipeid = $this->getRecipeID($recipe);\n\t if(($recipeid != NULL) && ($ingredient != NULL) && ($old != NULL) && ($qty !=NULL) && ($units != NULL))\n\t\t{ \n\t\t if($qty <= 0)\n\t\t return;\n\t\t $count = @mysql_query(\"SELECT COUNT(*) as count FROM Ingredients WHERE (Recipe = '$recipeid' AND IngredientName = '$old')\");\n\t\t $countdata = mysql_fetch_assoc($count);\n\t\t if($countdata['count'] <= 0)\n\t\t print \"Item doesn't exist\";\n\t\t\telse\n\t\t @mysql_query(\"UPDATE Ingredients SET IngredientName = $ingredient,\n \t\t\t Quantity ='$qty', Units = '$units'\n\t\t\t\t\t\t\t WHERE (Recipe = '$recipeid' AND IngredientName = '$old')\");\n\t }\n\t}", "public function edit()\n\t{\n\t\t//\n\t}", "public function edit(Pizza $pizza)\n {\n //\n }", "public function edit(Pizza $pizza)\n {\n //\n }", "public function edit( )\r\n {\r\n //\r\n }", "public function update(Request $request, Ingredient $ingredient)\n {\n // Cara Validasi\n $request->validate([\n 'kode_erp' => 'required|size:7',\n 'nama' => 'required',\n 'kategori_id' => 'required',\n 'uom_id' => 'required',\n 'grade_id' => 'required'\n ], [\n 'kode_erp.required' => 'Kode ERP tidak boleh kosong',\n 'nama.required' => 'Kategori tidak boleh kosong',\n 'kategori_id.required' => 'Kategori tidak boleh kosong',\n 'uom_id.required' => 'Uom tidak boleh kosong',\n 'grade_id.required' => 'Grade tidak boleh kosong'\n ]);\n\n // Cara mass assigment\n Ingredient::where('id', $ingredient->id)\n ->update([\n 'kode_erp' => $request->kode_erp,\n 'nama' => $request->nama,\n 'kategori_id' => $request->kategori_id,\n 'uom_id' => $request->uom_id,\n 'grade_id' => $request->grade_id\n ]);\n\n return redirect('/ingredients')->with('status2', 'Data Ingredient berhasil diubah');\n // return $request;\n }", "public function edit(Food $food)\n {\n //\n }", "public function edit(Food $food)\n {\n //\n }", "public function ver_editar_ingredientes_producto($id_pedido_producto)\n\t{\n\n\t\t$datos['informacion_pedido_producto'] = $this->pedido_model->get_informacion_pedido_producto($id_pedido_producto);\n\n\t\t// Buscamos los ingredientes del pedido_producto\n\n\t\t$datos['informacion_ingredientes_pedido_producto'] = $this->pedido_model->get_ingredientes_pedido_producto($id_pedido_producto);\n\n\t\t// Buscamos informacion del producto: aca habria que comprobar el estado del producto. \n\n\t\t$datos['informacion_producto'] = $this->producto_model->get_informacion_producto($datos['informacion_pedido_producto']['id_producto']);\n\n\t\t// Buscamos los grupos que forman el producto.\n\n\t\t$grupos_producto = $this->producto_model->get_grupos_producto($datos['informacion_pedido_producto']['id_producto']);\n\n\t\t//var_dump($grupos_producto);\n\n\t\t$array_grupos = array();\n\n\t\t$datos['cantidad'] = 0;\n\n\t\tforeach ($grupos_producto as $row) // Recorremos los grupos para traer los ingredientes.\n\t\t{\n\t\t\tchrome_log(\"Grupo: [\".$row['id_grupo'].\"]- \".$row['nombre'].\"]- \".$row['id_producto']);\n\n\t\t\t$grupo['datos_grupo'] = $row;\n\n\t\t\t// Buscamos los ingredientes del grupo: aca habria que comprobar el estado del ingrediente. \n\t\t\t$grupo['ingredientes_grupo'] = $this->producto_model->get_ingredientes_grupo_producto( $row['id_producto'], $row['id_grupo'] );\n\n\t\t\tforeach ($grupo['ingredientes_grupo'] as $key_ingrediente_grupo => $ingrediente_grupo)\n\t\t\t{\t\n\t\t\t\tchrome_log(\"Ingrediente: \".$ingrediente_grupo['nombre']);\n\n\t\t\t\tforeach ($datos['informacion_ingredientes_pedido_producto'] as $key_ingrediente_pedido_producto => $ingrediente_pedido_producto)\n\t\t\t\t{\n\t\t\t\t\tif($ingrediente_grupo['id_ingrediente'] == $ingrediente_pedido_producto['id_ingrediente'] && $row['id_grupo'] == $ingrediente_pedido_producto['id_grupo'])\n\t\t\t\t\t{\n\t\t\t\t\t\t$grupo['ingredientes_grupo'][$key_ingrediente_grupo]['seleccionado'] = TRUE;\n\t\t\t\t\t\t$datos['cantidad']++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tarray_push($array_grupos, $grupo);\n\t\t}\n\n\t\t//print_r($array_grupos);\n\n\t\t$datos['grupos_producto'] = $array_grupos;\n\n\t\t$datos['total'] = 0;\n\n\t\t$this->load->view(self::$solapa.'/ver_editar_pedido_producto2', $datos);\n\t}", "public function edit(Variant $variant)\n {\n //\n }", "public function edit(Ingredient $ingredient)\n {\n $conservations = Conservation::all();\n $diets = Diet::all();\n $intollerances = Intollerance::all();\n\n $diet_ingredients = DB::table('diet_ingredient')->where('ingredient_ID', $ingredient->id)->get();\n $intollerance_ingredients = DB::table('ingredient_intollerance')->where('ingredient_ID', $ingredient->id)->get();\n\n\n $data = [\n 'ingredient' => $ingredient,\n 'conservations' => $conservations,\n 'diets' => $diets,\n 'intollerances' => $intollerances,\n 'diet_ingredients' => $diet_ingredients,\n 'intollerance_ingredients' => $intollerance_ingredients\n ];\n\n return view('user.ingredient.edit', $data);\n }", "public function edit(RecipeList $recipeList)\n {\n //\n }", "public function edit(produit $produit)\n {\n //\n }", "public function edit()\n {\n \n }", "public function edit(ImgProduct $imgProduct)\n {\n //\n }", "public function edit($id)\n {\n $recipe = $this->kitchenRecipeRepository->getRecipe($id);\n $quantity = $this->kitchenIngredientKitchenRecipeRepository->getQuantitiesForIngredients($id);\n $ingredientList = $this->kitchenIngredientRepository->getForComboBox();\n\n\n if (empty($recipe)) {\n abort(404);//если не нашли модель то 404\n }\n\n return view('kitchen.admin.recipes.edit',\n compact('recipe', 'quantity', 'ingredientList'));\n }", "public function edit($id)\n {\n $ingredients = ingredient::findOrFail($id);\n return view('ingredients.edit', compact('ingredients'));\n }", "public function edit(ApertureLuoghiInteresse $apertureLuoghiInteresse)\n {\n //\n }", "public function edit(Produit $produit)\n {\n //\n }", "public function edit(Produit $produit)\n {\n //\n }", "public function edit()\n\t{\n\t\t\n\t}", "public function edit($id)\n {\n $query = $this->items_m->get($id);\n if ($query->num_rows() > 0) {\n $item = $query->row();\n $query_category = $this->categorys_m->get();\n $query_unit = $this->units_m->get();\n $unit[null] = '-Pilih-';\n foreach ($query_unit->result() as $u) {\n\n $unit[$u->unit_id] = $u->name;\n };\n $data = [\n 'page' => 'edit',\n 'row' => $item,\n 'category' => $query_category,\n 'unit' => $unit,\n 'selectedunit' => $item->unit_id\n ];\n $this->template->load('template', 'product/item/item_add', $data);\n } else {\n redirect('auth/blocked');\n }\n }", "public function edit() {\n }", "public function edit()\n {\n \n \n }", "public function edit($data = null)\n {\n $old_recipe = $this->find('first', array('conditions' => array('Recipe.id' => $data['Recipe']['id'])));\n\n // Update data from the old model\n $new_recipe['Recipe']['previous_id'] = $old_recipe['Recipe']['id'];\n $new_recipe['Recipe']['original_id'] = $old_recipe['Recipe']['original_id'];\n $new_recipe['Recipe']['created'] = $old_recipe['Recipe']['created'];\n\n // Update data from the view\n $new_recipe['Recipe']['name'] = $data['Recipe']['name'];\n $new_recipe['Recipe']['price'] = $data['Recipe']['price'];\n\n $new_recipe['Recipe']['intern_product_code'] = $data['Recipe']['intern_product_code'];\n\n\n // Check if any care_labels was given\n if(!empty($data['Yarn']))\n {\n // TODO fix Recipes such if the yarn is changed, change the relation or delete the relation\n $new_recipe['Yarn'] = $data['Yarn']; \n }\n\n if(!empty($data['Category']))\n {\n // TODO fix Recipes such if the yarn is changed, change the relation or delete the relation\n $new_recipe['Category'] = $data['Category']; \n }\n\n // If the save went well\n if(!$this->saveAll($new_recipe))\n {\n return false;\n }\n $new_id = $this->id;\n\n // Upload a new image of the recipe if there is one given\n if(!empty($data['Recipe']['image']) && FileComponent::fileGiven($data['Recipe']['image']))\n {\n // Check if the upload went well (The image is limited to 500 x 500 pixels)\n if(!FileComponent::uploadAndResizeImage($data['Recipe']['image'], $new_id, 'png', 'recipes', 500, 500))\n { \n // Delete the entry in the database\n $this->delete($new_id);\n\n // It did not go well delete the image and inform the user\n SessionComponent::setFlash('Billedet til denne opskrift blev ikke uploadet korrekt. Opskriften blev ikke gemt.'.SessionComponent::read('Message.error.message'), null, array(), 'error');\n return false;\n }\n }\n else\n {\n FileComponent::copyFile($old_recipe['Recipe']['id'],'png', true, 'recipes', $new_id, 'png', true, 'recipes');\n }\n\n // Upload a new pdf of the variant if there is one given\n if(!empty($data['Recipe']['image']) && FileComponent::fileGiven($data['Recipe']['image']))\n {\n // Check if the upload went well\n if(!FileComponent::uploadFile($this->data['Recipe']['pdf'], $new_id, 'pdf', false, 'recipes'))\n { \n // Delete the entry in the database\n $this->delete($new_id);\n\n // It did not go well delete the image and inform the user\n SessionComponent::setFlash('PDF-filen til denne opskrift blev ikke uploadet korrekt. Opskriften blev ikke gemt.'.SessionComponent::read('Message.error.message'), null, array(), 'error');\n return false;\n }\n }\n else\n {\n FileComponent::copyFile($old_recipe['Recipe']['id'],'pdf', false, 'recipes', $new_id, 'pdf', false, 'recipes');\n }\n\n // Update the parrent of the old model\n $old_recipe['Recipe']['parrent_id'] = $new_id;\n $old_recipe = $this->save($old_recipe);\n\n // Update the relation before deleting the old version\n $this->updateYarnRelation($old_recipe['Recipe']['id'], $new_id);\n\n // Set the old version to inactive\n $this->deactivate($old_recipe['Recipe']['id'], true);\n\n // If the save went well\n if(empty($old_recipe))\n {\n return false;\n }\n\n // It all went well\n return true;\n }", "public function edit(Inventario $inventario)\n {\n //\n }", "public function editMethod(){\n $fc=AppController::getInstance();\n $args=$fc->getArgsNum();\n if(!isset($args[0]))exit(header('Location:/error'));\n if(!$good=$this->_db->getGoodBySlug($args[0]))exit(header('Location:/error'));\n //die('<pre>'.var_dump($good));\n\n //создать э-р EditGoodField с иниц-ей полей\n $this->form=$this->_db->formFactory('EditGoodForm');\n $this->form->init($good);\n if($_SERVER['REQUEST_METHOD']=='POST'){\n $this->form->validate();\n if(NULL===$err=$this->form->getErrMsg()){\n $this->form->save();\n if(NULL===$err=$this->form->getErrMsg()){\n if(NULL===$err=$this->_db->saveGood($this->form,$this->_user->id,$good->id)){\n exit(header('Location:/goods/edit/'.$good->slug));\n }else{\n $this->errMsg='Ошибка при создании записи БД. '.$err;\n }\n }else{\n $this->errMsg='Ошибка при сохранении формы '.$err;\n }\n }else{\n $this->errMsg='Ошибка валидации формы. '.$err;\n }\n }\n $fc->setContent($fc->render('goods/edit.twig.html',array('this'=>$this)));\n }", "public function edit(Ingredient $ingredient)\n {\n $ingredients = Ingredient::with('kategori', 'grade', 'uom')->get();\n $data['ingredients'] = Ingredient::all();\n $data['grade'] = Gradelevel::all();\n $data['kategori'] = Kategorilevel::all();\n $data['uom'] = Uomlevel::all();\n return view('ingredients/edit', compact('ingredient', 'data'));\n }", "public function update(Request $request, $id)\n {\n $request->validate([\n 'title' => 'required',\n 'category' => 'required',\n 'time' => 'required',\n 'difficulty' => 'required',\n 'preparation' => 'required',\n // 'cover' => 'required',\n 'ingrdient' => 'required',\n 'persons' => 'required',\n ] , [\n 'title.required' => 'Ingresa el título de la receta',\n 'category.required' => 'Selecciona la categoría de la receta',\n 'time.required' => 'Ingresa el tiempo de preparación de la receta',\n 'difficulty.required' => 'Selecciona la dificultad de la receta',\n 'preparation.required' => 'Ingresa el método de preparación de la receta',\n 'cover.required' => 'Ingresa la imagen de la receta',\n 'ingrdient.required' => 'Ingresa los ingredientes de la receta',\n 'persons.required' => 'Ingresa el número de personas de la receta',\n ]);\n\n\n $r = Recipe::find($id);\n $r->title = $request->title;\n $r->category_id = $request->category;\n $r->time = $request->time;\n $r->difficulty = $request->difficulty;\n $r->preparation = $request->preparation;\n $r->persons = $request->persons;\n\n $old_i = RecipeIngredient::where('recipe_id' , $r->id)->get();\n\n if (count($old_i) > 0) {\n foreach ($old_i as $o_i) {\n $o_i->delete();\n }\n }\n\n foreach ($request->ingrdient as $i) {\n $ri = new RecipeIngredient;\n $ri->recipe_id = $r->id;\n $ri->item = $i;\n $ri->save();\n }\n\n if ($request->cover) {\n @unlink(public_path().'/files/recipes/'.$r->cover);\n $name_cover = md5(uniqid().$request->cover->getClientOriginalName()).'.'.$request->cover->getClientOriginalExtension();\n $r->cover = $name_cover;\n $request->cover->move(public_path().'/files/recipes/' , $name_cover);\n }\n \n $r->save();\n\n return back()->with('msj' , 'Receta actualizada exitosamente');\n }", "public function edit(Chef $chef)\n {\n //\n }", "public function edit()\n {\n \n }", "public function edit()\n {\n \n }", "public function edit()\n {\n \n }", "public function edit(Hiking $hiking)\n {\n //\n }", "public function update(Request $request, $id)\n {\n $nom = $request->input('nom');\n $image = $request->input('image');\n $desi_qt = $request->input('grammage');\n\n $ingredient = ingredient::findOrFail($id);\n $ingredient->nom = $nom;\n $ingredient->desi_qt = $desi_qt;\n $ingredient->image = $image;\n $ingredient->update();\n return redirect()->route('ingredients.index');\n }", "public function edit(Insumo $insumo)\n {\n //\n }", "public function edit(Requisition $requisition)\n {\n //\n }", "public function edit(Shelf $shelf)\n {\n //\n }", "public function edit(Gestionnaire $gestionnaire)\n {\n //\n }", "function a_edit() {\n\t\t$id = isset($_GET[\"id\"]) ? $_GET[\"id\"] : 0;\n\t\t$u=new Gestionnaire($id);\n\t\textract($u->data);\t\n\t\trequire $this->gabarit;\n\t}", "public function update(Request $request, $id)\n {\n $ingredient = Ingredient::findOrFail($id);\n $ingredient->ingredientname = $request->ingredientname;\n \n \n $this->validate($request, [\n 'ingredientname' => 'required',\n 'image' => 'required'\n ]);\n if ($request->hasFile('image')) {\n $ingredient->image = $request->image->store('image', 'public');\n } else {\n $ingredient->image = '';\n }\n\n $ingredient->save();\n\n \n return redirect()->route('ingredient.index') ->with('success','Berjaya Kemaskini Bahan Masakan !!');\n\n }", "public function update(Request $request, $id)\n {\n $receta = Receta::find($id);\n\n $inputs = $request->only('nombre','porciones','preparacion','comedor_id');\n $ingredientes = $request->get('ingredientes');\n\n //dd($inputs);\n\n try{\n \\DB::beginTransaction();\n\n $receta->update($inputs);\n\n $receta->ingredientes()->delete();\n\n //dd($ingredientes);\n\n foreach ($ingredientes as $ingrediente){\n $receta->ingredientes()->create($ingrediente);\n }\n\n //$receta->ingredientes->updateOrCreate($ingredientes);\n\n \\DB::commit();\n $receta->load('ingredientes');\n return $this->jsonMensajeData('Receta Modificada','','success',$receta);\n\n }catch (\\Exception $e){\n \\DB::rollBack();\n return $this->jsonMensajeError('Error',$e->getMessage());\n }\n\n\n }", "public function edit(Entrenador $entrenador)\n {\n //\n }", "public function edit(inversion $inversion)\n {\n //\n }", "public function RicercaPerIngredienti(){\n $pm = FPersistentManager::getInstance();\n $cibi = $pm->loadAllObjects();\n $view = new VRicerca();\n $view->mostraIngredienti($cibi);\n }", "public function edit()\r\n {\r\n //\r\n }", "public function edit()\r\n {\r\n //\r\n }", "public function updateRecipe(Request $request)\n {\n $user = Auth::user();\n $userId = $user->id;\n $recipeId = $request->input('id');;\n $name = $request->input('name');\n $preparation_time = $request->input('preparation_time');\n $cooking_time = $request->input('cooking_time');\n $description = $request->input('description');\n\n DB::update('UPDATE recipes SET name=?, preparation_time=?, cooking_time=?, description=?, updated_at = NOW() WHERE id=? AND user_id=?', [$name, $preparation_time, $cooking_time, $description, $recipeId, $userId]);\n\n ///Update data in recipes_ingredients table\n $ingredientsToUpdate = $request->input('ingredientsToUpdate');\n\n for ($i = 0; $i < count($ingredientsToUpdate); $i++) {\n $quantity = $ingredientsToUpdate[$i]['quantity'];\n $ingredientId = $ingredientsToUpdate[$i]['ingredients_id'];\n\n DB::update('UPDATE recipes_ingredients SET quantity=? WHERE recipes_id=? AND ingredients_id=?', [$quantity, $recipeId, $ingredientId]);\n }\n\n //If there are ingredients to delete, delete ingredients from recipes_ingredients table\n $ingredientsToDelete = $request->input('ingredientsToDelete');\n\n if ($ingredientsToDelete != null) {\n for ($i = 0; $i < count($ingredientsToDelete); $i++) {\n $ingredientId = $ingredientsToDelete[$i]['ingredients_id'];\n\n DB::delete('DELETE FROM recipes_ingredients WHERE recipes_id=? AND ingredients_id=?', [$recipeId, $ingredientId]);\n }\n }\n\n //If user create new ingredients, send data to recipes_ingredients table\n $ingredientsToAdd = $request->input('ingredientsToAdd');\n\n if ($ingredientsToAdd != null) {\n for ($i = 0; $i < count($ingredientsToAdd); $i++) {\n $ingredientId = $ingredientsToAdd[$i]['ingredients_id'];\n $quantity = $ingredientsToAdd[$i]['quantity'];\n\n DB::insert('INSERT INTO recipes_ingredients SET ingredients_id=?, quantity=?, recipes_id=?', [$ingredientId, $quantity, $recipeId]);\n }\n }\n\n return redirect()->route('recipes');\n }", "public function editAction() {}", "public function editGoods()\n {\n return 'JingDong editGoods !';\n }", "public function edit(inscricao $inscricao)\n {\n //\n }", "public function edit()\n {\n }", "public function edit()\n {\n }", "public function edit()\n {\n }", "public function edit(IceTax $iceTax)\n {\n //\n }", "protected function editar()\n {\n }", "public function edit(Requierement $requierement)\n {\n //\n }", "public function edit(producto $producto)\n {\n //\n }", "public function edit(gestionnaire $gestionnaire)\n {\n //\n }", "public function edit() {\n\n }", "public function edit(Stock $stock)\n {\n //\n }", "public function edit(Stock $stock)\n {\n //\n }", "public function update(Request $request, CustomIngredients $customIngredients, $id)\n {\n $data = $request->all();\n// dd($data);\n $record = $customIngredients->find($id);\n// dd($record);\n $record->update($data);\n\n return redirect('admin/custom-ingredients');\n }", "public function edit(Feriado $feriado)\n {\n //\n }", "public function edit(Interest $interest)\n {\n //\n }", "public function edit(Part $part)\n {\n //\n }", "public function edit(Readings $readings)\n {\n //\n }", "public function edit()\r\n\t{\r\n\t\t$id_definition = $this->input->post('id_item_definition');\r\n\r\n\t\t$definition = array();\r\n\t\t$this->item_definition_model->feed_blank_template($definition);\r\n\t\t$this->item_definition_model->feed_blank_lang_template($definition);\r\n\r\n\t\t// Existing\r\n\t\tif ($id_definition)\r\n\t\t{\r\n\t\t\t$definition = $this->item_definition_model->get(array(\r\n\t\t\t\t$this->item_definition_model->get_pk_name() => $id_definition)\r\n\t\t\t);\r\n\r\n\t\t\t$this->item_definition_model->feed_lang_template($id_definition, $definition);\r\n\t\t}\r\n\r\n\t\t$this->template['definition'] = $definition;\r\n\r\n\t\t$this->output('item/definition/edit');\r\n\t}", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }" ]
[ "0.73779166", "0.7203351", "0.7203351", "0.7143182", "0.69203484", "0.6834024", "0.6829307", "0.6812793", "0.6768578", "0.6767342", "0.6697422", "0.66872084", "0.6641014", "0.6633155", "0.6619714", "0.6606978", "0.6598646", "0.6596694", "0.6560675", "0.65435183", "0.65435183", "0.6537372", "0.6514252", "0.64923644", "0.6489578", "0.6474612", "0.647438", "0.647382", "0.6455017", "0.6455017", "0.64515543", "0.6444775", "0.6440455", "0.6440455", "0.64282864", "0.64255995", "0.64252436", "0.64164054", "0.64113224", "0.6404165", "0.63976175", "0.639744", "0.63771516", "0.6375706", "0.63695407", "0.63695407", "0.63630813", "0.6353619", "0.63524365", "0.635196", "0.63446486", "0.63400644", "0.63150096", "0.6302633", "0.62870735", "0.62780243", "0.6265981", "0.6265981", "0.6265981", "0.6257569", "0.625601", "0.62537855", "0.6250989", "0.6245842", "0.62444985", "0.6244352", "0.6236003", "0.62348", "0.6230152", "0.6222611", "0.6219103", "0.621372", "0.621372", "0.621131", "0.6210928", "0.6208661", "0.62084454", "0.6205518", "0.6205518", "0.6205518", "0.61910695", "0.6178652", "0.6173936", "0.6173493", "0.6171046", "0.61701494", "0.61683536", "0.61683536", "0.61664754", "0.6164405", "0.6155132", "0.6153501", "0.6151676", "0.61501896", "0.6148703", "0.6148703", "0.6148703", "0.6148703", "0.6148703", "0.6148703" ]
0.73113155
1
/================================ Edit Meal ===========================
public function editmeal($id) { if($this->uri->segment(3)=="") { $this->session->set_flashdata('err_msg', 'Dont Change the URL physically'); redirect('admin/recipe/viewmeal'); } if ($this->input->server('REQUEST_METHOD') == 'POST') { $data['name']= strip_tags($this->input->post('name')); $name=strip_tags($this->input->post('slug')); $data['slug'] = strtolower(trim(preg_replace('/[^A-Za-z0-9-]+/', '-', $name))); $data['description']= strip_tags($this->input->post('description')); $data['status']= strip_tags($this->input->post('status')); $this->form_validation->set_rules('name', 'Name', 'trim|required'); $this->form_validation->set_rules('description', 'Description', 'trim|required'); $this->form_validation->set_rules('slug', 'Slug', 'trim|required'); if ($this->form_validation->run() == TRUE) { $data_inserted = $this->Meal_type_model->edit_data($data,$id); $this->session->set_flashdata('success_msg', 'Meal edited Successfully'); redirect('admin/recipe/viewmeal'); } } $site_name=$this->config->item('site_name'); $this->template->set('title', 'Edit Meal | '.$site_name); $data_single = $this->Meal_type_model->get_data_by_id($id); $data['meal']=$data_single ; //print_r($data_single);die(); $this->template->set_layout('layout_main', 'front'); $this->template->build('editmeal',$data); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function edit(Meal $meal)\n {\n //\n }", "public function edit(Meal $meal)\n {\n //\n }", "public function update(Request $request, Meal $meal)\n {\n //\n }", "public function update(Request $request, Meal $meal)\n {\n //\n }", "public function edit($id)\n {\n $meal = Meal::find($id);\n return view ('adminpages.mealsAddNext')->withMeal($meal);\n }", "public function edit() {\n\t\t\t\n\t\t}", "public function edit()\n\t{\n\t\t//\n\t}", "public function edit( )\r\n {\r\n //\r\n }", "public function edit($id)\n {\n $meal = Meal::find($id);\n\n return view('meal.editmealform')->with(compact('meal'));\n }", "public function update(Request $request, $id)\n {\n $meal = Meal::find($id);\n \n $meal->name = $request->input('name');\n $meal->price = $request->input('price');\n $meal->description = $request->input('description');\n\n # TODO: Make all the letter of the meal type lowercase \n $meal->menu_type = $request->input('meal_type');\n \n if ( $meal->save() ) {\n return redirect('meal');\n }\n }", "public function edit()\n\t{\n\t\t\n\t}", "public function edit($id)\n {\n // find meal\n $meal = Meal::findOrFail($id);\n // show edit view\n return view('meal.edit', compact('meal'));\n }", "public function edit()\n {\n \n }", "public function editAction() {\n \t$id = $this->getInput('id');\n \tlist($info, $itemsList) = Admin_Service_Material::getById($id);\n \tforeach ($itemsList as $key=>$value) {\n\t \t$value['type'] = $value['type'] == 1 ? $this->ITEMTYPE[0] : $this->ITEMTYPE[1];//'gift':礼包,'link':链接\n \t $itemsList[$key] = $value;\n \t}\n \t\n \t$this->assign('info', $info);\n \t$this->assign('itemsList', $itemsList);\n $giftNameList = $this->getGiftName($itemsList);\n $this->assign('giftNameList', $giftNameList);\n \n \t$this->assign('dataType', $info[\"type\"] == 1 ?$this->DATATYPE[0] : $this->DATATYPE[1]);\n $this->assign('dataTypes', $this->DATATYPE);\n }", "public function edit(Msoal $msoal)\n {\n //\n }", "public function edit()\n {\n \n \n }", "public function edit() {\n }", "public function edit(){\r\n\t\t//$this->auth->set_access('edit');\r\n\t\t//$this->auth->validate();\r\n\r\n\t\t//call save method\r\n\t\t$this->save();\r\n\t}", "public function edit($id)\n {\n $element = Meal::find($id);\n $departments = Department::all();\n $products = Product::query()->where('company_id',auth('company')->user()->id)->get();\n\n return view('Company.meals.edit',compact('element','departments','products'));\n }", "public function edit()\r\n {\r\n //\r\n }", "public function edit()\r\n {\r\n //\r\n }", "public function edit(Movel $movel)\n {\n //\n }", "public function update(Request $request, meal $meal)\n {\n $request->validate([\n 'meal_name'=>'required',\n 'meal_price'=>'required|number',\n 'meal_pic'=>'required'\n ]);\n\n meal::update($request->all());\n\n return back()->with('success','Meal updated successfully');\n }", "public function editAction() {\r\n\t\t$id = $this->getInput('id');\r\n\t\t$info = Gou_Service_Notice::getNotice(intval($id));\r\n\t\t$this->assign('info', $info);\r\n\t\t$this->assign('channels', $this->channels);\r\n\t}", "public function edit()\n {\n \n }", "public function edit()\n {\n \n }", "public function edit()\n {\n \n }", "public function edit(meal $meal)\n {\n return view('meals.edit',compact('meal'));\n }", "private function updateModal(){\n $pId = $_REQUEST['info'];\n\n $this->assign('partnerId', $pId);\n $this->assign('partner', $this->getPartnerById($pId));\n $this->display('partners/edit.tpl');\n }", "public function edit()\n {\n }", "public function edit()\n {\n }", "public function edit()\n {\n }", "public function update(Request $request, $id)\n {\n // validate form\n $validatedData = $request->validate([\n 'name' => 'required|max:255',\n 'status' => 'required',\n ]);\n // we can only have one open meal\n $meal = Meal::where('status', 'open')->first();\n if ($meal && $validatedData['status']=='open') {\n return redirect('/meals')->with('error', 'There is already an open meal!');\n }\n // update meal\n Meal::whereId($id)->update($validatedData);\n // go back to meals\n return redirect('/meals')->with('success', 'Meal is successfully saved');\n }", "public function editinformation() \n {\n UserModel::authentication();\n \n //get the session user\n $user = UserModel::user();\n\n UserModel::update_profile();\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit(Lawyer $lawyer)\n {\n //\n }", "public function action_edit()\n\t{\n\t\t$view = View::factory('story/incomplete');\n\t\t$this->response->body($view);\n\t}", "public function editAction() {\n\t\t$id = $this->getInput('id');\n\t\t$info = Activity_Service_ShareQq::get(intval($id));\n\t\t$this->assign('info', $info);\n\t}", "public function edit(RemedialFeedback $remedialFeedback)\n {\n //\n }", "public function edit()\n { \n }", "public function editAction() {\n\t\t$id = $this->getInput('id');\n\t\t$info = Fj_Service_Goods::getGoods(intval($id));\n $this->assign('dir', \"goods\");\n $this->assign('ueditor', true);\n\t\t$this->assign('info', $info);\n\t}", "public function edit(IntentionToPay $intentionToPay)\n {\n //\n }", "public function Edit()\n\t{\n\t\t\n\t}", "public function editUser()\n {\n\n $this->displayAllEmployees();\n $new_data = [];\n $id = readline(\"Unesite broj ispred zaposlenika čije podatke želite izmjeniti: \");\n\n $this->displayOneEmployees( $id);\n\n foreach ( $this->employeeStorage->getEmployeeScheme() as $key => $singleUser) { //input is same as addUser method\n\n $userInput = readline(\"$singleUser : \");\n $validate = $this->validateInput($userInput, $key);\n\n while (!$validate)\n {\n $userInput = readline(\"Unesite ispravan format : \");\n $validate = $this->validateInput($userInput, $key);\n\n }\n if ($key === 'income'){\n $userInput = number_format((float)$userInput, 2, '.', '');\n }\n\n $new_data[$key] = $userInput;\n\n }\n $this->employeeStorage->updateEmployee($id, $new_data); //sends both id and data to updateEmployee so the chosen employee can be updated with new data\n\n echo \"\\033[32m\". \"## Izmjene za \". $new_data['name'].\" \". $new_data['lastname'].\" su upisane! \\n\\n\".\"\\033[0m\";\n\n }", "function updategoal()\n {\n $goalid = $this->value('id');\n $status = $this->value('status');\n $userdetails = $this->userInfo();\n\t\t\n\t\t\n\t\t\n\t\t$application_path = $this->config['application_path'];\n\t\t$telespine_id = $this->config['telespineid'];\n\t\t\n\t\t$business_url = $this->config['business_telespine']; \n\t\t$support_email = $this->config['email_telespine'];\n\t\t$images_url=$this->config['images_url'];\n\t\t$data['images_url'] = $images_url;\n\t\t$data['support_email'] = $support_email ;\n $data['loginurl']=$this->config['telespine_login'];\n\t\t$result = $this->execute_query(\"UPDATE patient_goal SET status = {$status},update_date=now() WHERE patient_goal_id = {$goalid}\");\n\t\t\n\t\t\n\t\tif($status==2){\n\t\t$templatePath = $application_path.\"mail_content/telespine/goal_completed.php\";\n\t\t$fullname = $userdetails['name_first'].' '.$userdetails['name_last'];\n\t\t$data['fullname'] = $fullname;\n\t\t$message = $this->build_template($templatePath,$data);\n\t\t$data['support_email'] = $support_email;\n\t\t\n\t\t$to = $fullname.'<'.$userdetails['username'].'>';\n\t\t$subject =\"Telespine Update - Good for You!\";\n\t\t// To send HTML mail, the Content-type header must be set\n\t\t$headers = 'MIME-Version: 1.0' . \"\\n\";\n\t\t$headers .= 'Content-type: text/html; charset=iso-8859-1' . \"\\n\";\n\t\t$headers .= \"From: Telespine Support<\".$support_email.\">\" . \"\\n\";\n\t\t$returnpath = \"-f\".$support_email;\n\t\t@mail($to, $subject, $message, $headers, $returnpath); \n\t\t}\n\t\t\n\n echo $this->getCompletedGoals($userdetails['user_id']);\n }", "public function edit() {\n\n }", "public function update(Request $request, $id)\n {\n $meal = Meal::find($id);\n //validate the data\n $this->validate($request, array(\n 'ingredients'=>'required|min:5',\n 'method'=>'required|min:5'\n ));\n $recipe = new Recipe;\n $recipe->meal_id = $request->meal_id;\n $recipe->ingredients = $request->ingredients;\n $recipe->method = $request->method;\n $recipe->save();\n Session::flash('success','The meal has successfully been added');\n return redirect('/meals');\n }", "public function edit_postAction() {\n\t\t$info = $this->getPost(array('status','id','award'));\n\t\t$ret = Gc_Service_OrderShow::updateOrderShow($info, intval($info['id']));\n\t\tif (!$ret) $this->output(-1, '操作失败');\n\t\t$this->output(0, '操作成功.');\n\t}", "function editRent($data) {\n\t\t\t$conn = $this->connect();\n\t\t\t$rent = $this->modify(mysqli_real_escape_string($conn, $data['rent']));\n\t\t\t$uid = $_SESSION['userid'];\n\t\t\t$pid = $_SESSION['pid'];\n\t\t\tif(empty($rent)) {\n\t\t\t\t$this->re_direct(\"mypost_details\", \"post_id=\".$pid.\"&Empty\");\n\t\t\t} else {\n\t\t\t\tif(preg_match(\"/^[0-9]+$/\", $rent)) {\n\t\t\t\t\tif($this->length($rent, 8, 3)) {\n\t\t\t\t\t\t$result = $this->changepost('newpost', 'post_rent', $rent, $uid , $pid);\n\t\t\t\t\t\tif($result == true) {\n\t\t\t\t\t\t\t$this->re_direct(\"mypost_details\", \"post_id=\".$pid.\"&Successfully_Changed\");\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$this->re_direct(\"mypost_details\", \"post_id=\".$pid.\"&Failed!\");\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$this->re_direct(\"mypost_details\", \"post_id=\".$pid.\"&length=tooBigOrSmall\");\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$this->re_direct(\"mypost_details\", \"post_id=\".$pid.\"&invalid=type\");\n\t\t\t\t}\n\t\t\t}\n\t\t}", "public function edit($id)\n {\n $data['dalyExpense'] = DB::table('personal_expense')\n ->where('id',$id)\n ->first();\n\n $data['title'] = \"Update Personal Expenses\";\n return view(\"admincontrol.personalexpenses.update\",$data);\n }", "function update_office_info()\n {\n $this->model->update_office_info();\n }", "public function edit(BotSpeak $botSpeak)\n {\n //\n }", "public function edit(Anime $anime)\n {\n //\n }", "public function edit($id)\n {\n $this->updateMode = true;\n $trays = tray::findOrFail($id);\n $this->tray_id = $id;\n\n $this->name = $trays->name;\n $this->logo = $trays->logo;\n $this->email = $trays->email;\n $this->phone = $trays->phone;\n $this->fax = $trays->fax;\n $this->address = $trays->address;\n $this->facebook = $trays->facebook;\n $this->instagram = $trays->instagram;\n $this->youtube = $trays->youtube;\n $this->viber = $trays->viber;\n $this->whatsapp = $trays->whatsapp;\n $this->url = $trays->url;\n //$this->openModal();\n }", "public function edit(Personal $personal)\n {\n //\n }", "public function edit(Personal $personal)\n {\n //\n }", "public function edit(Complain $complain)\n {\n //\n }", "public function edit()\n {\n\n }", "public function edit()\n {\n\n }", "public function edit()\n {\n\n }", "public function edit()\n {\n\n }", "public function edit()\n { }", "public function edit(Pengumuman $pengumuman)\n {\n //\n }", "public function editAction() {\n $id = $this->getInput('id');\n $info = Client_Service_Ad::getAd(intval($id));\n \n $this->assign('ad_type', self::AD_TYPE);\n $this->assign('ad_ptypes', $this->ad_ptypes);\n $this->assign('info', $info);\n }", "public function editAction(){\n\t\t$recipe = new Recipe();\n\t\t\n\t\t//updating the meal\n\t\tif ($this->_request->isPost()) {\n\t\n\t\t\t$data = $this->_validateRecipe();\n\t\t\t//if no errors validating fields add recipe\n\t\t\tif ($this->view->errorMsg == null) {\n\t\t\t\t$recipe_id = $this->_request->getPost('recipe_idTF');\n\t\t\t\t\n\t\t\t\t//make sure recipe with this name does not already exist\n\t\t\t\t$where = array(\n\t\t\t\t\t$recipe->getAdapter()->quoteInto('user_id = ?', $this->session->user_id),\n\t\t\t\t\t$recipe->getAdapter()->quoteInto('recipe_id != ?', $recipe_id),\n\t\t\t\t\t$recipe->getAdapter()->quoteInto('title = ?', $data['recipe']['title']),\n\t\t\t\t\t'status is null'\n\t\t\t\t); \n\t\t\t\t$recipe_row = $recipe->fetchRow($where);\n\t\t\t\tif($recipe_row != null){\n\t\t\t\t\t$this->view->errorMsg = 'Meal \"'.$data['recipe']['title'].'\" already exists, please use a different title.';\n\t\t\t\t\t$data['recipe']['recipe_id'] = $recipe_id;\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t//update recipe\n\t\t\t\t\t$where = $recipe->getAdapter()->quoteInto('recipe_id = ?', $recipe_id);\n\t\t\t\t\t$recipe->update($data['recipe'], $where);\n\t\n\t\t\t\t\t//delete old recipexquantityxingredients\n\t\t\t\t\t$rxqxi = new RecipexQuantityxIngredient();\n\t\t\t\t\t$where = $rxqxi->getAdapter()->quoteInto('recipe_id = ?', $recipe_id);\n\t\t\t\t\t$rxqxi->delete($where);\n\t\t\t\t\t\n\t\t\t\t\t$this->_saveRecipexQuantityxIngredient($recipe_id, $data);\n\t\t\n\t\t\t\t\t//if successful, redirect to main page\n\t\t\t\t \t$this->_redirect($this->baseUrl.'/meals');\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\n\t\t\t$this->view->recipe_data = $data;\t\t\n\t\t}\n\t\t//get meal to display in edit form\n\t\telse{\n\t\t\t$filter = new Zend_Filter_StripTags();\n\t\t\t$id = trim($filter->filter($this->_request->getQuery('id')));\n\t\t\tif($id != null){\n\t\t\t\t$where = $recipe->getAdapter()->quoteInto('recipe_id = ?', $id);\n\t\t\t\t$row = $recipe->fetchRow($where);\n\t\t\n\t\t\t\t$data = $this->_getRecipe($row);\n\t\t\t\t$this->view->recipe_data = $data;\n\t\t\n\t\t\t}\n\t\t}\n\t\n\n\t\t//populate amounts and ingredients for autocomplete textfields (COPY&PASTE = YUCK!)\n \t$ingredient_arr = array();\n \t$ingredient = new Ingredient();\n\t\t$ingredient_rs = $ingredient->fetchAll();\n\t\t$i = 0;\n\t\twhile($ingredient_rs->valid()){\n\t\t\t$ingredient = $ingredient_rs->current();\n\t\t\t$ingredient_arr[$i] = $ingredient->name;\n\t\t\t$i++;\n\t\t\t$ingredient_rs->next();\n\t\t}\n \t$this->view->ingredient_data = $ingredient_arr;\n\t\n \t$amount_arr = array();\n \t$quantity = new Quantity();\n\t\t$quantity_rs = $quantity->fetchAll();\n\t\t$i = 0;\n\t\twhile($ingredient_rs->valid()){\n\t\t\t$amount = $quantity_rs->current();\n\t\t\tif($amount->measure != null) $amount_arr[$i] = $this->_convertd2f($amount->amount).' '.$amount->measure;\n\t\t\telse $amount_arr[$i] = $amount->amount;\n\t\t\t$i++;\n\t\t\t$quantity_rs->next();\n\t\t}\n \t$this->view->amount_data = $amount_arr;\n \t\n \t\n \t\n \t// additional view fields required by form\n\t\t$this->view->action = 'edit';\n\t\t$this->_helper->viewRenderer->setNoRender();\n\t\t$this->render('add');\n }", "function editItem() {\n\t\tglobal $HTML;\n\t\t$HTML->details(1);\n\t\t$name = stringOr($this->vars[\"name\"], $this->getQueryResult(0, \"name\"));\n\n\t\t$_ = '';\n\t\t$_ .= $HTML->head($this->translate(\"Edit point name\"));\n\t\t$_ .= $HTML->block($this->translate(\"Point\").\":\", $this->getQueryResult(0, \"file\"));\n\t\t$_ .= $HTML->input($this->varnames[\"name\"], \"name\", $name);\n\n\t\treturn $_;\n\t}", "public function edit(Woman $woman)\n {\n //\n }", "public function edit(UserPersonalInfo $userPersonalInfo)\n {\n //\n }", "public function update()\n\t{\n\t\t$id = Input::get('id');\n\t\t\n\t\t$validation = Validator::make(Input::all(),\n\t\t[\n\t\t\t'description'\t=>\t'required',\n\t\t\t'memo'\t\t\t=>\t'',\n\t\t\t'amount'\t\t=>\t'required|numeric',\n\t\t\t'quantity'\t\t=>\t'required|numeric'\n\t\t]);\n\t\t\n\t\t$errorMessages = new MessageBag;\n\t\t\n\t\tif($validation->fails()){\n\t\t\t$errorMessages->merge($validation->errors()->toArray());\n\t\t}\n\t\t\n\t\t$data = Input::all();\n\t\t\n\t\t$cashInHand = Expense::cashInHand();\n\t\t\n\t\t$ex = ($data['amount'] * $data['quantity']);\n\t\t\n\t\tif($ex > $cashInHand){\n\t\t\t$errorMessages->add('amount', 'You cannot make an expense exceeding cash in hand');\n\t\t}\n\t\t\n\t\tif(count($errorMessages) > 0){\n\t\t\treturn Redirect::route('getExpenses')\n\t\t\t\t\t->withInput()\n\t\t\t\t\t->withErrors($errorMessages)\n\t\t\t\t\t->with('modal','#myModal');\n\t\t} else {\n\t\t\t$expense = Expense::find($id);\n\t\t\t\n\t\t\t$expense->description = Input::get('description');\n\t\t\t$expense->memo = Input::get('memo');\n\t\t\t$expense->amount = Input::get('amount');\n\t\t\t$expense->quantity = Input::get('quantity');\n\t\t\t\n\t\t\tif($expense->save()){\n\t\t\t\treturn Redirect::route('getExpenses')->with('success', 'Edited successfully');\n\t\t\t} else {\n\t\t\t\treturn Redirect::route('getExpenses')->with('fail', 'An error ocurred while editing the expense');\n\t\t\t}\n\t\t}\n\t}", "public function edit(Hiking $hiking)\n {\n //\n }", "function a_edit() {\n\t\t$id = isset($_GET[\"id\"]) ? $_GET[\"id\"] : 0;\n\t\t$u=new Gestionnaire($id);\n\t\textract($u->data);\t\n\t\trequire $this->gabarit;\n\t}", "function doEdit() {\n\t\t\n\t\t// Require a validated association \n\t\tProfileAssociationValidRequired::check();\r\n\t\n\t\t// Get the annonce\r\n\t\t$this->fetchAnnonce();\n\t\t\n\t\t// We should have write access to this annonce\r\n\t\t$this->checkWriteAccess();\n\t\t\n\t\t// Delete old version\n\t\t$this->annonce->delete();\r\n\t\n\t\t// Populate from request\n\t\t$this->populateAnnonce();\n\t\t\n\t\t// Publish new one\n\t\t$this->annonce->publish();\n\t\t\n\t\t// Success\n\t\t$this->setSuccess(_(\"Annonce mise à jour\"));\n\t\t\r\n\t\t// Redirect to the details\r\n\t\t$this->details();\r\n\t}", "public function edit()\n {\n return \"Ini Halaman Edit\";\n }", "public function edit()\n {\n //\n\t\treturn 'ini halaman edit';\n }", "public function update($mealitem_data): MealItem\n {\n $meal_item = MealItem::updateOrcreate(\n ['id' => $mealitem_data['meal_item']],\n $mealitem_data\n );\n Cache::put(\"meal-item-$meal_item->id\",$meal_item);\n\n return $meal_item;\n }", "protected function editar()\n {\n }", "public function edit(Deneme $deneme)\n {\n //\n }", "public function edit(Bacheo $bacheo)\n {\n //\n }", "public function edit(FangOwner $fangOwner)\n {\n\n }", "public function edit($id)\n {\n //\n $hospital = hospitals::find($id);\n $new_messages = Messages::orderBy('created_at', 'desc')->where('receiver_id', auth()->user()->id)->where('status', 'unread')->get();\n $data = array(\n 'hospital' => $hospital,\n 'new_messages' => $new_messages\n );\n\n return view('hospitals.edit', $data);\n }", "public function edit(Emploitime $emploitime)\n {\n //\n }", "public function editpersonalinfo($id)\n {\n $person =DB::table('masterfile')->find($id);\n if ($person == true) {\n return view('admin.manpowerfiles.editpersonalinfo', compact('person'));\n }else{\n return redirect('/admin');\n }\n \n }", "function edit(){\n if (!empty($this->data)){\n if ($this->User->save($this->data)){\n $this->Session->setFlash(\"Your account has been updated successfully\");\n $this->go_back();\n } \n }else{\n $this->User->id = $this->Session->read(\"Auth.User.id\");\n $this->data = $this->User->read();\n }\n }", "public function update($mambot);", "public function editGoods()\n {\n return 'JingDong editGoods !';\n }", "function user_edit($user_info)\n {\n }", "public function edit($goal){\n $em = $this->getDoctrine()->getManager();\n\n $goal->setCorrectPrize();\n\n // Store in DB\n $em->persist($goal);\n $em->flush();\n\n return $goal;\n }", "public function edit(bloodReq $bloodReq)\n {\n //\n }" ]
[ "0.697682", "0.697682", "0.6557661", "0.6557661", "0.6536753", "0.6368054", "0.63074857", "0.6305024", "0.62664324", "0.6237953", "0.6214481", "0.61829865", "0.61816096", "0.61757195", "0.6162763", "0.6148498", "0.6126444", "0.61054915", "0.609867", "0.60879827", "0.60879827", "0.6077519", "0.6073897", "0.60637033", "0.6057791", "0.6057791", "0.6057791", "0.60033005", "0.59987295", "0.5984578", "0.5984578", "0.5984578", "0.5975999", "0.59655833", "0.59654206", "0.59654206", "0.59654206", "0.59654206", "0.59654206", "0.59654206", "0.59654206", "0.59654206", "0.59654206", "0.59654206", "0.59654206", "0.59654206", "0.5959495", "0.59430075", "0.59423184", "0.5941516", "0.5929419", "0.5928", "0.59200597", "0.5913635", "0.59074867", "0.5902273", "0.58954304", "0.5893349", "0.5891337", "0.58912337", "0.5888448", "0.58861536", "0.58807737", "0.5878904", "0.5871727", "0.58709764", "0.5869843", "0.5869843", "0.5860377", "0.5858636", "0.5858636", "0.5858636", "0.5858636", "0.58450866", "0.58409023", "0.5825667", "0.58250225", "0.5812079", "0.580656", "0.57930636", "0.57911277", "0.5781616", "0.5777181", "0.5776143", "0.5771672", "0.5762856", "0.57541335", "0.5750139", "0.57488316", "0.5747894", "0.5747456", "0.57406306", "0.57359284", "0.5734784", "0.57339567", "0.57306355", "0.5728752", "0.5727552", "0.5724292", "0.57153875" ]
0.59580284
47
/================================ Edit Nutritional ===========================
public function editnutritionalelements($id) { if($this->uri->segment(3)=="") { $this->session->set_flashdata('err_msg', 'Dont Change the URL physically'); redirect('admin/recipe/viewnutritionalelements'); } if ($this->input->server('REQUEST_METHOD') == 'POST') { $data['name']= strip_tags($this->input->post('name')); $name=strip_tags($this->input->post('slug')); $data['slug'] = strtolower(trim(preg_replace('/[^A-Za-z0-9-]+/', '-', $name))); $data['description']= strip_tags($this->input->post('description')); $data['status']= strip_tags($this->input->post('status')); $this->form_validation->set_rules('name', 'Name', 'trim|required'); $this->form_validation->set_rules('description', 'Description', 'trim|required'); $this->form_validation->set_rules('slug', 'Slug', 'trim|required'); if ($this->form_validation->run() == TRUE) { $data_inserted = $this->Nutritional_elements_model->edit_data($data,$id); $this->session->set_flashdata('success_msg', 'Nutritional edited Successfully'); redirect('admin/recipe/viewnutritionalelements'); } } $site_name=$this->config->item('site_name'); $this->template->set('title', 'Edit Nutritional | '.$site_name); $data_single = $this->Nutritional_elements_model->get_data_by_id($id); $data['nutritional']=$data_single ; //print_r($data_single);die(); $this->template->set_layout('layout_main', 'front'); $this->template->build('editnutritionalelements',$data); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function addNutritionalBenefit(){\n \t$id = $this->formValueForKey(\"nutritionalBenefitSelection\");\n \n \t$foundNutritionalBenefit = BLGenericRecord::recordMatchingKeyAndValue(\"NutritionalBenefit\", \"id\", $id);\n \t$this->currentRecipe()->addNutritionalBenefit($foundNutritionalBenefit);\n }", "function a_edit() {\n\t\t$id = isset($_GET[\"id\"]) ? $_GET[\"id\"] : 0;\n\t\t$u=new Gestionnaire($id);\n\t\textract($u->data);\t\n\t\trequire $this->gabarit;\n\t}", "public function editnutration($id)\n {\n $dietPlan = false;\n if((Auth::check()) && (Auth::user()->is_admin == 1)){\n $nutration = Nutration::find($id);\n $categories = NutrationCategory::all();\n if(($nutration->nutration_categorys_id) && ($nutration->is_seven == 1)){\n $nutration = SevenDayPlan::where('nutration_id',$id)->first(); \n $dietPlan = true;\n return view('admin.editsevenddays')->with('nutration',$nutration)->with('NutrationCategory',$categories)->with('dietplan',$dietPlan)->with('id',$id);\n }\n /*$isFoodplan = $workout->nutration_categorys_id;\n if($isFoodplan){\n $workout = SevenDayPlan::where('nutration_id',$id)->first();\n }*/\n return view('admin.editnutration')->with('nutration',$nutration)->with('NutrationCategory',$categories)->with('dietplan',$dietPlan)->with('id',$id);\n }\n\n else{\n Session::flash('danger','You are not authorize to view this page');\n return redirect()->back();\n }\n }", "public function edit(Rental $rental)\n {\n //\n }", "public function edit($id)\n {\n $entry = Nutrition::find($id);\n return view('modify', ['entry'=>$entry]);\n }", "function editTypeOfRent($data) {\n\t\t\t$conn = $this->connect();\n\t\t\t$tOFr = $this->modify(mysqli_real_escape_string($conn, $data['tOFr']));\n\t\t\t$uid = $_SESSION['userid'];\n\t\t\t$pid = $_SESSION['pid'];\n\t\t\tif(empty($tOFr)) {\n\t\t\t\t$this->re_direct(\"mypost_details\", \"post_id=\".$pid.\"&Empty\");\n\t\t\t} else {\n\t\t\t\tif(preg_match(\"/^[a-z ]+$/i\", $tOFr)) {\n\t\t\t\t\tif($this->length($tOFr, 25, 3)) {\n\t\t\t\t\t\t$result = $this->changepost('newpost', 'post_type_of_Rent', $tOFr, $uid , $pid);\n\t\t\t\t\t\tif($result == true) {\n\t\t\t\t\t\t\t$this->re_direct(\"mypost_details\", \"post_id=\".$pid.\"&Successfully_Changed\");\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$this->re_direct(\"mypost_details\", \"post_id=\".$pid.\"&Failed!\");\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$this->re_direct(\"mypost_details\", \"post_id=\".$pid.\"&length=tooBigOrSmall\");\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$this->re_direct(\"mypost_details\", \"post_id=\".$pid.\"&invalid=type\");\n\t\t\t\t}\n\t\t\t}\n\t\t}", "public function edit() {\n\t\t\t\n\t\t}", "public function edit(IceTax $iceTax)\n {\n //\n }", "function Specialities_Update(){\n\t\t\n\t\t//when click on button\n\t\tif(isset($_POST['updatesp'])){\n\t\t\t\n\t\t\t\t// get id move to variable\n\t\t\t$get_id = $_GET['Edit'];\n\t\t\t\n\t\t\t//values for Specialities table\n\t\t\t$values = \"specialitie_name='\".$_POST['sp'].\"'\";\n\t\t\t\n\t\t // update Specialities from table\n\t\t $this->Update('specialities',$values,\"where id='$get_id'\",'Specialities?m');\n\t\t} // ifisset close\n\t}", "public function edit(gestionnaire $gestionnaire)\n {\n //\n }", "public function edit()\n\t{\n\t\t//\n\t}", "function edit($situation_id)\n { \n // check if the situation exists before trying to edit it\n $data['situation'] = $this->Situation_model->get_situation($situation_id);\n \n if(isset($data['situation']['situation_id']))\n {\n $this->load->library('form_validation');\n\n\t\t\t$this->form_validation->set_rules('quartier_sid','Quartier Sid','required');\n\t\t\n\t\t\tif($this->form_validation->run()) \n { \n $params = array(\n\t\t\t\t\t'quartier_sid' => $this->input->post('quartier_sid'),\n\t\t\t\t\t'intitule' => $this->input->post('intitule'),\n\t\t\t\t\t'avenue_sid' => $this->input->post('avenue_sid'),\n\t\t\t\t\t'cellule_sid' => $this->input->post('cellule_sid'),\n\t\t\t\t\t'date_jour_situation' => $this->input->post('date_jour_situation'),\n\t\t\t\t\t'date_created' => $this->input->post('date_created'),\n\t\t\t\t\t'last_update' => $this->input->post('last_update'),\n\t\t\t\t\t'contenu_situation' => $this->input->post('contenu_situation'),\n );\n\n $this->Situation_model->update_situation($situation_id,$params); \n redirect('situation/index');\n }\n else\n {\n\t\t\t\t$this->load->model('Quartier_model');\n\t\t\t\t$data['all_quartiers'] = $this->Quartier_model->get_all_quartiers();\n\n $data['_view'] = 'situation/edit';\n $this->load->view('layouts/main',$data);\n }\n }\n else\n show_error('The situation you are trying to edit does not exist.');\n }", "public function edit( )\r\n {\r\n //\r\n }", "public function edit()\n\t{\n\t\t\n\t}", "function editRent($data) {\n\t\t\t$conn = $this->connect();\n\t\t\t$rent = $this->modify(mysqli_real_escape_string($conn, $data['rent']));\n\t\t\t$uid = $_SESSION['userid'];\n\t\t\t$pid = $_SESSION['pid'];\n\t\t\tif(empty($rent)) {\n\t\t\t\t$this->re_direct(\"mypost_details\", \"post_id=\".$pid.\"&Empty\");\n\t\t\t} else {\n\t\t\t\tif(preg_match(\"/^[0-9]+$/\", $rent)) {\n\t\t\t\t\tif($this->length($rent, 8, 3)) {\n\t\t\t\t\t\t$result = $this->changepost('newpost', 'post_rent', $rent, $uid , $pid);\n\t\t\t\t\t\tif($result == true) {\n\t\t\t\t\t\t\t$this->re_direct(\"mypost_details\", \"post_id=\".$pid.\"&Successfully_Changed\");\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$this->re_direct(\"mypost_details\", \"post_id=\".$pid.\"&Failed!\");\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$this->re_direct(\"mypost_details\", \"post_id=\".$pid.\"&length=tooBigOrSmall\");\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$this->re_direct(\"mypost_details\", \"post_id=\".$pid.\"&invalid=type\");\n\t\t\t\t}\n\t\t\t}\n\t\t}", "public function edit(Territory $territory)\n {\n //\n }", "function edit($ordon_id)\n { \n // check if the ordonance exists before trying to edit it\n $data['ordonance'] = $this->Ordonance_model->get_ordonance($ordon_id);\n \n if(isset($data['ordonance']['ordon_id']))\n {\n if(isset($_POST) && count($_POST) > 0) \n { \n $params = array(\n\t\t\t\t\t'malade_noms' => $this->input->post('malade_noms'),\n 'malade_age' => $this->input->post('malade_age'),\n \n 'malade_telephone' => $this->input->post('malade_telephone'),\n\t\t\t\t\t'ordonance_numero' => $this->input->post('ordonance_numero'),\n\t\t\t\t\t'ordonance_date' => $this->input->post('ordonance_date'),\n\t\t\t\t\t'nom_medecin' => $this->input->post('nom_medecin'),\n 'spec_medecin' => $this->input->post('spec_medecin'),\n\t\t\t\t\t'ordonance_details' => $this->input->post('ordonance_details'),\n );\n\n $this->Ordonance_model->update_ordonance($ordon_id,$params); \n redirect('ordonance/index');\n }\n else\n {\n\n $data['_view'] = 'ordonance/edit';\n $this->load->view('layouts/main',$data);\n }\n }\n else\n show_error('The ordonance you are trying to edit does not exist.');\n }", "public function edit(tb_vendor $tb_stock_keluar)\n {\n\n }", "public function edit(DaomniInfluentialcoupons $daomniInfluentialcoupons)\n {\n //\n }", "public function edit(Frequencia $frequencia)\n {\n //\n }", "public function edit(TrangThais $trangThais)\n {\n //\n }", "public function testUpdateSuperfund()\n {\n }", "public function testUpdateReplenishmentCustomFields()\n {\n }", "public function edit(Gestionnaire $gestionnaire)\n {\n //\n }", "public function editingredients($id)\n\n {\n\n\t\tif($this->uri->segment(3)==\"\")\n\n\t\t{\n\n\t\t\t$this->session->set_flashdata('err_msg', 'Dont Change the URL physically'); \n\n\t\t\tredirect('admin/recipe/viewingredients');\t\n\n\t\t}\n\n\t\t\n\n\t\tif ($this->input->server('REQUEST_METHOD') == 'POST')\n\n\t\t{\n\n \n\n\t $data['name']= strip_tags($this->input->post('name'));\n\n\t\t\t$name=strip_tags($this->input->post('slug'));\n\n\t\t\t$data['slug'] = strtolower(trim(preg_replace('/[^A-Za-z0-9-]+/', '-', $name)));\n\n\t\t\t$data['description']= strip_tags($this->input->post('description'));\n\n\t\t\t$data['status']= strip_tags($this->input->post('status'));\n\n \n\n \n\n\t\t\t $this->form_validation->set_rules('name', 'Name', 'trim|required');\n\n\t\t\t $this->form_validation->set_rules('description', 'Description', 'trim|required');\n\n\t\t\t $this->form_validation->set_rules('slug', 'Slug', 'trim|required');\n\n \n\n if ($this->form_validation->run() == TRUE) {\n\n $data_inserted = $this->Ingredients_model->edit_data($data,$id);\n\n $this->session->set_flashdata('success_msg', 'Ingredient edited Successfully'); \n\n redirect('admin/recipe/viewingredients');\t\n\n }\n\n\t\t}\n\n\t\t\n\n\t\t\n\n\t\t$site_name=$this->config->item('site_name');\n\n\t $this->template->set('title', 'Edit Ingredients | '.$site_name);\n\n\t\t$data_single = $this->Ingredients_model->get_data_by_id($id);\n\n\t\t$data['ingredients']=$data_single ;\n\n\t\t//print_r($data_single);die();\n\n $this->template->set_layout('layout_main', 'front');\n\n $this->template->build('editingredients',$data);\n\n }", "public function editPendidikanNonFormal()\n {\n //query edit\n $data = [\n \"nama_instansi_pendidikan_non_formal\" => $this->input->post('nama_instansi_pendidikan_non_formal', true),\n \"tanggal_awal_pendidikan_non_formal\" => $this->input->post('tanggal_awal_pendidikan_non_formal', true),\n \"tanggal_akhir_pendidikan_non_formal\" => $this->input->post('tanggal_akhir_pendidikan_non_formal', true),\n \"lokasi_pendidikan_non_formal\" => $this->input->post('lokasi_pendidikan_non_formal', true)\n ];\n $this->db->where('id_history_pendidikan_non_formal', $this->input->post('id_history_pendidikan_non_formal'));\n $this->db->update('history_pendidikan_non_formal', $data);\n }", "public function taxupdate() {\n $arr['page'] = 'taxdetail';\n\t\t$arr['active'] = 'other';\n\t\t$arr['productTax'] = $this->setting->getTax('product');\n\t\t$arr['shippingTax'] = $this->setting->getTax('shipping');\n\t\t$this->load->view('vwSettingTax',$arr);\n\t}", "function editdata($id) {\r\n $data['unitofarea'] = $this->myspidey_unitofarea_model->get_unitofarea($id);\r\n\r\n\r\n $this->load->view('myspidey_unitofarea/edit', $data);\r\n }", "public function edit()\n {\n \n }", "public function edit(Insurance $insurance)\n {\n //\n }", "public function editGoods()\n {\n return 'JingDong editGoods !';\n }", "public function edit(Nurse $nurse)\n {\n //\n }", "public function edit()\r\n {\r\n //\r\n }", "public function edit()\r\n {\r\n //\r\n }", "public function Edit()\n\t{\n\t\t\n\t}", "public function edit()\n {\n \n \n }", "public function edit(Requisition $requisition)\n {\n //\n }", "function edit_person($datafull)\n {\n\t $datafull['name']=str_replace(\"-\",\" \",trim($datafull['name']));\n\t \n\t $id=$datafull['id'];\n\t $data = array(\n 'name' => $datafull['name'],\n 'description' => $datafull['description'],\n 'wlink' => $datafull['wlink'],\n 'sex' => $datafull['sex']\n ); \n\t\t\t\t \n\t\t\t\t if ($datafull['defult'])\n\t\t\t\t {$data['defult'] = 'TRUE';}else{$data['defult'] = 'FALSE'; }\n\t\t\t\t \n\t\t\t\t if ($datafull['active'])\n\t\t\t\t {$data['active'] = 'TRUE';}else{$data['active'] = 'FALSE'; }\n \n\t $this->db->where('id', $id);\n $this->db->update('person', $data);\n\t\n }", "function update_tender_basic_details($tndr_id,$mgo_ref,$dos_ref,$vote_id,$item_id,$quantity,$unit,$tndr_open){\n\t\t$query = \"UPDATE tbl_tender_basic_details SET vote_id='$vote_id',item_id='$item_id',quantity='$quantity',unit_type_id='$unit',tndr_open_date='$tndr_open' WHERE tender_id='$tndr_id'\";\n $query_result = $this->mDbm->setData($query);\n return $query_result;\n }", "public function edit()\n {\n \n }", "public function edit()\n {\n \n }", "public function edit()\n {\n \n }", "public function edit(Suitcase $suitcase)\n {\n //\n }", "function editAlterRate($design_no, $suit_rate,$dupatta_rate, $ghagra_rate, $blause_rate, $total_rate)\n\t\n\t{\n\t\t/*$stock_id\t\t\t =\tmysql_real_escape_string(trim($stock_id));*/\n\t\t$design_no\t \t\t=\ttrim($design_no);\n\t\t$suit_rate\t\t\t \t\t= mysql_real_escape_string(trim($suit_rate));\n\t\t$dupatta_rate\t\t\t =\tmysql_real_escape_string(trim($dupatta_rate));\n\t\t$ghagra_rate\t\t =\tmysql_real_escape_string(trim($ghagra_rate));\n\t\t$blause_rate\t\t =\tmysql_real_escape_string(trim($blause_rate));\n\t\t$total_rate\t\t\t =\tmysql_real_escape_string(trim($total_rate));\n\t\t\n\t\t//update stock description\n\t\t$edit = \"UPDATE alter_rate\n\t\t\t\tSET\n\t\t\t\tdesign_no\t\t \t= '$design_no',\n\t\t\t\tsuit_rate\t\t\t= '$suit_rate',\n\t\t\t\tdupatta_rate\t\t= '$dupatta_rate',\n\t\t\t\tghagra_rate \t\t= '$ghagra_rate',\n\t\t\t\tblause_rate \t\t= '$blause_rate',\n\t\t\t\ttotal_rate\t\t = '$total_rate',\n\t\t\t\tmodified_on\t\t\t= now()\n\t\t\t\tWHERE\n\t\t\t\trate_id \t\t\t= '$rate_id'\n\t\t\t\t\";\n\t\t$query = mysql_query($edit);\n\t\t//echo $edit.mysql_error();exit;\n\t\t\n\t}", "function realstate_form($catId = null) {\n if ($catId!= null) {\n // We check if the category is the same as our plugin\n if (osc_is_this_category('realstate_plugin', $catId)) {\n $conn = getConnection() ;\n $data = $conn->osc_dbFetchResults('SELECT * FROM %st_item_house_property_type_attr', DB_TABLE_PREFIX);\n $p_type = array();\n foreach ($data as $d) {\n $p_type[$d['fk_c_locale_code']][$d['pk_i_id']] = $d['s_name'];\n }\n unset($data);\n include_once 'item_edit.php';\n }\n }\n}", "public function edit(Huisarts $huisarts)\n {\n //\n }", "function editar_pr_factura_inventario(){\n\n\t\t $u = new entrada();\n $u->usuario_id = $GLOBALS['usuarioid'];\n $u->empresas_id = $GLOBALS['empresaid'];\n\t$precio=$_POST['costo_unitario'];\n\t$producto_id=$_POST['cproductos_id'];\n $u->fecha = date(\"Y-m-d H:i:s\");\n $related = $u->from_array($_POST);\n\t $f = new Pr_factura();\n $f->get_by_id($u->pr_facturas_id);\n $u->espacios_fisicos_id = $f->espacios_fisicos_id;\n $u->lote_id = $f->lote_id;\n $u->costo_total = ($u->cantidad * $u->costo_unitario);\n\t$u->existencia = $u->cantidad;\n $u->cproveedores_id = $f->cproveedores_id;\n $u->fecha = date(\"Y-m-d H:i:s\");\n if ($u->id == 0)\n unset($u->id);\n if ($u->save($related)) {\n$this->db->query(\"update cproductos set precio_compra='$precio' where id=$producto_id\");\n echo $u->id;\n } else\n echo 0; \n \n\t}", "function _edit_update() {\n\t\t$tpaket = $_POST;\n\t\tunset($tpaket['tpaket_header']['id_tpaket_header']);\n\t\tunset($tpaket['button']);\n\t\t// end of assign variables and delete not used variables\n\n\t\t$count = count($tpaket['tpaket_detail']['id_tpaket_h_detail']) - 1;\n\n\t\t// check, at least one product quantity entered\n\t\t$quantity_exist = FALSE;\n\n\t\tfor($i = 1; $i <= $count; $i++) {\n\t\t\tif(empty($tpaket['tpaket_detail']['quantity'][$i])) {\n\t\t\t\tcontinue;\n\t\t\t} else {\n\t\t\t\t$quantity_exist = TRUE;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tif($quantity_exist == FALSE)\n\t\t\tredirect('tpaket/edit_error/Anda belum memasukkan data detail. Mohon ulangi');\n\n \tif(isset($_POST['button']['save']) || isset($_POST['button']['approve'])) {\n\n\t\t\t$this->db->trans_start();\n\n \t\t\t$this->session->set_userdata('tpaket_detail', $tpaket['tpaket_detail']);\n\n $id_tpaket_header = $this->uri->segment(3);\n $postingdate = $this->l_general->str_to_date($tpaket['tpaket_header']['posting_date']);\n\n \t\t\t$data = array (\n \t\t\t\t'id_tpaket_header' => $id_tpaket_header,\n \t\t\t\t'posting_date' => $postingdate,\n \t\t\t);\n\t\t\t\t/*$sirah= $id_tpaket_header;\n\t\t\t\t$ti=\"SELECT * FROM t_tpaket_detail_paket WHERE id_tpaket_header='$sirah'\";\n\t\t\t\t$tq=mysql_query($ta);\n\t\t\t\t$count1=mysql_num_rows($tq);*/\n \t\n\t\t\t $this->m_tpaket->tpaket_header_update($data);\n $edit_tpaket_header = $this->m_tpaket->tpaket_header_select($id_tpaket_header);\n\n \t\t\tif ($this->m_tpaket->tpaket_header_update($data)) {\n $input_detail_success = FALSE;\n \t\t\t if($this->m_tpaket->tpaket_details_delete($id_tpaket_header) && $this->m_tpaket->batch_delete($id_tpaket_header) ) {\n \t//\tfor($i = 1; $i <= $count; $i++) {\n \t\t\t\t\tif((!empty($tpaket['tpaket_detail']['quantity'][$i]))&&(!empty($tpaket['tpaket_detail']['material_no'][$i]))) {\n\n \t\t\t\t\t\t/*$tpaket_detail['id_tpaket_header'] = $id_tpaket_header;\n \t\t\t\t\t\t$tpaket_detail['quantity'] = $tpaket['tpaket_detail']['quantity'][$i];\n \t\t\t\t\t\t$tpaket_detail['id_tpaket_h_detail'] = $tpaket['tpaket_detail']['id_tpaket_h_detail'][$i];\n\n \t\t\t\t\t\t$tpaket_detail['material_no'] = $tpaket['tpaket_detail']['material_no'][$i];\n \t\t\t\t\t\t$tpaket_detail['material_desc'] = $tpaket['tpaket_detail']['material_desc'][$i];\n \t\t\t\t\t\t$tpaket_detail['uom'] = $tpaket['tpaket_detail']['uom'][$i];*/\n\n $tpaket_to_approve['item'][$i] = $tpaket_detail['id_tpaket_h_detail'];\n $tpaket_to_approve['material_no'][$i] = $tpaket_detail['material_no'];\n $tpaket_to_approve['quantity'][$i] = $tpaket_detail['quantity'];\n $tpaket_to_approve['uom'][$i] = $tpaket_detail['uom'];\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t//\n\t\t\t\t\t\t$tpaket_detail['id_tpaket_header'] = $id_tpaket_header;\n\t\t\t\t\t\t$batch['BaseEntry'] = $id_tpaket_header;\n\t\t\t\t\t\t$tpaket_detail['quantity'] = $tpaket['tpaket_detail']['qty'][1];\n\t\t\t\t\t\t$tpaket_detail['qty'] = $tpaket['tpaket_detail']['qty'][1];\n\t\t\t\t\t\t$batch['Quantity'] = $tpaket['tpaket_detail']['qty'][1];\n\t\t\t\t\t\t$tpaket_detail['id_tpaket_h_detail'] = 1;\n\t\t\t\t\t\t$batch['BaseLinNum'] = 1;\n \t\t\t\t\t\t$tpaket_detail['material_no'] = $tpaket['tpaket_detail']['material_no'];\n\t\t\t\t\t\t$batch['ItemCode'] = $tpaket['tpaket_detail']['material_no'];\n\t\t\t\t\t\t$item=$tpaket['tpaket_detail']['material_no'];\n\t\t\t\t\t\t$date=date('ymd');\n\t\t\t\t\t\t$whs=$this->session->userdata['ADMIN']['plant'];\n\t\t\t\t\t\t$q=\"SELECT * FROM m_batch WHERE ItemCode = '$item' AND Whs ='$whs'\";\n\t\t\t\t\t\t$cek=\"SELECT BATCH,MAKTX FROM m_item WHERE MATNR = '$item'\";\n\t\t\t\t\t\t$cek1=mysql_query($cek);\n\t\t\t\t\t\t$ra=mysql_fetch_array($cek1);\n\t\t\t\t\t\t$b=$ra['BATCH'];\n\t\t\t\t\t\t$tq=mysql_query($q);\n\t\t\t\t\t\t$count1=mysql_num_rows($tq) + 1;\n\t\t\t\t\t\tif ($count1 > 9 && $count1 < 100)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$dg=\"0\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse \n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$dg=\"00\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$num=$item.$date.$dg.$count1;\n\t\t\t\t\t\tif ($count1 < 2)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t$batch['BatchNum'] = $num;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t$batch['BaseType'] = 4;\n\t\t\t\t\t\t$tpaket_detail['num'] = $num;\n\t\t\t\t\t\t$batch['Createdate'] = $this->l_general->str_to_date($tpaket['tpaket_header']['posting_date']);\n \t\t\t\t\t\t$tpaket_detail['material_desc'] = $ra['MAKTX'];\n \t\t\t\t\t\t$tpaket_detail['uom'] = $tpaket['tpaket_detail']['uom'][1];\n\t\t\t\t\t\tif ($b=='Y')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t$batch_in=$this->m_tpaket->batch_insert($batch);\n\t\t\t\t\t\t\tif ($count1 < 2)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tmysql_query(\"INSERT INTO m_batch () VALUES ('$item','$num','$batch[Quantity]','$whs')\");\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t/*\t$batch['BaseEntry'] = $id_tpaket_header;\n\t\t\t\t\t\t$batch['Quantity'] = $tpaket['tpaket_detail']['quantity'][$i];\n\t\t\t\t\t\t$batch['BaseLinNum'] = $tpaket['tpaket_detail']['id_tpaket_h_detail'][$i];\n \t\t\t\t\t\t$batch['ItemCode'] = $tpaket['tpaket_detail']['material_no'][$i];\n\t\t\t\t\t\t$batch['BatchNum'] = $tpaket['tpaket_detail']['num'][$i];\n\t\t\t\t\t\t$batch['BaseType'] = 4;\n\t\t\t\t\t\t$batch['Createdate'] = $this->l_general->str_to_date($tpaket['tpaket_header']['posting_date']);*/\n\n if($id_tpaket_detail = $this->m_tpaket->tpaket_detail_insert($tpaket_detail)) {\n /* if($item_pakets = $this->m_mpaket->mpaket_details_select_by_item_paket($tpaket_detail['material_no'])) {\n if($item_pakets !== FALSE) {\n \t\t$k = 1;\n unset($item_paket);\n \t\tforeach ($item_pakets->result_array() as $object['temp']) {\n \t\t\tforeach($object['temp'] as $key => $value) {\n \t\t\t\t$item_paket[$key][$k] = $value;\n \t\t\t}\n \t\t\t$k++;\n \t\t\tunset($object['temp']);\n \t\t}\n \t }*/\n\t\t\t\t\t\t\t\t\t// echo \"$batch[BaseEntry],$batch[Quantity],$batch[BaseLinNum],$batch[ItemCode],$batch[BatchNum],$b <br>\";\n\t\t\t\t\t//\techo $tpaket_detail['id_tpaket_header'].\",\".$tpaket_detail['quantity'].\",\".$tpaket_detail['material_no'].\",\".$tpaket_detail['num'];\n\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t// $c_item_paket = count($item_paket['id_mpaket_h_detail']);\n \t\t\tfor($i = 1; $i <= $count; $i++) {\n $tpaket_detail_paket['id_tpaket_h_detail_paket'] = $i;\n\t\t\t\t\t\t\t $batch1['BaseLinNum'] =$i;\n $tpaket_detail_paket['id_tpaket_detail'] = $id_tpaket_detail;\n $tpaket_detail_paket['id_tpaket_header'] = $id_tpaket_header;\n\t\t\t\t\t\t\t $batch1['BaseEntry'] = $id_tpaket_header;\n\t\t\t\t\t\t\t $batch1['BaseType'] = 4;\n\t\t\t\t\t\t\t $batch1['ItemCode'] = $tpaket['tpaket_detail']['material_detail'][$i];\n\t\t\t\t\t\t\t $qq=\"SELECT * FROM m_batch WHERE ItemCode = '$batch1[ItemCode]' AND Whs ='$whs'\";\n\t\t\t\t\t\t\t $cekQQ=mysql_query($qq);\n\t\t\t\t\t\t\t $rQ=mysql_num_rows($cekQQ);\n\t\t\t\t\t\t\t $num_detail=$tpaket['tpaket_detail']['num'][$i];\n\t\t\t\t\t\t\t $date=date('ymd');\n\t\t\t\t\t\t\t $cekq=\"SELECT BATCH,MAKTX FROM m_item WHERE MATNR = '$batch1[ItemCode]'\";\n\t\t\t\t\t\t\t $cekr=mysql_query($cekq);\n\t\t\t\t\t\t\t $rai=mysql_fetch_array($cekr);\n\t\t\t\t\t\t\t $tpaket_detail_paket['material_desc'] = $rai['MAKTX'];\n\t\t\t\t\t\t\t $bet=$ra['MAKTX'];\n\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t $batch1['Createdate'] =$batch['Createdate'] ;\n $tpaket_detail_paket['material_no_paket'] = $tpaket_detail['material_no'];\n $tpaket_detail_paket['material_no'] = $tpaket['tpaket_detail']['material_detail'][$i];\n\t\t\t\t\t\t\t $tpaket_detail_paket['material_desc'] = $item_paket['material_desc'][$i];\n $tpaket_detail_paket['quantity'] = $tpaket['tpaket_detail']['quantity'][$i];\n\t\t\t\t\t\t\t $batch1['Quantity'] = $tpaket['tpaket_detail']['quantity'][$i];\n $tpaket_detail_paket['uom'] = $tpaket['tpaket_detail']['detail_uom'][$i];\n\t\t\t\t\t\t\t $tpaket_detail_paket['num'] = $num_detail;\n\t\t\t\t\t\t\t $tpaket_detail_paket['quantity_total'] = $tpaket['tpaket_detail']['quantity'][$i] * $tpaket['tpaket_detail']['qty'][1];\n\t\t\t\t\t\t\t if ($num_detail != \"\" && $bet == 'Y')\n\t\t\t\t\t\t\t {\n\t\t\t\t\t\t\t $batch1['BatchNum'] = $num_detail;\n\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t else\n\t\t\t\t\t\t\t {\n\t\t\t\t\t\t\t \t\t$count1=$rQ + 1;\n\t\t\t\t\t\t\t\t\t\tif ($count1 > 9 && $count1 < 100)\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t$dg=\"0\";\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\telse \n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t$dg=\"00\";\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t$num=$batch1['ItemCode'].$date.$dg.$count1;\n\t\t\t\t\t\t\t\t\t\t\t$batch1['BatchNum'] = $num;\n\t\t\t\t\t\t\t\t\t\t\tmysql_query(\"INSERT INTO m_batch () VALUES ('$batch1[ItemCode]','$batch1[BatchNum]','$batch1[Quantity]','$whs')\");\n\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// echo \"$batch1[BaseEntry],$batch1[Quantity],$batch1[BaseLinNum],$batch1[ItemCode],$batch1[BatchNum],$b <br>\";\n\t\t\t\t\t\t\t if ($batch1['Quantity'] != \"\" && $bet=='Y')\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$this->m_tpaket->batch_insert($batch1);\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t}\n \t\t\t\t\t if($this->m_tpaket->tpaket_detail_paket_insert($tpaket_detail_paket)) {\n $input_detail_success = TRUE;\n \t\t\t\t\t } else {\n $input_detail_success = FALSE; } } }\n \n \t else {\n $input_detail_success = FALSE;\n\t\t\t\t\t\t\t\t //echo \"aaaaaaaaaaaaaaaaa\";\n \t}\n// \t\t\t\t\t\tif($this->m_tpaket->tpaket_detail_insert($tpaket_detail))\n// $input_detail_success = TRUE;\n \t\t\t\t\t}\n\n \t \t//}\n }\n }\n\n\t\t\tif (($input_detail_success == TRUE) && (isset($_POST['button']['approve']))) {\n $internal_order = $this->m_tpaket->tpaket_internal_order_select();\n $tpaket_to_approve['plant'] = $edit_tpaket_header['plant'];\n $tpaket_to_approve['internal_order'] = $internal_order['internal_order'];\n $tpaket_to_approve['storage_location'] = $this->session->userdata['ADMIN']['storage_location'];\n $tpaket_to_approve['posting_date'] = date('Ymd',strtotime($edit_tpaket_header['posting_date']));\n $tpaket_to_approve['id_tpaket_header'] = $id_tpaket_header;\n $tpaket_to_approve['plant'] = $edit_tpaket_header['plant'];\n $tpaket_to_approve['id_tpaket_plant'] = $edit_tpaket_header['id_tpaket_plant'];\n $tpaket_to_approve['id_user_input'] = $this->session->userdata['ADMIN']['admin_id'];\n $tpaket_to_approve['web_trans_id'] = $this->l_general->_get_web_trans_id($edit_tpaket_header['plant'],$edit_tpaket_header['posting_date'],\n $edit_tpaket_header['id_tpaket_plant'],'17');\n\t\t\t/* $approved_data = $this->m_tpaket->sap_tpaket_header_approve($tpaket_to_approve);\n \t\t\tif((!empty($approved_data['material_document'])) && ($approved_data['material_document'] !== '') &&\n (!empty($approved_data['material_document_out'])) && ($approved_data['material_document_out'] !== '')) {\n \t\t\t $tpaket_no = $approved_data['material_document'];\n \t\t\t $tpaket_no_out = $approved_data['material_document_out'];*/\n \t\t\t\t$data = array (\n \t\t\t\t\t'id_tpaket_header'\t=>$id_tpaket_header,\n \t\t\t\t\t'material_doc_no'\t=>\t$tpaket_no,\n \t\t\t\t\t'material_doc_no_out'\t=>\t$tpaket_no_out,\n \t\t\t\t\t'status'\t=>\t'2',\n \t\t\t\t\t'id_user_approved'\t=>\t$this->session->userdata['ADMIN']['admin_id'],\n \t\t\t\t);\n \t\t\t\t$tpaket_header_update_status = $this->m_tpaket->tpaket_header_update($data);\n \t\t\t\t $approve_data_success = TRUE;\n\t\t\t\t/*} else {\n\t\t\t\t $approve_data_success = FALSE;\n\t\t\t\t}*/\n }\n\n \t\t\t$this->db->trans_complete();\n if(isset($_POST['button']['save'])) {\n if ($input_detail_success == TRUE) {\n \t\t\t $this->l_general->success_page('Data Transaksi Paket berhasil diubah', site_url('tpaket/browse'));\n } else {\n \t\t\t $this->jagmodule['error_code'] = '006'; \n\t\t$this->l_general->error_page($this->jagmodule, 'Data Transaksi Paket tidak berhasil diubah', site_url($this->session->userdata['PAGE']['next']));\n }\n } else if(isset($_POST['button']['approve']))\n if($approve_data_success == TRUE) {\n \t\t\t $this->l_general->success_page('Data Transaksi Paket berhasil diapprove', site_url('tpaket/browse'));\n } else {\n \t\t $this->jagmodule['error_code'] = '007'; \n\t\t$this->l_general->error_page($this->jagmodule, 'Data Transaksi Paket tidak berhasil diapprove.<br>\n Pesan Kesalahan dari sistem SAP : '.$approved_data['sap_messages'], site_url($this->session->userdata['PAGE']['next']));\n }\n\n\t\t}\n\t}", "public function editSpecialist($cat_id)\n {\n\n $specialistData = DB::table('specialists')\n ->join('departments', 'specialists.department_id', '=', 'departments.id')\n ->select('specialists.*', 'departments.name as deptName', 'departments.id as catID')\n /*->get();*/\n ->where('specialists.id',$cat_id)\n ->first();\n\n $editSpecialist=view('admin.specialist_edit')\n ->with('specialistData',$specialistData);\n\n return view('admin.master')\n ->with('main_content',$editSpecialist);\n\n return Redirect::to('/specialists');\n }", "function editAttribute(){\n\n\t//Database connection\n\tglobal $mysqli;\n\t\n\t//Hrefs\n\tglobal $cms_library;\n\tglobal $cms_editAttribute;\n\tglobal $cms_continent;\n\tglobal $cms_attribute;\n\n\t//Selected continent and attribute\n\t$continent_id=$_GET[\"continent_id\"];\n\t$continent_name=$_GET[\"continent_name\"];\n\t$attribute_id=$_GET[\"attribute_id\"];\n\t$attribute_name=$_GET[\"attribute_name\"];\n\n\t//Form handlers\n\tif($_FILES[\"image\"][\"size\"]>0){\n\t \n\t $image_path=\"\".$continent_name.\"/\".$attribute_name.\"/\".basename($_FILES[\"image\"][\"name\"]).\"\"; \n\t \n\t \n\t}\n\t\n\t$description=$_POST[\"description\"];\n\t$ux=$_POST[\"ux\"];\n\t$submit=$_POST[\"submit\"];\n\n\t//Submit button trigger\n\tif(isset($submit)){\n\n\t\t//To edit the image file\n\t\tif($_FILES[\"image\"][\"size\"]>0){\n\t\t \n\t\t move_uploaded_file($_FILES[\"image\"][\"tmp_name\"], \"../\".$image_path.\"\");\n\t\t \n\t\t //Corresponding database entry\n\t\t $sql_editImage=\"UPDATE attributes SET image_path='\".$image_path.\"' WHERE continent_id=\".$continent_id.\" AND attribute_id=\".$attribute_id.\";\";\n\t\t $res_editImage=mysqli_query($mysqli, $sql_editImage);\n\t\t \n\t\t}\n\t\t\n\t\t//To edit the description file\n\t\t$description_path=\"\".$continent_name.\"/\".$attribute_name.\"/description.txt\";\n\t\t$editDescription=file_put_contents(\"../\".$description_path.\"\", $description);\n\n\t\t//Database entry for the UX\n\t\t$sql_editUxAttribute=\"UPDATE attributes SET ux='\".$ux.\"' WHERE continent_id=\".$continent_id.\" AND attribute_id=\".$attribute_id.\";\";\n\t\t$res_editUxAttribute=mysqli_query($mysqli, $sql_editUxAttribute);\n\t\t$sql_editUxItem=\"UPDATE items SET ux='\".$ux.\"' WHERE continent_id=\".$continent_id.\" AND attribute_id=\".$attribute_id.\";\";\n\t\t$res_editUxItem=mysqli_query($mysqli, $sql_editUxItem);\n\t\t\n\t\tif($res_editImage || $editDescription || $res_editUxAttribute || $res_editUxItem){\n\t\t \n\t\t page_redirect(\"\".$cms_continent.\"?continent_id=\".$continent_id.\"\"); \n\t\t \n\t\t}else{\n\t\t \n\t\t page_redirect(\"\".$cms_editAttribute.\"?continent_id=\".$continent_id.\"&attribute_id=\".$attribute_id.\"\"); \n\t\t \n\t\t}\n\t\t\n\t\t\n\n\t}else{\n\t\tpage_redirect(\"\".$cms_editAttribute.\"?continent_id=\".$continent_id.\"&attribute_id=\".$attribute_id.\"\");\n\n\t}\n\n\t$res_addAttribute->close(); \n\t$mysqli->close();\n\n}", "public function edit_toko(){\n\t}", "protected function editar()\n {\n }", "public function edit() {\n }", "function editApprentice() {\n\t\t\t\t\tif ($_POST['updateDelete'] == 'update') {\n\t\t\t\t\t\t\n\t\t\t\t\t\t/* params(0) represents the apprentice name passed via the URL */\n\t\t\t\t\t\t$apprentice = Apprentice::find_by_name(params(0));\n\t\t\t\t\t\t\n\t\t\t\t\t\t$apprentice->update_attributes(array('name'\t\t\t => $_POST['inputName'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'cohort'\t\t => $_POST['inputCohort'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'address'\t\t => $_POST['inputAddress'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'city'\t\t\t => $_POST['inputCity'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'telephone'\t => $_POST['inputTelephone'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'school'\t\t => $_POST['inputSchool'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'graduation'\t => $_POST['inputGraduation'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'workexperience' => $_POST['inputWorkExperience'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'visa'\t\t\t => $_POST['inputVisa'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'veteran'\t\t => $_POST['inputVeteran'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'unix_linux'\t => $_POST['inputUnixLinux'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'sql'\t\t\t => $_POST['inputSql'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'git'\t\t\t => $_POST['inputGit'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'wordpress'\t => $_POST['inputWordpress'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'drupal'\t\t => $_POST['inputDrupal'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'python'\t\t => $_POST['inputPython'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'svn'\t\t\t => $_POST['inputSVN'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'objective_c'\t => $_POST['inputObjectiveC'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'ruby_rails'\t => $_POST['inputRuby'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'c_plusplus'\t => $_POST['inputCPlusPlus'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'dot_net'\t\t => $_POST['inputNet'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'php'\t\t\t => $_POST['inputPHP'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'html_css'\t\t => $_POST['inputHtmlCss'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'java'\t\t\t => $_POST['inputJava'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'javascript'\t => $_POST['inputJavascript'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'comments'\t\t => $_POST['inputComments'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'email'\t\t => $_POST['inputEmail'])\n\t\t\t\t\t\t);\n\t\t\t\t\t} else if ($_POST['updateDelete'] == 'delete') {\n\t\t\t\t\t\t$apprentice = Apprentice::find_by_name(params(0));\n\t\t\t\t\t\t$apprentice->delete();\n\t\t\t\t\t}\n\n\t\t\t\t\t$success = new h2o('views/happySuccess.html');\n\t\t\t\t\techo $success->render();\n\t\t\t\t}", "public function edit(Renta $renta)\n {\n //\n }", "public function edit()\n {\n }", "public function edit()\n {\n }", "public function edit()\n {\n }", "function update_office_info()\n {\n $this->model->update_office_info();\n }", "public function edit(Journalentery $journalentery)\n {\n //\n }", "public function edit(Corporate $corporate)\n {\n //\n }", "public function editNutrationCategory($id)\n {\n if((Auth::check()) && (Auth::user()->is_admin == 1)){\n $workout = NutrationCategory::find($id);\n return view('admin.editnutrationcategory')->with('workout',$workout);\n }\n\n else{\n Session::flash('danger','You are not authorize to view this page');\n return redirect()->back();\n }\n }", "function edit($PurchaseID)\n { \n // check if the purchase_good exists before trying to edit it\n $data['purchase_good'] = $this->Purchase_good_model->get_purchase_good($PurchaseID);\n \n if(isset($data['purchase_good']['PurchaseID']))\n {\n $this->load->library('form_validation');\n\n\t\t\t$this->form_validation->set_rules('OnSale','OnSale','required');\n\t\t\t$this->form_validation->set_rules('UnitPrice','UnitPrice','decimal|required');\n\t\t\t$this->form_validation->set_rules('UNIT','UNIT','decimal');\n\t\t\t$this->form_validation->set_rules('Description','Description','max_length[200]');\n\t\t\n\t\t\tif($this->form_validation->run()) \n { \n $params = array(\n\t\t\t\t\t'OnSale' => $this->input->post('OnSale'),\n\t\t\t\t\t'UnitPrice' => $this->input->post('UnitPrice'),\n\t\t\t\t\t'UNIT' => $this->input->post('UNIT'),\n\t\t\t\t\t'Description' => $this->input->post('Description'),\n );\n\n $this->Purchase_good_model->update_purchase_good($PurchaseID,$params); \n redirect('purchase_good/index');\n }\n else\n {\n $data['_view'] = 'purchase_good/edit';\n $this->load->view('layouts/main',$data);\n }\n }\n else\n show_error('The purchase_good you are trying to edit does not exist.');\n }", "function edit($id) {\r\n\r\n $data['unitofarea'] = $this->myspidey_unitofarea_model->get_unitofarea($id);\r\n\r\n $now = date('Y-m-d H:i:s');\r\n if (isset($id)) {\r\n $this->load->library('form_validation');\r\n $this->form_validation->set_rules('\tUOA_Name', 'UOA Name', 'required|max_length[255]');\r\n\r\n $params = array(\r\n 'UOA_Name' => $this->input->post('UOA_Name'),\r\n 'UOA_Abbrevation' => $this->input->post('UOA_Abbrevation'),\r\n 'CreatedBy' => 1,\r\n 'LastUpdatedOn' => $now,\r\n 'LastUpdatedBy' => 1,\r\n );\r\n\r\n $this->myspidey_unitofarea_model->update_unitofarea($id, $params);\r\n $this->session->set_flashdata('msg', \"Data has been saved\");\r\n redirect($this->agent->referrer());\r\n }\r\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "function editGeneral()\n\t{ \n\t\t$id=$_GET['prodid'];\n\n\t\tif(((int)$id)>0)\n\t\t{\n\t\t\t$sql='select * from products_table where product_id='.$id;\n\t\t\t\n\t\t\t$obj=new Bin_Query();\n\t\t\t\n\t\t\t$obj->executeQuery($sql);\n\t\t\t\n\t\t\t$output=$obj->records[0];\n\t\t\t\n\t\t\treturn $output;\n\t\t}\n\t}", "public function edit(Town $town)\n {\n //\n }", "function edit($id)\n { \n // check if the commission_tech exists before trying to edit it\n $data['commission_tech'] = $this->Commission_tech_model->get_commission_tech($id);\n \n if(isset($data['commission_tech']['id']))\n {\n $this->load->library('form_validation');\n\n\t\t\t$this->form_validation->set_rules('nom_commission','Nom Commission','max_length[100]|required');\n\t\t\t$this->form_validation->set_rules('description','Description','max_length[255]');\n\t\t\n\t\t\tif($this->form_validation->run()) \n { \n $params = array(\n\t\t\t\t\t'nom_commission' => $this->input->post('nom_commission'),\n\t\t\t\t\t'description' => $this->input->post('description'),\n );\n\n $this->Commission_tech_model->update_commission_tech($id,$params); \n redirect('commission_tech/index');\n }\n else\n {\n \n\n\t\t\t\t$this->load->view('include/header');\n\t\t\t\t$this->load->view('advocate/commission_tech/edit');\n\t\t\t\t$this->load->view('include/footer');\n }\n }\n else\n show_error('The commission_tech you are trying to edit does not exist.');\n }", "public function editAction() {\n\t\t$id = $this->getInput('id');\n\t\t$info = Fj_Service_Goods::getGoods(intval($id));\n $this->assign('dir', \"goods\");\n $this->assign('ueditor', true);\n\t\t$this->assign('info', $info);\n\t}", "public function edit(squad $squad)\n {\n //\n }", "public function edit(Readings $readings)\n {\n //\n }", "function update() {\n\t\n\t \t$sql = \"UPDATE evs_database.evs_identification \n\t \t\t\tSET\tidf_identification_detail_en=?, idf_identification_detail_th=?, idf_pos_id=?, idf_ctg_id=? \n\t \t\t\tWHERE idf_id=?\";\n\t\t\n\t\t$this->db->query($sql, array($this->idf_identification_detail_en, $this->idf_identification_detail_th, $this->idf_pos_id, $this->idf_ctg_id, $this->idf_id));\n\t\t\n\t }", "function _edit_update() {\n\t\t$sfgs = $_POST;\n//\t\tunset($sfgs['sfgs_header']['kode_sfg']);\n\t\tunset($sfgs['button']);\n\t\t// end of assign variables and delete not used variables\n\n\t\t$count = count($sfgs['sfgs_detail']['id_sfgs_h_detail']) - 1;\n\n\t\t// check, at least one product quantity entered\n\t\t$quantity_exist = FALSE;\n\n\t\tfor($i = 1; $i <= $count; $i++) {\n\t\t\tif(empty($sfgs['sfgs_detail']['quantity'][$i])) {\n\t\t\t\tcontinue;\n\t\t\t} else {\n\t\t\t\t$quantity_exist = TRUE;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tif($quantity_exist == FALSE)\n\t\t\tredirect('sfgs/edit_error/Anda belum memasukkan data detail. Mohon ulangi');\n\n \tif(isset($_POST['button']['save'])) {\n\n\t\t\t$this->db->trans_start();\n\n \t\t\t$this->session->set_userdata('sfgs_detail', $sfgs['sfgs_detail']);\n $id_sfgs_header = $sfgs['sfgs_header']['id_sfgs_header'];\n\n \t\t\t$data = array (\n \t\t\t\t'id_sfgs_header' =>\t$id_sfgs_header,\n 'quantity_sfg' => $sfgs['sfgs_header']['quantity_sfg'],\n \t\t\t\t'uom_sfg' => $sfgs['sfgs_header']['uom_sfg'],\n \t\t\t);\n\n $input_detail_success = FALSE;\n\n if(($this->m_sfgs->sfgs_header_update($data))&&\n ($this->m_sfgs->sfgs_details_delete($id_sfgs_header))) {\n \t\tfor($i = 1; $i <= $count; $i++) {\n\t\t\t\t\tif((!empty($sfgs['sfgs_detail']['quantity'][$i]))&&(!empty($sfgs['sfgs_detail']['material_no'][$i]))) {\n\n\t\t\t\t\t\t$sfgs_detail['id_sfgs_header'] = $id_sfgs_header;\n\t\t\t\t\t\t$sfgs_detail['quantity'] = $sfgs['sfgs_detail']['quantity'][$i];\n\t\t\t\t\t\t$sfgs_detail['id_sfgs_h_detail'] = $sfgs['sfgs_detail']['id_sfgs_h_detail'][$i];\n\n\t\t\t\t\t\t$sfgs_detail['material_no'] = $sfgs['sfgs_detail']['material_no'][$i];\n\t\t\t\t\t\t$sfgs_detail['material_desc'] = $sfgs['sfgs_detail']['material_desc'][$i];\n\t\t\t\t\t\t$sfgs_detail['uom'] = $sfgs['sfgs_detail']['uom'][$i];\n\n\t\t\t\t\t\tif($this->m_sfgs->sfgs_detail_insert($sfgs_detail))\n $input_detail_success = TRUE;\n\t\t\t\t\t}\n\n \t \t}\n }\n\n \t\t\t$this->db->trans_complete();\n\n if(isset($_POST['button']['save'])) {\n if ($input_detail_success == TRUE) {\n\t\t\t $this->l_general->success_page('Data Master Semi Finished Goods (SFG) BOM berhasil diubah', site_url('sfgs/browse'));\n } else {\n\t\t\t $this->jagmodule['error_code'] = '004'; \n\t\t$this->l_general->error_page($this->jagmodule, 'Data Master Semi Finished Goods (SFG) BOM tidak berhasil diubah', site_url($this->session->userdata['PAGE']['next']));\n }\n } else if(isset($_POST['button']['approve']))\n if($approve_data_success == TRUE) {\n\t\t\t $this->l_general->success_page('Data Master Semi Finished Goods (SFG) BOM berhasil diapprove', site_url('sfgs/browse'));\n } else {\n\t\t\t $this->jagmodule['error_code'] = '005'; \n\t\t$this->l_general->error_page($this->jagmodule, 'Data Master Semi Finished Goods (SFG) BOM tidak berhasil diapprove.<br>\n Pesan Kesalahan dari sistem SAP : '.$approved_data['sap_messages'], site_url($this->session->userdata['PAGE']['next']));\n }\n\n\t\t}\n\n\t}", "public function setNutrition(Nutrition $nutrition)\n\t{\n\t\t$this->nutrition = $nutrition;\n\t\treturn $this;\n\t}", "public function edit()\n { \n }", "public function edit(AttributProduit $attributProduit)\n {\n //\n }", "public function editPriceMoney(){\n\t\t\n\t\t\n\t\t\n\t\t\n\t}", "public function editForm(): void\n {\n $this->articleId = $_GET['id'];\n $query = $this->articleModel->displayOneArticle($this->articleId);\n $editArticle = $query->fetch();\n\n $this->title = $editArticle['title'];\n $this->content = $editArticle['content'];\n $this->category = $editArticle['category'];\n }", "public function edit(tenth $tenth)\n {\n //\n }", "public function postEdit(){\n\t\n\t\t$tax = Tax::find(Input::get('id') );\n\n\t\treturn View::make('tax.edit')\n\t\t\t->with('id', $tax->id)\n\t\t\t->with('name', $tax->name)\n\t\t\t->with('rate', $tax->rate);\n\t}", "public function edit($id)\n {\n $quest = Quest::findOrFail($id);\n $rewards = Reward::all();\n $types = QuestType::all();\n $beginDialog = Dialog::where('questID', $id)->where('type', 'begin')->first();\n $additionalDialog = Dialog::where('questID', $id)->where('type', 'additional')->first();\n// $descriptions = Description::all();\n $speakers = Speaker::pluck('name');\n $languages = Language::all();\n $modes = DescriptionMode::all();\n $questdescriptions = $quest->questdescriptions;\n\n if (isset($quest->field)) {\n $items = $this->getItems($quest->field->fieldName->name);\n }\n\n// var_dump($quest->field->value == 2);die();\n\n return view('admin.quests.edit', compact('quest', 'rewards', 'types', 'items', 'beginDialog',\n 'additionalDialog', 'descriptions', 'speakers', 'languages', 'modes', 'questdescriptions', 'notes'));\n }", "public function edit(Penduduk $penduduk)\n {\n //\n }", "public function edit(Penduduk $penduduk)\n {\n //\n }", "public function annimalEditAction()\n {\n }", "public function edit(Income $income)\n {\n //\n }", "public function updateNutrationCategory(Request $request)\n {\n if((Auth::check()) && (Auth::user()->is_admin == 1)){\n\n $this->validate($request,array(\n 'name' => 'required',\n 'tips' => 'required',\n ));\n $id = $request->id;\n $nutrationCategory = NutrationCategory::find($id);\n $nutrationCategory->nutration_category_name = $request->name;\n $nutrationCategory->tips = $request->tips;\n $nutrationCategory->save();\n Session::flash('success','Nutration Category Updated succcessfully.');\n return redirect()->back()->with('workout',$nutrationCategory);\n }\n\n else{\n Session::flash('danger','You are not authorize to view this page');\n return redirect()->back();\n }\n }", "function edit_vitals($summary_id = NULL)\r\n {\r\n $data['offline_mode']\t\t=\t$this->config->item('offline_mode');\r\n $data['debug_mode']\t\t =\t$this->config->item('debug_mode');\r\n\t\t//$this->load->library('form_validation');\r\n //$this->form_validation->set_error_delimiters('<div class=\"error\">', '</div>');\r\n\t\t$data['title'] = 'Vital Signs';\r\n\t\t$data['form_purpose'] = $this->uri->segment(3);\r\n //$data['patient_id'] = $this->uri->segment(4);\r\n //$data['summary_id'] = $this->uri->segment(5);\r\n\t\t//$data['clinic_info'] = $this->mbio->get_clinic_info($_SESSION['location_id']);\r\n\t\t//$data['patient_info'] = $this->memr_rdb->get_patient_demo($data['patient_id']);\r\n //$data['patcon_info'] = $this->memr_rdb->get_patcon_details($data['patient_id']);\r\n $data['now_id'] = time();\r\n $data['now_date'] = date(\"Y-m-d\",$data['now_id']);\r\n $data['now_time'] = date(\"H:i\",$data['now_id']);\r\n\r\n if(count($_POST)) {\r\n // User has posted the form\r\n $data['now_id'] = $_POST['now_id'];\r\n $data['now_date'] = date(\"Y-m-d\",$data['now_id']);\r\n $data['init_patient_id'] = $_POST['patient_id'];\r\n $data['patient_id'] = $data['init_patient_id'];\r\n $data['summary_id'] = $_POST['summary_id'];\r\n $data['init_vital_id'] = $_POST['vital_id'];\r\n $data['vital_id'] = $data['init_vital_id'];\r\n $data['init_reading_date'] = $_POST['reading_date'];\r\n $data['init_reading_time'] = $_POST['reading_time'];\r\n $data['init_height'] = trim($_POST['height']);\r\n $data['init_weight'] = trim($_POST['weight']);\r\n $data['init_left_vision'] = $_POST['left_vision'];\r\n $data['init_right_vision'] = $_POST['right_vision'];\r\n $data['init_temperature'] = trim($_POST['temperature']);\r\n $data['init_pulse_rate'] = trim($_POST['pulse_rate']);\r\n $data['init_bmi'] = $_POST['bmi'];\r\n $data['init_waist_circumference'] = trim($_POST['waist_circumference']);\r\n $data['init_bp_systolic'] = trim($_POST['bp_systolic']);\r\n $data['init_bp_diastolic'] = trim($_POST['bp_diastolic']);\r\n $data['init_respiration_rate'] = trim($_POST['respiration_rate']);\r\n $data['init_ofc'] = trim($_POST['ofc']);\r\n $data['init_remarks'] = $_POST['remarks'];\r\n \r\n if ($data['patient_id'] == \"new_patient\"){\r\n // New form\r\n\t\t //$data['patient_id'] = \"\";\r\n \t\t$data['save_attempt'] = 'VITAL SIGNS';\r\n\t\t $data['patient_info'] = array();\r\n } else {\r\n // Edit form\r\n \t\t$data['save_attempt'] = 'VITAL SIGNS';\r\n // These fields were passed through as hidden tags\r\n $data['patient_id'] = $data['init_patient_id']; //came from POST\r\n\t\t $data['patient_info'] = $this->memr_rdb->get_patient_demo($data['patient_id']);\r\n $data['init_patient_id'] = $data['patient_info']['patient_id'];\r\n //$data['init_ic_other_no'] = $data['patient_info']['ic_other_no'];\r\n } //endif ($patient_id == \"new_patient\")\r\n\r\n } else {\r\n // First time form is displayed\r\n $data['init_location_id'] = $_SESSION['location_id'];\r\n $data['init_end_date'] = NULL;\r\n $data['init_clinic_name'] = NULL;\r\n $data['now_id'] = time();\r\n $data['now_date'] = date(\"Y-m-d\",$data['now_id']);\r\n $patient_id = $this->uri->segment(4);\r\n $data['patient_id'] = $patient_id;\r\n $data['init_patient_id'] = $patient_id;\r\n $data['summary_id'] = $this->uri->segment(5);\r\n $data['patient_info'] = $this->memr_rdb->get_patient_demo($data['patient_id']);\r\n $data['patcon_info'] = $this->memr_rdb->get_patcon_details($data['patient_id'],$data['summary_id']);\r\n $data['vitals_info'] = $this->memr_rdb->get_patcon_vitals($data['summary_id']);\r\n\r\n if ($data['vitals_info']['vital_id'] == \"new_vitals\") {\r\n // New vitals\r\n \t\t$data['save_attempt'] = 'ADD VITAL SIGNS';\r\n\t //$data['vitals_info'] = array();\r\n $data['init_vital_id'] = $data['vitals_info']['vital_id'];\r\n $data['init_reading_date'] = $data['now_date'];\r\n $data['init_reading_time'] = $data['now_time'];\r\n $data['init_height'] = NULL;\r\n $data['init_weight'] = NULL;\r\n $data['init_left_vision'] = NULL;\r\n $data['init_right_vision'] = NULL;\r\n $data['init_temperature'] = NULL;\r\n $data['init_pulse_rate'] = NULL;\r\n $data['init_bmi'] = NULL;\r\n $data['init_waist_circumference']= NULL;\r\n $data['init_bp_systolic'] = NULL;\r\n $data['init_bp_diastolic'] = NULL;\r\n $data['init_respiration_rate'] = NULL;\r\n $data['init_ofc'] = NULL;\r\n $data['init_remarks'] = NULL;\r\n } else {\r\n // Editing vitals\r\n \t\t$data['save_attempt'] = 'EDIT VITAL SIGNS';\r\n $data['init_patient_id'] = $data['patient_id'];\r\n $data['init_vital_id'] = $data['vitals_info']['vital_id'];\r\n $data['init_reading_date'] = $data['vitals_info']['reading_date'];\r\n $data['init_reading_time'] = $data['vitals_info']['reading_time'];\r\n $data['init_height'] = $data['vitals_info']['height'];\r\n $data['init_weight'] = $data['vitals_info']['weight'];\r\n $data['init_left_vision'] = $data['vitals_info']['left_vision'];\r\n $data['init_right_vision'] = $data['vitals_info']['right_vision'];\r\n $data['init_temperature'] = $data['vitals_info']['temperature'];\r\n $data['init_pulse_rate'] = $data['vitals_info']['pulse_rate'];\r\n $data['init_bmi'] = $data['vitals_info']['bmi'];\r\n $data['init_waist_circumference']= $data['vitals_info']['waist_circumference'];\r\n $data['init_bp_systolic'] = $data['vitals_info']['bp_systolic'];\r\n $data['init_bp_diastolic'] = $data['vitals_info']['bp_diastolic'];\r\n $data['init_respiration_rate'] = $data['vitals_info']['respiration_rate'];\r\n $data['init_ofc'] = $data['vitals_info']['ofc'];\r\n $data['init_remarks'] = $data['vitals_info']['remarks'];\r\n } //endif ($patient_id == \"new_vitals\")\r\n } //endif(count($_POST))\r\n\r\n\t\t$this->load->vars($data);\r\n // Run validation\r\n\t\tif ($this->form_validation->run('edit_vitals') == FALSE){\r\n\t\t //$this->load->view('ehr_patient/emr_edit_patient_html');\t\t\t\r\n if ($_SESSION['thirra_mode'] == \"ehr_mobile\"){\r\n $new_header = \"ehr/header_xhtml-mobile10\";\r\n $new_banner = \"ehr/banner_ehr_conslt_wap\";\r\n $new_sidebar= \"ehr/sidebar_ehr_patients_conslt_wap\";\r\n //$new_body = \"ehr/emr_edit_vitals_wap\";\r\n $new_body = \"ehr/ehr_edit_vitals_html\";\r\n $new_footer = \"ehr/footer_emr_wap\";\r\n } else {\r\n //$new_header = \"ehr/header_xhtml1-strict\";\r\n $new_header = \"ehr/header_xhtml1-transitional\";\r\n $new_banner = \"ehr/banner_ehr_conslt_html\";\r\n $new_sidebar= \"ehr/sidebar_ehr_patients_conslt_html\";\r\n $new_body = \"ehr/ehr_edit_vitals_html\";\r\n $new_footer = \"ehr/footer_emr_html\";\r\n }\r\n $this->load->view($new_header);\t\t\t\r\n $this->load->view($new_banner);\t\t\t\r\n $this->load->view($new_sidebar);\t\t\t\r\n $this->load->view($new_body);\t\t\t\r\n $this->load->view($new_footer);\t\t\t\r\n } else {\r\n //echo \"\\nValidated successfully.\";\r\n //echo \"<pre>\";\r\n //print_r($data);\r\n //echo \"</pre>\";\r\n //echo \"<br />Insert record\";\r\n if($data['vital_id'] == \"new_vitals\") {\r\n // New patient vital signs\r\n $ins_vitals_array = array();\r\n $ins_vitals_array['staff_id'] = $_SESSION['staff_id'];\r\n $ins_vitals_array['now_id'] = $data['now_id'];\r\n $ins_vitals_array['vital_id'] = $data['now_id'];\r\n $ins_vitals_array['patient_id'] = $data['init_patient_id'];\r\n $ins_vitals_array['session_id'] = $data['summary_id'];\r\n $ins_vitals_array['adt_id'] = $data['summary_id'];\r\n $ins_vitals_array['reading_date'] = $data['init_reading_date'];\r\n $ins_vitals_array['reading_time'] = $data['init_reading_time'];\r\n if(is_numeric($data['init_height'])){\r\n $ins_vitals_array['height'] = $data['init_height'];\r\n }\r\n if(is_numeric($data['init_weight'])){\r\n $ins_vitals_array['weight'] = $data['init_weight'];\r\n }\r\n $ins_vitals_array['left_vision'] = $data['init_left_vision'];\r\n $ins_vitals_array['right_vision'] = $data['init_right_vision'];\r\n if(is_numeric($data['init_temperature'])){\r\n $ins_vitals_array['temperature'] = $data['init_temperature'];\r\n }\r\n if(is_numeric($data['init_pulse_rate'])){\r\n $ins_vitals_array['pulse_rate'] = $data['init_pulse_rate'];\r\n }\r\n if(is_numeric($data['init_bmi'])){\r\n $ins_vitals_array['bmi'] = $data['init_bmi'];\r\n }\r\n if(is_numeric($data['init_waist_circumference'])){\r\n $ins_vitals_array['waist_circumference']= $data['init_waist_circumference'];\r\n }\r\n if(is_numeric($data['init_bp_systolic'])){\r\n $ins_vitals_array['bp_systolic'] = $data['init_bp_systolic'];\r\n }\r\n if(is_numeric($data['init_bp_diastolic'])){\r\n $ins_vitals_array['bp_diastolic'] = $data['init_bp_diastolic'];\r\n }\r\n if(is_numeric($data['init_respiration_rate'])){\r\n $ins_vitals_array['respiration_rate'] = $data['init_respiration_rate'];\r\n }\r\n if(is_numeric($data['init_ofc'])){\r\n $ins_vitals_array['ofc'] = $data['init_ofc'];\r\n }\r\n $ins_vitals_array['remarks'] = $data['init_remarks'];\r\n if($data['offline_mode']){\r\n $ins_vitals_array['synch_out'] = $data['now_id'];\r\n }\r\n\t $ins_vitals_data = $this->mconsult_wdb->insert_new_vitals($ins_vitals_array);\r\n $this->session->set_flashdata('data_activity', 'Vital signs added.');\r\n } else {\r\n //Edit patient vital signs\r\n $ins_vitals_array = array();\r\n $ins_vitals_array['staff_id'] = $_SESSION['staff_id'];\r\n $ins_vitals_array['now_id'] = $data['now_id'];\r\n $ins_vitals_array['vital_id'] = $data['vital_id'];\r\n $ins_vitals_array['patient_id'] = $data['init_patient_id'];\r\n $ins_vitals_array['session_id'] = $data['summary_id'];\r\n $ins_vitals_array['adt_id'] = $data['summary_id'];\r\n $ins_vitals_array['reading_date'] = $data['init_reading_date'];\r\n $ins_vitals_array['reading_time'] = $data['init_reading_time'];\r\n if(is_numeric($data['init_height'])){\r\n $ins_vitals_array['height'] = $data['init_height'];\r\n }\r\n if(is_numeric($data['init_weight'])){\r\n $ins_vitals_array['weight'] = $data['init_weight'];\r\n }\r\n $ins_vitals_array['left_vision'] = $data['init_left_vision'];\r\n $ins_vitals_array['right_vision'] = $data['init_right_vision'];\r\n if(is_numeric($data['init_temperature'])){\r\n $ins_vitals_array['temperature'] = $data['init_temperature'];\r\n }\r\n if(is_numeric($data['init_pulse_rate'])){\r\n $ins_vitals_array['pulse_rate'] = $data['init_pulse_rate'];\r\n }\r\n if(is_numeric($data['init_bmi'])){\r\n $ins_vitals_array['bmi'] = $data['init_bmi'];\r\n }\r\n if(is_numeric($data['init_waist_circumference'])){\r\n $ins_vitals_array['waist_circumference']= $data['init_waist_circumference'];\r\n }\r\n if(is_numeric($data['init_bp_systolic'])){\r\n $ins_vitals_array['bp_systolic'] = $data['init_bp_systolic'];\r\n }\r\n if(is_numeric($data['init_bp_diastolic'])){\r\n $ins_vitals_array['bp_diastolic'] = $data['init_bp_diastolic'];\r\n }\r\n if(is_numeric($data['init_respiration_rate'])){\r\n $ins_vitals_array['respiration_rate'] = $data['init_respiration_rate'];\r\n }\r\n if(is_numeric($data['init_ofc'])){\r\n $ins_vitals_array['ofc'] = $data['init_ofc'];\r\n }\r\n $ins_vitals_array['remarks'] = $data['init_remarks'];\r\n\t $ins_vitals_data = $this->mconsult_wdb->update_vitals($ins_vitals_array);\r\n $this->session->set_flashdata('data_activity', 'Vital signs updated.');\r\n \r\n } //endif($data['patient_id'] == \"new_patient\")\r\n $new_page = base_url().\"index.php/ehr_consult/consult_episode/\".$data['patient_id'].\"/\".$data['summary_id'];\r\n header(\"Status: 200\");\r\n header(\"Location: \".$new_page);\r\n\r\n } // endif ($this->form_validation->run('edit_vitals') == FALSE)\r\n\t\t//$this->load->view('bio/bio_new_case_hosp');\r\n }", "public function edit($id)\n {\n $this->updateMode = true;\n $agencies = agenc::findOrFail($id);\n $this->agency_id = $id;\n\n $this->name = $agencies->name;\n $this->code = $agencies->code;\n $this->phone = $agencies->phone;\n $this->fax = $agencies->fax;\n $this->email = $agencies->email;\n $this->address = $agencies->address;\n $this->country = $agencies->country;\n $this->status = 1;\n\n //$this->openModal();\n }" ]
[ "0.6759971", "0.607703", "0.6065451", "0.6003086", "0.59321576", "0.5928553", "0.5907406", "0.59060633", "0.59058255", "0.5900764", "0.5887417", "0.58755285", "0.5823116", "0.5808946", "0.58077496", "0.5791618", "0.5781172", "0.57599366", "0.5738424", "0.57347804", "0.5733576", "0.57272667", "0.5719958", "0.57076734", "0.56846386", "0.568115", "0.56787497", "0.5670766", "0.5658472", "0.56479204", "0.56474066", "0.56410724", "0.56319475", "0.56319475", "0.5631481", "0.5621056", "0.5607636", "0.5597165", "0.5592226", "0.55864024", "0.55864024", "0.55864024", "0.5582507", "0.55760854", "0.55727166", "0.55704087", "0.5565827", "0.55657554", "0.55438244", "0.55418843", "0.5535953", "0.5529943", "0.55187315", "0.55168647", "0.5498774", "0.5498355", "0.5498355", "0.5498355", "0.5497365", "0.54955375", "0.54931986", "0.54896754", "0.5489044", "0.54847777", "0.5483393", "0.5483393", "0.5483393", "0.5483393", "0.5483393", "0.5483393", "0.5483393", "0.5483393", "0.5483393", "0.5483393", "0.5483393", "0.5483393", "0.5483238", "0.54824466", "0.5472682", "0.54715794", "0.54697245", "0.546863", "0.54672116", "0.5462378", "0.54618716", "0.5459463", "0.545939", "0.5455898", "0.54541844", "0.54501605", "0.5445433", "0.544209", "0.5431712", "0.5427328", "0.5427328", "0.5422802", "0.5418408", "0.54177165", "0.5411837", "0.5408441" ]
0.6292633
1
/================================ Edit recipe ===========================
public function editrecipe($id) { if($this->uri->segment(3)=="") { $this->session->set_flashdata('err_msg', 'Dont Change the URL physically'); redirect('admin/recipe/viewrecipe'); } $data_class['all_difficulty'] = $this->Recipe_model->difficulty_allvalue(); $data_class['all_meal'] = $this->Recipe_model->meal_allvalue(); $data_class['all_category'] = $this->Recipe_model->category_allvalue(); $data_class['all_unit'] = $this->Recipe_model->unit_allvalue(); $data_class['all_instruction'] = $this->Recipe_model->instruction_allvalue(); $data_class['all_ingredients'] = $this->Recipe_model->ingredients_allvalue(); $data_class['all_nutritional'] = $this->Recipe_model->nutritional_allvalue(); if ($this->input->server('REQUEST_METHOD') == 'POST') { extract($_POST); extract($_FILES); /*echo "<pre>"; print_r($_POST); print_r($_FILES); echo "</pre>";*/ //print_r($lastid); //echo $recipe_code;die("here"); //INSERT INSTUCTION for($i=0;$i<count($inst_name);$i++){ $this->load->library('upload'); $_FILES['userfile']['name']=$_FILES['ins_image']['name'][$i]; $_FILES['userfile']['type'] = $_FILES['ins_image']['type'][$i]; $_FILES['userfile']['tmp_name'] = $_FILES['ins_image']['tmp_name'][$i]; $_FILES['userfile']['error'] = $_FILES['ins_image']['error'][$i]; $_FILES['userfile']['size'] = $_FILES['ins_image']['size'][$i]; $config['upload_path'] = '../uploads/recipe_image/instruction'; $config['allowed_types'] = 'png|jpg|jpeg'; $config['max_size'] = 100000; //$config['max_width'] = 1024; // $config['max_height'] = 768; $this->upload->initialize($config); if (! $this->upload->do_upload()) { $error = array('error' => $this->upload->display_errors()); } else { $instruction['recipe_code']=$recipe_code; $instruction['name']=$inst_name[$i]; $final_files_data[] = $this->upload->data(); $instruction['images']= $final_files_data[0]['file_name']; $data_instuction_insert = $this->Recipe_model->instruction_insert($instruction); } } //insert into ingradients //$delete_ingradient=$this->Recipe_model->delete_ingredient($recipe_code); for($ig=0;$ig<count($ing_name);$ig++){ $ingradients['recipe_code']=$recipe_code; $ingradients['name']=$ing_name[$ig]; $ingradients['quantity']=$ing_quantity[$ig]; $ingradients['unit']=$ing_unit[$ig]; $data_ingradients_insert = $this->Recipe_model->ingradients_insert($ingradients); } //insert nutrituioin element for($ne=0;$ne<count($ne_name);$ne++){ $nutrition['recipe_code']=$recipe_code; $nutrition['name']=$ne_name[$ne]; $nutrition['quantity']=$ne_quantity[$ne]; $nutrition['unit']=$ne_unit[$ne]; $data_nutrition_insert = $this->Recipe_model->nutrition_insert($nutrition); } //die("here"); $data['recipe_code']= strip_tags($recipe_code); $name=strip_tags($this->input->post('recipe_name')); $data['slug'] = strtolower(trim(preg_replace('/[^A-Za-z0-9-]+/', '-', $name))); $data['recipe_name']= strip_tags($this->input->post('recipe_name')); $data['preparetion_time']= strip_tags($this->input->post('preparetion_time')); $data['cook_time']= strip_tags($this->input->post('cook_time')); $data['serving_people']= strip_tags($this->input->post('serving_people')); $data['dificulty']= strip_tags($this->input->post('dificulty')); $data['type_of_meal']= strip_tags($this->input->post('type_of_meal')); $data['category']=json_encode($this->input->post('category')); //print_r($data['category']);die(); $data['description']= $this->input->post('description'); $data['status']= strip_tags($this->input->post('status')); $now = date('Y-m-d'); $data['created_on'] =$now; $data['approve_on']=date('Y-m-d H:i:s'); $this->form_validation->set_rules('recipe_name', 'Recipe Name', 'trim|required'); $this->form_validation->set_rules('preparetion_time', 'Preparetion Time', 'trim|required'); $this->form_validation->set_rules('cook_time', 'Cook Time', 'trim|required'); $this->form_validation->set_rules('serving_people', 'Serving People', 'trim|required'); $this->form_validation->set_rules('dificulty', 'Dificulty', 'trim|required'); $this->form_validation->set_rules('type_of_meal', 'Type Of Meal', 'trim|required'); $this->form_validation->set_rules('description', 'Description', 'trim|required'); $this->load->library('upload'); $number_of_files_uploaded = count($_FILES['feature_image']['name']); // Faking upload calls to $_FILE $_FILES['userfile']['name'] = $_FILES['feature_image']['name']; $_FILES['userfile']['type'] = $_FILES['feature_image']['type']; $_FILES['userfile']['tmp_name'] = $_FILES['feature_image']['tmp_name']; $_FILES['userfile']['error'] = $_FILES['feature_image']['error']; $_FILES['userfile']['size'] = $_FILES['feature_image']['size']; $config['upload_path'] = '../uploads/recipe_image'; $config['allowed_types'] = 'png|jpg|jpeg'; $config['max_size'] = 100000; //$config['max_width'] = 1024; // $config['max_height'] = 768; $this->upload->initialize($config); if (! $this->upload->do_upload()) { $error = array('error' => $this->upload->display_errors()); } else { $final_files_data[] = $this->upload->data(); $data['feature_image']= $final_files_data[0]['file_name']; if ($this->form_validation->run() == TRUE) { $data_inserted = $this->Recipe_model->edit_data($data,$id); $this->session->set_flashdata('success_msg', 'Recipe edited Successfully'); redirect('admin/recipe/viewrecipe'); } } } $site_name=$this->config->item('site_name'); $this->template->set('title', 'Edit Recipe | '.$site_name); $data_single = $this->Recipe_model->get_data_by_recipecode($id); $data_class['recipe_all']=$data_single ; $data_class['ingredients']=$this->Ingredients_model->get_data_by_recipe_code($id); $data_class['instruction']=$this->Recipe_model->instruction_by_recipecode($id); $data_class['nutrition_element']=$this->Nutritional_elements_model->get_data_by_recipecode($id); //print_r($data_single);die(); $this->template->set_layout('layout_main', 'front'); $this->template->build('editrecipe',$data_class); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function edit(Recipe $recipe)\n {\n //\n }", "public function edit(Recipe $recipe)\n {\n //\n }", "public function edit(Chef $chef)\n {\n //\n }", "public function edit(Python $python)\n {\n //\n }", "public function edit()\n\t{\n\t\t//\n\t}", "public function edit() {\n\t\t\t\n\t\t}", "function ciniki_recipes_recipeUpdate(&$ciniki) {\n // \n // Find all the required and optional arguments\n // \n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'prepareArgs');\n $rc = ciniki_core_prepareArgs($ciniki, 'no', array(\n 'tnid'=>array('required'=>'yes', 'blank'=>'no', 'name'=>'Tenant'), \n 'recipe_id'=>array('required'=>'yes', 'blank'=>'no', 'name'=>'Recipe'), \n 'name'=>array('required'=>'no', 'blank'=>'no', 'name'=>'Name'), \n 'primary_image_id'=>array('required'=>'no', 'blank'=>'yes', 'name'=>'Image'),\n 'num_servings'=>array('required'=>'no', 'blank'=>'yes', 'name'=>'Number of Servings'), \n 'webflags'=>array('required'=>'no', 'blank'=>'yes', 'name'=>'Web Flags'), \n 'prep_time'=>array('required'=>'no', 'blank'=>'yes', 'name'=>'Prep Time'), \n 'roast_time'=>array('required'=>'no', 'blank'=>'yes', 'name'=>'Roast Time'), \n 'cook_time'=>array('required'=>'no', 'blank'=>'yes', 'name'=>'Cook Time'), \n 'synopsis'=>array('required'=>'no', 'blank'=>'yes', 'name'=>'Synopsis'), \n 'description'=>array('required'=>'no', 'blank'=>'yes', 'name'=>'Description'), \n 'ingredients'=>array('required'=>'no', 'blank'=>'yes', 'name'=>'Ingredients'), \n 'instructions'=>array('required'=>'no', 'blank'=>'yes', 'name'=>'Instructions'), \n 'notes'=>array('required'=>'no', 'blank'=>'yes', 'name'=>'Notes'), \n 'tag-10'=>array('required'=>'no', 'blank'=>'yes', 'type'=>'list', 'delimiter'=>'::', 'name'=>'Meals'),\n 'tag-20'=>array('required'=>'no', 'blank'=>'yes', 'type'=>'list', 'delimiter'=>'::', 'name'=>'Ingredients'),\n 'tag-30'=>array('required'=>'no', 'blank'=>'yes', 'type'=>'list', 'delimiter'=>'::', 'name'=>'Cuisines'),\n 'tag-40'=>array('required'=>'no', 'blank'=>'yes', 'type'=>'list', 'delimiter'=>'::', 'name'=>'Methods'),\n 'tag-50'=>array('required'=>'no', 'blank'=>'yes', 'type'=>'list', 'delimiter'=>'::', 'name'=>'Occasions'),\n 'tag-60'=>array('required'=>'no', 'blank'=>'yes', 'type'=>'list', 'delimiter'=>'::', 'name'=>'Diets'),\n 'tag-70'=>array('required'=>'no', 'blank'=>'yes', 'type'=>'list', 'delimiter'=>'::', 'name'=>'Seasons'),\n 'tag-80'=>array('required'=>'no', 'blank'=>'yes', 'type'=>'list', 'delimiter'=>'::', 'name'=>'Collections'),\n 'tag-90'=>array('required'=>'no', 'blank'=>'yes', 'type'=>'list', 'delimiter'=>'::', 'name'=>'Products'),\n 'tag-100'=>array('required'=>'no', 'blank'=>'yes', 'type'=>'list', 'delimiter'=>'::', 'name'=>'Contributors'),\n )); \n if( $rc['stat'] != 'ok' ) { \n return $rc;\n } \n $args = $rc['args'];\n\n // \n // Make sure this module is activated, and\n // check permission to run this function for this tenant\n // \n ciniki_core_loadMethod($ciniki, 'ciniki', 'recipes', 'private', 'checkAccess');\n $rc = ciniki_recipes_checkAccess($ciniki, $args['tnid'], 'ciniki.recipes.recipeUpdate'); \n if( $rc['stat'] != 'ok' ) { \n return $rc;\n } \n\n if( isset($args['name']) ) {\n $args['permalink'] = preg_replace('/ /', '-', preg_replace('/[^a-z0-9 ]/', '', strtolower($args['name'])));\n //\n // Make sure the permalink is unique\n //\n $strsql = \"SELECT id, name, permalink FROM ciniki_recipes \"\n . \"WHERE tnid = '\" . ciniki_core_dbQuote($ciniki, $args['tnid']) . \"' \"\n . \"AND permalink = '\" . ciniki_core_dbQuote($ciniki, $args['permalink']) . \"' \"\n . \"AND id <> '\" . ciniki_core_dbQuote($ciniki, $args['recipe_id']) . \"' \"\n . \"\";\n $rc = ciniki_core_dbHashQuery($ciniki, $strsql, 'ciniki.recipes', 'recipe');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n if( $rc['num_rows'] > 0 ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.recipes.16', 'msg'=>'You already have a recipe with this name, please choose another name'));\n }\n }\n\n // \n // Turn off autocommit\n // \n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbTransactionStart');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbTransactionRollback');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbTransactionCommit');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbQuote');\n $rc = ciniki_core_dbTransactionStart($ciniki, 'ciniki.recipes');\n if( $rc['stat'] != 'ok' ) { \n return $rc;\n } \n\n //\n // Update the recipe\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'objectUpdate');\n $rc = ciniki_core_objectUpdate($ciniki, $args['tnid'], 'ciniki.recipes.recipe', \n $args['recipe_id'], $args);\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n\n //\n // Update the tags\n //\n $tag_types = array(\n '10'=>'meals',\n '20'=>'mainingredients',\n '30'=>'cuisines',\n '40'=>'methods',\n '50'=>'occasions',\n '60'=>'diets',\n '70'=>'seasons',\n '80'=>'collections',\n '90'=>'products',\n '100'=>'contributors',\n );\n foreach($tag_types as $tag_type => $arg_name) {\n if( isset($args['tag-' . $tag_type]) ) {\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'tagsUpdate');\n $rc = ciniki_core_tagsUpdate($ciniki, 'ciniki.recipes', 'tag', $args['tnid'],\n 'ciniki_recipe_tags', 'ciniki_recipe_history',\n 'recipe_id', $args['recipe_id'], $tag_type, $args['tag-' . $tag_type]);\n if( $rc['stat'] != 'ok' ) {\n ciniki_core_dbTransactionRollback($ciniki, 'ciniki.recipes');\n return $rc;\n }\n }\n }\n\n //\n // Commit the database changes\n //\n $rc = ciniki_core_dbTransactionCommit($ciniki, 'ciniki.recipes');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n\n //\n // Update the last_change date in the tenant modules\n // Ignore the result, as we don't want to stop user updates if this fails.\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'tenants', 'private', 'updateModuleChangeDate');\n ciniki_tenants_updateModuleChangeDate($ciniki, $args['tnid'], 'ciniki', 'recipes');\n\n return array('stat'=>'ok');\n}", "function update() {\n\t\tglobal $DB_LINK, $db_table_recipes, $LangUI;\n\t\t$sql = \"\n\t\t\tUPDATE $db_table_recipes\n\t\t\tSET recipe_name='\".$DB_LINK->addq($this->name, get_magic_quotes_gpc()).\"',\n\t\t\t\trecipe_ethnic='\".$DB_LINK->addq($this->ethnic, get_magic_quotes_gpc()).\"',\n\t\t\t\trecipe_base=\".$DB_LINK->addq($this->base, get_magic_quotes_gpc()).\",\n\t\t\t\trecipe_course=\".$DB_LINK->addq($this->course, get_magic_quotes_gpc()).\",\n\t\t\t\trecipe_prep_time=\".$DB_LINK->addq($this->prep_time, get_magic_quotes_gpc()).\",\n\t\t\t\trecipe_difficulty=\".$DB_LINK->addq($this->difficulty, get_magic_quotes_gpc()).\",\n\t\t\t\trecipe_directions='\".$DB_LINK->addq($this->directions, get_magic_quotes_gpc()).\"',\n\t\t\t\trecipe_comments='\".$DB_LINK->addq($this->comments, get_magic_quotes_gpc()).\"',\n\t\t\t\trecipe_serving_size=\".$DB_LINK->addq($this->serving_size, get_magic_quotes_gpc()).\",\n\t\t\t\trecipe_source_desc='\".$DB_LINK->addq($this->source_desc, get_magic_quotes_gpc()).\"',\n\t\t\t\trecipe_source=\".$DB_LINK->addq($this->source, get_magic_quotes_gpc()).\",\n\t\t\t\trecipe_private='\".$DB_LINK->addq($this->private, get_magic_quotes_gpc()).\"',\n\t\t\t\trecipe_modified=$this->modified,\n\t\t\t\trecipe_user='\".$DB_LINK->addq($this->user, get_magic_quotes_gpc()).\"'\n\t\t\t\tWHERE recipe_id=\".$DB_LINK->addq($this->id, get_magic_quotes_gpc()).\"\";\n\n\t\t$rc = $DB_LINK->Execute($sql);\n\t\tDBUtils::checkResult($rc, $LangUI->_('Recipe Successfully updated') . \": \". $this->name,\n\t\t\t$LangUI->_('There was an error updating the recipe'), $sql);\n\t}", "public function edit()\n\t{\n\t\t\n\t}", "public function edit()\n {\n \n }", "public function edit($data = null)\n {\n $old_recipe = $this->find('first', array('conditions' => array('Recipe.id' => $data['Recipe']['id'])));\n\n // Update data from the old model\n $new_recipe['Recipe']['previous_id'] = $old_recipe['Recipe']['id'];\n $new_recipe['Recipe']['original_id'] = $old_recipe['Recipe']['original_id'];\n $new_recipe['Recipe']['created'] = $old_recipe['Recipe']['created'];\n\n // Update data from the view\n $new_recipe['Recipe']['name'] = $data['Recipe']['name'];\n $new_recipe['Recipe']['price'] = $data['Recipe']['price'];\n\n $new_recipe['Recipe']['intern_product_code'] = $data['Recipe']['intern_product_code'];\n\n\n // Check if any care_labels was given\n if(!empty($data['Yarn']))\n {\n // TODO fix Recipes such if the yarn is changed, change the relation or delete the relation\n $new_recipe['Yarn'] = $data['Yarn']; \n }\n\n if(!empty($data['Category']))\n {\n // TODO fix Recipes such if the yarn is changed, change the relation or delete the relation\n $new_recipe['Category'] = $data['Category']; \n }\n\n // If the save went well\n if(!$this->saveAll($new_recipe))\n {\n return false;\n }\n $new_id = $this->id;\n\n // Upload a new image of the recipe if there is one given\n if(!empty($data['Recipe']['image']) && FileComponent::fileGiven($data['Recipe']['image']))\n {\n // Check if the upload went well (The image is limited to 500 x 500 pixels)\n if(!FileComponent::uploadAndResizeImage($data['Recipe']['image'], $new_id, 'png', 'recipes', 500, 500))\n { \n // Delete the entry in the database\n $this->delete($new_id);\n\n // It did not go well delete the image and inform the user\n SessionComponent::setFlash('Billedet til denne opskrift blev ikke uploadet korrekt. Opskriften blev ikke gemt.'.SessionComponent::read('Message.error.message'), null, array(), 'error');\n return false;\n }\n }\n else\n {\n FileComponent::copyFile($old_recipe['Recipe']['id'],'png', true, 'recipes', $new_id, 'png', true, 'recipes');\n }\n\n // Upload a new pdf of the variant if there is one given\n if(!empty($data['Recipe']['image']) && FileComponent::fileGiven($data['Recipe']['image']))\n {\n // Check if the upload went well\n if(!FileComponent::uploadFile($this->data['Recipe']['pdf'], $new_id, 'pdf', false, 'recipes'))\n { \n // Delete the entry in the database\n $this->delete($new_id);\n\n // It did not go well delete the image and inform the user\n SessionComponent::setFlash('PDF-filen til denne opskrift blev ikke uploadet korrekt. Opskriften blev ikke gemt.'.SessionComponent::read('Message.error.message'), null, array(), 'error');\n return false;\n }\n }\n else\n {\n FileComponent::copyFile($old_recipe['Recipe']['id'],'pdf', false, 'recipes', $new_id, 'pdf', false, 'recipes');\n }\n\n // Update the parrent of the old model\n $old_recipe['Recipe']['parrent_id'] = $new_id;\n $old_recipe = $this->save($old_recipe);\n\n // Update the relation before deleting the old version\n $this->updateYarnRelation($old_recipe['Recipe']['id'], $new_id);\n\n // Set the old version to inactive\n $this->deactivate($old_recipe['Recipe']['id'], true);\n\n // If the save went well\n if(empty($old_recipe))\n {\n return false;\n }\n\n // It all went well\n return true;\n }", "public function edit( )\r\n {\r\n //\r\n }", "public function edit() {\n }", "protected function editar()\n {\n }", "abstract protected function renderEdit();", "public function edit()\n {\n \n \n }", "public function edit()\n {\n \n }", "public function edit()\n {\n \n }", "public function edit()\n {\n \n }", "public function edit()\n {\n //\n\t\treturn 'ini halaman edit';\n }", "public function edit(RecipeList $recipeList)\n {\n //\n }", "public function edit()\n {\n }", "public function edit()\n {\n }", "public function edit()\n {\n }", "public function edit(Shelf $shelf)\n {\n //\n }", "public function editAction(){\n\t\t$recipe = new Recipe();\n\t\t\n\t\t//updating the meal\n\t\tif ($this->_request->isPost()) {\n\t\n\t\t\t$data = $this->_validateRecipe();\n\t\t\t//if no errors validating fields add recipe\n\t\t\tif ($this->view->errorMsg == null) {\n\t\t\t\t$recipe_id = $this->_request->getPost('recipe_idTF');\n\t\t\t\t\n\t\t\t\t//make sure recipe with this name does not already exist\n\t\t\t\t$where = array(\n\t\t\t\t\t$recipe->getAdapter()->quoteInto('user_id = ?', $this->session->user_id),\n\t\t\t\t\t$recipe->getAdapter()->quoteInto('recipe_id != ?', $recipe_id),\n\t\t\t\t\t$recipe->getAdapter()->quoteInto('title = ?', $data['recipe']['title']),\n\t\t\t\t\t'status is null'\n\t\t\t\t); \n\t\t\t\t$recipe_row = $recipe->fetchRow($where);\n\t\t\t\tif($recipe_row != null){\n\t\t\t\t\t$this->view->errorMsg = 'Meal \"'.$data['recipe']['title'].'\" already exists, please use a different title.';\n\t\t\t\t\t$data['recipe']['recipe_id'] = $recipe_id;\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t//update recipe\n\t\t\t\t\t$where = $recipe->getAdapter()->quoteInto('recipe_id = ?', $recipe_id);\n\t\t\t\t\t$recipe->update($data['recipe'], $where);\n\t\n\t\t\t\t\t//delete old recipexquantityxingredients\n\t\t\t\t\t$rxqxi = new RecipexQuantityxIngredient();\n\t\t\t\t\t$where = $rxqxi->getAdapter()->quoteInto('recipe_id = ?', $recipe_id);\n\t\t\t\t\t$rxqxi->delete($where);\n\t\t\t\t\t\n\t\t\t\t\t$this->_saveRecipexQuantityxIngredient($recipe_id, $data);\n\t\t\n\t\t\t\t\t//if successful, redirect to main page\n\t\t\t\t \t$this->_redirect($this->baseUrl.'/meals');\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\n\t\t\t$this->view->recipe_data = $data;\t\t\n\t\t}\n\t\t//get meal to display in edit form\n\t\telse{\n\t\t\t$filter = new Zend_Filter_StripTags();\n\t\t\t$id = trim($filter->filter($this->_request->getQuery('id')));\n\t\t\tif($id != null){\n\t\t\t\t$where = $recipe->getAdapter()->quoteInto('recipe_id = ?', $id);\n\t\t\t\t$row = $recipe->fetchRow($where);\n\t\t\n\t\t\t\t$data = $this->_getRecipe($row);\n\t\t\t\t$this->view->recipe_data = $data;\n\t\t\n\t\t\t}\n\t\t}\n\t\n\n\t\t//populate amounts and ingredients for autocomplete textfields (COPY&PASTE = YUCK!)\n \t$ingredient_arr = array();\n \t$ingredient = new Ingredient();\n\t\t$ingredient_rs = $ingredient->fetchAll();\n\t\t$i = 0;\n\t\twhile($ingredient_rs->valid()){\n\t\t\t$ingredient = $ingredient_rs->current();\n\t\t\t$ingredient_arr[$i] = $ingredient->name;\n\t\t\t$i++;\n\t\t\t$ingredient_rs->next();\n\t\t}\n \t$this->view->ingredient_data = $ingredient_arr;\n\t\n \t$amount_arr = array();\n \t$quantity = new Quantity();\n\t\t$quantity_rs = $quantity->fetchAll();\n\t\t$i = 0;\n\t\twhile($ingredient_rs->valid()){\n\t\t\t$amount = $quantity_rs->current();\n\t\t\tif($amount->measure != null) $amount_arr[$i] = $this->_convertd2f($amount->amount).' '.$amount->measure;\n\t\t\telse $amount_arr[$i] = $amount->amount;\n\t\t\t$i++;\n\t\t\t$quantity_rs->next();\n\t\t}\n \t$this->view->amount_data = $amount_arr;\n \t\n \t\n \t\n \t// additional view fields required by form\n\t\t$this->view->action = 'edit';\n\t\t$this->_helper->viewRenderer->setNoRender();\n\t\t$this->render('add');\n }", "public function edit() {\n\n }", "public function edit()\n { }", "public function edit()\r\n {\r\n //\r\n }", "public function edit()\r\n {\r\n //\r\n }", "public function edit(Flavor $flavor)\n {\n //\n }", "public function edit()\n { \n }", "public function Edit()\n\t{\n\t\t\n\t}", "public function edit()\n {\n\n }", "public function edit()\n {\n\n }", "public function edit()\n {\n\n }", "public function edit()\n {\n\n }", "public function edit(Run $run)\n {\n //\n }", "public function edit(Run $run)\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit()\r\n\t{\r\n\t\t$id_definition = $this->input->post('id_item_definition');\r\n\r\n\t\t$definition = array();\r\n\t\t$this->item_definition_model->feed_blank_template($definition);\r\n\t\t$this->item_definition_model->feed_blank_lang_template($definition);\r\n\r\n\t\t// Existing\r\n\t\tif ($id_definition)\r\n\t\t{\r\n\t\t\t$definition = $this->item_definition_model->get(array(\r\n\t\t\t\t$this->item_definition_model->get_pk_name() => $id_definition)\r\n\t\t\t);\r\n\r\n\t\t\t$this->item_definition_model->feed_lang_template($id_definition, $definition);\r\n\t\t}\r\n\r\n\t\t$this->template['definition'] = $definition;\r\n\r\n\t\t$this->output('item/definition/edit');\r\n\t}", "public function edit()\n {\n return \"Ini Halaman Edit\";\n }", "public function edit(ChefResponsibility $chefResponsibility)\n {\n //\n }", "public function editRegularContentFromId() {}", "function editItem() {\n\t\tglobal $HTML;\n\t\t$HTML->details(1);\n\t\t$name = stringOr($this->vars[\"name\"], $this->getQueryResult(0, \"name\"));\n\n\t\t$_ = '';\n\t\t$_ .= $HTML->head($this->translate(\"Edit point name\"));\n\t\t$_ .= $HTML->block($this->translate(\"Point\").\":\", $this->getQueryResult(0, \"file\"));\n\t\t$_ .= $HTML->input($this->varnames[\"name\"], \"name\", $name);\n\n\t\treturn $_;\n\t}", "public function edit(Variant $variant)\n {\n //\n }", "public function edit()\n {\n //\n }", "function edit() {\n\t\tglobal $tpl;\n\n\t\t$form = $this->initForm();\n\t\t$tpl->setContent($form->getHTML());\n\t}", "function procEdit($ar=NULL){\n $this->getComposedFullnam($ar);\n return parent::procEdit($ar);\n }", "public function editAction() {}", "public function edit()\r\n\r\n {\r\n\r\n $this->page_title->push(lang('menu_products_add'));\r\n\r\n $this->data['pagetitle'] = $this->page_title->show();\r\n\r\n\r\n /* Breadcrumbs :: Common */\r\n\r\n $this->breadcrumbs->unshift(1, lang('menu_products_add'), 'admin/setup/product/edit');\r\n\r\n\r\n /* Breadcrumbs */\r\n\r\n $this->data['breadcrumb'] = $this->breadcrumbs->show();\r\n\r\n\r\n /* Data */\r\n\r\n $this->data['error'] = NULL;\r\n\r\n $this->data['charset'] = 'utf-8';\r\n\r\n $this->data['form_url'] = 'admin/setup/product/update';\r\n\r\n\r\n /* Load Template */\r\n\r\n $this->template->admin_render('admin/products/edit', $this->data);\r\n\r\n\r\n }", "public function edit(Part $part)\n {\n //\n }", "public function edit(JournalEntry $entry)\n {\n //\n }", "public function edit(Version $version)\n {\n //\n }", "function wp_idolondemand_edit_post()\n{\n}", "public function editar()\n {\n }", "public function edit(FunFacts $funFacts)\n {\n //\n }", "public function edit(Readings $readings)\n {\n //\n }", "public function edit(Cow $cow)\n {\n //\n }", "public function edit(Exercice $exercice)\n {\n //\n }", "public function editingredients($id)\n\n {\n\n\t\tif($this->uri->segment(3)==\"\")\n\n\t\t{\n\n\t\t\t$this->session->set_flashdata('err_msg', 'Dont Change the URL physically'); \n\n\t\t\tredirect('admin/recipe/viewingredients');\t\n\n\t\t}\n\n\t\t\n\n\t\tif ($this->input->server('REQUEST_METHOD') == 'POST')\n\n\t\t{\n\n \n\n\t $data['name']= strip_tags($this->input->post('name'));\n\n\t\t\t$name=strip_tags($this->input->post('slug'));\n\n\t\t\t$data['slug'] = strtolower(trim(preg_replace('/[^A-Za-z0-9-]+/', '-', $name)));\n\n\t\t\t$data['description']= strip_tags($this->input->post('description'));\n\n\t\t\t$data['status']= strip_tags($this->input->post('status'));\n\n \n\n \n\n\t\t\t $this->form_validation->set_rules('name', 'Name', 'trim|required');\n\n\t\t\t $this->form_validation->set_rules('description', 'Description', 'trim|required');\n\n\t\t\t $this->form_validation->set_rules('slug', 'Slug', 'trim|required');\n\n \n\n if ($this->form_validation->run() == TRUE) {\n\n $data_inserted = $this->Ingredients_model->edit_data($data,$id);\n\n $this->session->set_flashdata('success_msg', 'Ingredient edited Successfully'); \n\n redirect('admin/recipe/viewingredients');\t\n\n }\n\n\t\t}\n\n\t\t\n\n\t\t\n\n\t\t$site_name=$this->config->item('site_name');\n\n\t $this->template->set('title', 'Edit Ingredients | '.$site_name);\n\n\t\t$data_single = $this->Ingredients_model->get_data_by_id($id);\n\n\t\t$data['ingredients']=$data_single ;\n\n\t\t//print_r($data_single);die();\n\n $this->template->set_layout('layout_main', 'front');\n\n $this->template->build('editingredients',$data);\n\n }", "public function edit_toko(){\n\t}", "public function edit($id)\n {\n $recipe = recipe::find($id);\n return $recipe;\n }", "public static function edit_image()\n{\n\n\n\t/*\n\t* Change Background\n\t*/\n\n\t/*\n\t* Change other setting\n\t*/\n}", "protected function editTaskAction() {}", "public function editAction() {\n\t\t$id = $this->getInput('id');\n\t\t$info = Fj_Service_Goods::getGoods(intval($id));\n $this->assign('dir', \"goods\");\n $this->assign('ueditor', true);\n\t\t$this->assign('info', $info);\n\t}", "public function editAction() {\n \t$id = $this->getInput('id');\n \tlist($info, $itemsList) = Admin_Service_Material::getById($id);\n \tforeach ($itemsList as $key=>$value) {\n\t \t$value['type'] = $value['type'] == 1 ? $this->ITEMTYPE[0] : $this->ITEMTYPE[1];//'gift':礼包,'link':链接\n \t $itemsList[$key] = $value;\n \t}\n \t\n \t$this->assign('info', $info);\n \t$this->assign('itemsList', $itemsList);\n $giftNameList = $this->getGiftName($itemsList);\n $this->assign('giftNameList', $giftNameList);\n \n \t$this->assign('dataType', $info[\"type\"] == 1 ?$this->DATATYPE[0] : $this->DATATYPE[1]);\n $this->assign('dataTypes', $this->DATATYPE);\n }", "public function onBeforeUninstall()\n {\n craft()->db->createCommand()->update(\n 'fields',\n array('type' => 'RichText'),\n array('type' => 'BetterRedactor')\n );\n }", "public function editView() {\n Template_Module::setFullWidth(true);\n $this->edit = true;\n $this->addView();\n // cestak obrázků\n $this->imagePath = $this->category()->getModule()->getDataDir(true);\n }", "public function edit(Reader $reader)\n {\n //\n }", "public function edit(Requierement $requierement)\n {\n //\n }", "public function editAction()\n {\n parent::editAction();\n $this->_fillMappingsArray();\n $this->_fillAvailableProperties();\n }", "public function editAction() {\n\t\t$id = $this->getInput('id');\n\t\t$info = Browser_Service_Recsite::getRecsite(intval($id));\t\t\n\t\t$this->assign('info', $info);\n\t\t$this->assign('models', $this->models);\n\t\t$this->assign('types', $this->types);\n\t}", "public function edit(Fuel $fuel)\n {\n //\n }", "public function edit(cr $cr)\n {\n //\n }", "public function edit(cr $cr)\n {\n //\n }", "public function edit(cr $cr)\n {\n //\n }", "public function edit(cr $cr)\n {\n //\n }", "public function edit(cr $cr)\n {\n //\n }", "public function edit(Defnaker $defnaker)\n {\n //\n }", "function a_edit() {\n\t\t$id = isset($_GET[\"id\"]) ? $_GET[\"id\"] : 0;\n\t\t$u=new Gestionnaire($id);\n\t\textract($u->data);\t\n\t\trequire $this->gabarit;\n\t}", "public function edit($id)\n {\n $recipe = $this->kitchenRecipeRepository->getRecipe($id);\n $quantity = $this->kitchenIngredientKitchenRecipeRepository->getQuantitiesForIngredients($id);\n $ingredientList = $this->kitchenIngredientRepository->getForComboBox();\n\n\n if (empty($recipe)) {\n abort(404);//если не нашли модель то 404\n }\n\n return view('kitchen.admin.recipes.edit',\n compact('recipe', 'quantity', 'ingredientList'));\n }", "public function edit() {\n $id = $this->parent->urlPathParts[2];\n // pass name and id to view\n $data = $this->parent->getModel(\"fruits\")->select(\"select * from fruit_table where id = :id\", array(\":id\"=>$id));\n $this->getView(\"header\", array(\"pagename\"=>\"about\"));\n $this->getView(\"editForm\", $data);\n $this->getView(\"footer\");\n }", "function rich_edit_exists()\n {\n }", "public function edit(Slide $slide)\n {\n //\n }", "public function edit(Renter $renter)\n {\n //\n }", "public function inline_edit()\n {\n }", "public function inline_edit()\n {\n }", "public function annimalEditAction()\n {\n }", "public function edit($id) {\n\n\t\t\t$ingredient = Ingredient::where('id',$id)->get();\n\t\t\treturn view('ingredients.modifier-ingredient', ['ingredientAModifier'=>$ingredient[0]]);\n\t}" ]
[ "0.6970233", "0.6970233", "0.6643041", "0.6536717", "0.64021796", "0.6371241", "0.6338073", "0.6322995", "0.6322578", "0.6165409", "0.61635774", "0.615205", "0.6150776", "0.6088792", "0.60722536", "0.60505176", "0.6042972", "0.6042972", "0.6042972", "0.60288274", "0.60217035", "0.6001303", "0.6001303", "0.6001303", "0.59659094", "0.59548587", "0.59218323", "0.58925176", "0.5892314", "0.5892314", "0.58905166", "0.5848184", "0.5844512", "0.5835232", "0.5835232", "0.5835232", "0.5835232", "0.582269", "0.582269", "0.5795702", "0.5795702", "0.5795702", "0.5795702", "0.5795702", "0.5795702", "0.5795702", "0.5795702", "0.5795702", "0.5795702", "0.5795702", "0.5795702", "0.57756317", "0.57408243", "0.57271516", "0.57263255", "0.5712057", "0.5711666", "0.5708989", "0.5707658", "0.5707626", "0.570297", "0.5697605", "0.5689331", "0.5685758", "0.567707", "0.56715626", "0.5664293", "0.5661201", "0.5655907", "0.56551427", "0.56518906", "0.5644602", "0.56381935", "0.563333", "0.5598689", "0.5594397", "0.55895114", "0.558448", "0.558281", "0.55804247", "0.5579353", "0.5573732", "0.5563556", "0.5561641", "0.55511135", "0.555007", "0.555007", "0.555007", "0.555007", "0.555007", "0.55385274", "0.5533671", "0.5522454", "0.55190027", "0.5518297", "0.55135506", "0.550828", "0.5503002", "0.5501972", "0.54933804", "0.549082" ]
0.0
-1
Constructs a Comment from a (parsed) JSON hash
public function __construct($o = null) { if (is_array($o)) { $this->initFromArray($o); } else if ($o instanceof \XMLReader) { $success = true; while ($success && $o->nodeType != \XMLReader::ELEMENT) { $success = $o->read(); } if ($o->nodeType != \XMLReader::ELEMENT) { throw new \Exception("Unable to read XML: no start element found."); } $this->initFromReader($o); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function decode($inputJSON)\n {\n $inputArray = json_decode($inputJSON, true);\n\n if (!isset($inputArray['commentMessage'])) {\n throw new \\InvalidArgumentException(\"The variable commentMessage is missing!\");\n }\n\n\n if (isset($inputArray['ipAddress'])) {\n $comment = CommentFactory::createWithIp($inputArray['commentMessage'], $inputArray['ipAddress']);\n } else {\n $comment = CommentFactory::createMinimal($inputArray['commentMessage']);\n }\n\n return $comment;\n }", "private function getNewComment(int $userId, int $articleId, array $data): Comment\r\n {\r\n $comment = new Comment();\r\n\r\n return $comment\r\n ->setContent($data['content'])\r\n ->setIsEdited(0)\r\n ->setUserId($userId)\r\n ->setLikes(0)\r\n ->setDislikes(0)\r\n ->setArticleId($articleId)\r\n ->setLikes(0)\r\n ->setDislikes(0)\r\n ->setCreatedAt(new \\DateTime());\r\n }", "public function __construct(Comment $comment)\n {\n $this->comment = $comment;\n }", "public function __construct(Comment $comment)\n {\n $this->comment = $comment;\n }", "public function __construct(Comment $comment)\n {\n $this->comment = $comment;\n }", "public function __construct(Comment $comment, $data)\n {\n //\n $this->comment = $comment;\n $this->data = $data;\n }", "static public function getComment($id) {\r\n //return decoded cached object if the comment are cached\r\n if(Cache::has(SELF::CACHE_INDENTIFIER.$id)) {\r\n $comment = json_decode(Cache::get(SELF::CACHE_INDENTIFIER.$id));\r\n //else retrieve comment from database and cache comment in json format\r\n } else{\r\n $comment = SELF::find($id);\r\n Cache::put(SELF::CACHE_INDENTIFIER.$id, json_encode($comment), SELF::CACHE_DURATION_MINUTES);\r\n }\r\n return $comment;\r\n }", "function get_json_response ($hashover)\n{\n\t// Initial JSON data\n\t$data = array ();\n\n\t// Get comment from POST/GET data\n\t$key = $hashover->setup->getRequest ('comment', null);\n\n\t// Return error if we're missing necessary post data\n\tif ($key === null) {\n\t\treturn array ('error' => 'Missing comment file.');\n\t}\n\n\t// Sanitize file path\n\t$file = str_replace ('../', '', $key);\n\n\t// Store references to some long variables\n\t$thread = $hashover->setup->threadName;\n\n\t// Read comment\n\t$comment = $hashover->thread->data->read ($file, $thread);\n\n\t// Return error message if failed to read comment\n\tif ($comment === false) {\n\t\treturn array ('error' => 'Failed to read file: \"' . $file . '\"');\n\t}\n\n\t// User is not authorized by default\n\t$authorized = false;\n\n\t// Check if user is logged in\n\tif ($hashover->login->userIsLoggedIn === true) {\n\t\t// If so, user is authorized if they own the comment\n\t\tif (!empty ($comment['login_id'])) {\n\t\t\tif ($hashover->login->loginHash === $comment['login_id']) {\n\t\t\t\t$authorized = true;\n\t\t\t}\n\t\t}\n\n\t\t// Or, user is authorized if they are Admin\n\t\tif ($hashover->login->isAdmin () === true) {\n\t\t\t$authorized = true;\n\t\t}\n\t}\n\n\t// Check if user is authorized to receive comment data\n\tif ($authorized === true) {\n\t\t// If so, instantiate Crypto class\n\t\t$crypto = new Crypto ();\n\n\t\t// Specific comment data to return\n\t\t$data = array (\n\t\t\t// Commenter name\n\t\t\t'name' => Misc::getArrayItem ($comment, 'name') ?: '',\n\n\t\t\t// Commenter website URL\n\t\t\t'website' => Misc::getArrayItem ($comment, 'website') ?: '',\n\n\t\t\t// Commenter's comment\n\t\t\t'body' => Misc::getArrayItem ($comment, 'body') ?: ''\n\t\t);\n\n\t\t// Add decrypted email address to data if an email exists\n\t\tif (!empty ($comment['email']) and !empty ($comment['encryption'])) {\n\t\t\t$data ['email'] = $crypto->decrypt ($comment['email'], $comment['encryption']);\n\t\t}\n\n\t\t// And return comment data\n\t\treturn $data;\n\t}\n\n\t// Otherwise, wait 5 seconds\n\tsleep (5);\n\n\t// And return authentication error\n\treturn array (\n\t\t'error' => $hashover->locale->text['post-fail']\n\t);\n}", "public function new_comment ($parent_id)\n {\n $Result = $this->_make_comment ();\n $Result->parent_id = $parent_id;\n return $Result;\n }", "public function __construct($comment)\n {\n $this->comment = $comment;\n }", "function __construct( $comment ) {\n\n\t\t$this->id = $comment->comment_ID;\n\t\t$this->comment = $comment;\n\n\t\t$this->report_type = get_comment_meta( $this->id, APP_REPORTS_C_RECIPIENT_TYPE_KEY, true );\n\t\t$this->recipient_id = get_comment_meta( $this->id, APP_REPORTS_C_RECIPIENT_KEY, true );\n\n\t\t$meta = get_comment_meta( $this->id, APP_REPORTS_C_DATA_KEY, true );\n\t\t$this->meta = wp_parse_args( $meta, $this->meta );\n\t}", "protected function getCommentAttributesFromEntity($entity)\n {\n $decryptEntity = Yii::$app->getSecurity()->decryptByKey(utf8_decode($entity),'comment');\n if ($decryptEntity !== false) {\n return Json::decode($decryptEntity);\n }\n\n throw new BadRequestHttpException(Yii::t('admin/comment', 'Ошибка! Попробуйте пожалуйста еще раз!'));\n }", "public static function obtainFromJSON($json) {\n $msgJSONDecode = json_decode( stripslashes($json) );\n \n $issue = $msgJSONDecode->issue;\n $message = $msgJSONDecode->message;\n $email = $msgJSONDecode->email;\n \n return new Message($issue, $message, $email); \n }", "public function idComment($idComment)\n\t{\n\t\t$datas= array('id'=>$idComment);\n\t\t$comment= new Comments($datas);\n\t\treturn $comment;\n\t}", "public function initialData()\n {\n self::$data = '\n {\n \"1\": {\n \"id\": 1,\n \"user_id\": 2,\n \"post_id\": 1,\n \"text\": \"My first comment\",\n \"created_at\": {\n \"date\": \"2018-11-15 11:00:40.000000\",\n \"timezone_type\": 3,\n \"timezone\": \"UTC\"\n },\n \"updated_at\": {\n \"date\": \"2018-11-15 11:00:40.000000\",\n \"timezone_type\": 3,\n \"timezone\": \"UTC\"\n }\n },\n \"2\": {\n \"id\": 2,\n \"user_id\": 2,\n \"post_id\": 1,\n \"text\": \"My first comment\",\n \"created_at\": {\n \"date\": \"2018-11-15 11:00:40.000000\",\n \"timezone_type\": 3,\n \"timezone\": \"UTC\"\n },\n \"updated_at\": {\n \"date\": \"2018-11-15 11:00:40.000000\",\n \"timezone_type\": 3,\n \"timezone\": \"UTC\"\n }\n },\n \"3\": {\n \"id\": 3,\n \"user_id\": 1,\n \"post_id\": 2,\n \"text\": \"My first comment\",\n \"created_at\": {\n \"date\": \"2018-11-15 11:00:40.000000\",\n \"timezone_type\": 3,\n \"timezone\": \"UTC\"\n },\n \"updated_at\": {\n \"date\": \"2018-11-15 11:00:40.000000\",\n \"timezone_type\": 3,\n \"timezone\": \"UTC\"\n }\n }\n } \n ';\n\n // Replacing work file via test file\n FileComment::$storagePath = 'testComments.json';\n\n // Saving a new data into test comments file\n Storage::disk('comments')->put(FileComment::$storagePath, self::$data);\n \n return new FileComment;\n }", "public function createComment(): CommentableInterface;", "public function __construct($comment)\n {\n }", "public function addComment($issueIdOrKey, $comment): Comment\n {\n $this->log->info(\"addComment=\\n\");\n\n if (!($comment instanceof Comment) || empty($comment->body)) {\n throw new JiraException('comment param must be instance of Comment and have body text.');\n }\n\n $data = json_encode($comment);\n\n $ret = $this->exec($this->uri.\"/$issueIdOrKey/comment\", $data);\n\n $this->log->debug('add comment result='.var_export($ret, true));\n $comment = $this->json_mapper->map(\n json_decode($ret),\n new Comment()\n );\n\n return $comment;\n }", "public function getComment($issueIdOrKey, $id, array $paramArray = []): Comment\n {\n $this->log->info(\"getComment=\\n\");\n\n $ret = $this->exec($this->uri.\"/$issueIdOrKey/comment/$id\".$this->toHttpQueryParameter($paramArray));\n\n $this->log->debug('get comment result='.var_export($ret, true));\n $comment = $this->json_mapper->map(\n json_decode($ret),\n new Comment()\n );\n\n return $comment;\n }", "public function updateComment($issueIdOrKey, $id, $comment): Comment\n {\n $this->log->info(\"updateComment=\\n\");\n\n if (!($comment instanceof Comment) || empty($comment->body)) {\n throw new JiraException('comment param must instance of Comment and have to body text.!');\n }\n\n $data = json_encode($comment);\n\n $ret = $this->exec($this->uri.\"/$issueIdOrKey/comment/$id\", $data, 'PUT');\n\n $this->log->debug('update comment result='.var_export($ret, true));\n $comment = $this->json_mapper->map(\n json_decode($ret),\n new Comment()\n );\n\n return $comment;\n }", "public static function encode(Comment $comment)\n {\n $inputArray = array('commentMessage' => $comment->getMessage(),\n 'ipAddress' => $comment->getIpAddress());\n $jsonOutput = json_encode($inputArray);\n return $jsonOutput;\n }", "public static function make($photo_id, $author=\"Anonymous\", $body=\"\") {\n\t\tif (!empty($photo_id) && !empty($author) && !empty($body)) {\n\t\t\t$comment = new Comment();\n\t\t\t$comment->photograph_id = (int)$photo_id;\n\t\t\t$comment->created = strftime(\"%Y-%m-%d %H:%M:%S\", time());\n\t\t\t$comment->author = $author;\n\t\t\t$comment->body = $body;\t\t\n\t\t\treturn $comment;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public function CreateComments($Payload){\n\t\t\tif(empty($Payload['id'])){\n\t\t\t\tthrow new Exception('id can not be empty.');\n\t\t\t}\n\t\t\tif(empty($Payload['Body'])){\n\t\t\t\tthrow new Exception('body can not be empty.');\n\t\t\t}\n\t\t\t$Payload['Verb']='POST';\n\t\t\t$Payload['URL']='/V1/creditmemo/'.$Payload['id'].'/comments';\n\t\t\t$Payload['Body']=json_encode($Payload['Body']);\n\t\t\treturn $this->Execute($Payload);\n\t\t}", "public function fromJson(string $json){\n $this->content = json_decode($json);\n if(array_key_exists($this->idField, $this->content)){//verifica se possui id se sim seta o id; mesmo comportamento de formArray;\n $this->{$this->idField} = $this->content[$this->idField];\n }\n }", "protected function buildUniqueComment(array $row)\n {\n $comment = new Comment();\n $comment->setId($row['com_id']);\n $comment->setContent($row['com_content']);\n $comment->setAuthor($row['com_author']);\n $comment->setMail($row['com_mail']);\n $comment->setParent($row['parent_id']);\n $comment->setState($row['t_state']);\n return $comment;\n }", "public function testCreateComment(){\n $parameters = [\n 'commenting_username' => 'ridho',\n 'id_post' => 1,\n 'komentar' => 'keren, lanjutkan!'\n ];\n\n $this->post(\"/api/v1/komentar\", $parameters, []);\n $this->seeStatusCode(200);\n $this->seeJsonStructure(\n ['data' =>\n [\n 'status',\n 'id_komen',\n 'commenting_username',\n 'id_post',\n 'komentar',\n 'tanggal'\n ]\n ]\n );\n }", "public function create_comment_object($photo_id,$author=\"Anonymous\",$body=\"\"){\n\n if(!empty($photo_id) && !empty($author) && !empty($body)){\n global $database;\n $comment= new Comment();\n $comment->photo_id=(int)$photo_id;\n $comment->author=$author;\n $comment->body=\"$body\";\n $properties=$comment->getCleanAssArrOfObjPro();\n\n $sql=\"INSERT INTO \".static::$db_table.\"(\".implode(\",\",array_keys($properties)).\")\";\n $sql.=\"VALUES ('\".implode(\"','\",array_values($properties)).\"')\";\n if($database->query($sql)){\n $comment->id= $database->insertId();\n\n return true;\n\n }else{\n\n return false;\n }\n } else{\n\n return false;\n }\n\n }", "public function create()\n {\n $this->validation[\"body\"][\"format\"][] = $this->body;\n if (!$this->validate()) {\n throw new ValidationException(\"invalid comment\");\n }\n $db = DB::conn();\n $set_params = array(\n \"thread_id\" => $this->thread_id, \n \"username\" => $this->username, \n \"body\" => $this->body\n );\n $db->insert(self::COMMENT_TABLE, $set_params);\n }", "public function __construct(CommentInterface $entry)\n {\n $this->entry = $entry;\n }", "function CreateComment( $obj )\n\t{\n\t\treturn $this->pDBInterface->Query( $this->pDBInterface->CreateInsertQuery($this->sCommentTb, $obj ) );\n\t}", "public function __construct($commentId)\n\t{\n\t\t$this->commentId = $commentId;\n\t}", "public function __construct(PostComment $comment)\n {\n $this->comment = $comment;\n }", "public function __construct($json) {\n if (is_null($json)) {\n $json = new \\stdClass();\n }\n\n $this->json = $json;\n }", "function commentAdd($pid, $post = array('comment' => ''), $query = array(), $rawJson = false) {\n \t\t/**\n \t\t * We currently have to do the following to bypass a php to\n \t\t * rails conflict with the meaning of [] in form field names.\n \t\t * With the following, we only need to name our field \"comment\",\n \t\t * but \"comment[comment]\" is also supported\n \t\t */\n \t if ( isset($post['comment']) ) {\n \t $tmp = $post['comment'];\n \t\t unset($post['comment']);\n \t\t if ( is_array($post['comment']) ) {\n \t\t foreach ($tmp as $key => $value)\n \t\t $post[\"comment[$key]\"] = $value;\n \t\t} else {\n \t\t $post['comment[comment]'] = $tmp;\n \t\t}\n \t\t}\n \t\t\n \t\t$post['comment[comment]'] = stripslashes($post['comment[comment]']);\n \t\t\n \t\tif ( $json = $this->_post('/merchants/'.$pid.'/comments.json', $post, 'post', $query, true) )\n \t\t return $this->_parseApi($json, $rawJson);\n \t\telse\n \t\t\treturn false;\n \t}", "function comments($pid, $query = array(), $rawJson = false) {\n \t\tif ( $json = $this->_get('/merchants/'.$pid.'/comments.json', $query) )\n \t\t\treturn $this->_parseApi($json, $rawJson);\n \t\telse\n \t\t\treturn false;\n \t}", "public function createMessageComment($projectId, $messageId, array $params)\n {\n $data = $this->post('/projects/' . $projectId . '/messages/' . $messageId . '/comments.json', $params);\n\n return $data;\n }", "public function __construct($json) {\n $this->json = $json;\n }", "public function setComment($var)\n {\n GPBUtil::checkString($var, True);\n $this->comment = $var;\n\n return $this;\n }", "public function comment (\\stdClass $param);", "public function __construct(Comment $comment, Classified $deal)\n {\n $this->comment = $comment;\n $this->deal = $deal;\n }", "function create_json($hcard) {\n $hcard[\"url\"] = hCardCommenting::get_url($hcard[\"url\"]);\n // if there is more than one email address, take the first\n $hcard[\"email\"] = is_array($hcard[\"email\"]) ? $hcard[\"email\"][0] : $hcard[\"email\"];\n\n if ($hcard) {\n $jcard = '{\"vcard\": {';\n $jcard .= '\"fn\": \"'.$hcard[\"fn\"].'\", ';\n $jcard .= '\"email\": \"'.$hcard[\"email\"].'\", ';\n $jcard .= '\"url\": \"'.$hcard[\"url\"].'\"}}';\n } else {\n $jcard = null;\n }\n return $jcard;\n }", "public function createNew(array $data)\n {\n if (!is_null($data)) {\n $comment = new Comment();\n $comment->content = $data['content'];\n $comment->username = $data['username'];\n $comment->a_id = $data['a_id'];\n return $comment;\n } else {\n throw new Exception('Need data.');\n }\n }", "public function getComment($idComment)\n\t{\t\n\t\t$req=$this->_bdd->query('SELECT id, content_com AS content, DATE_FORMAT(date_com, \"%d/%m/%Y %Hh%imin%ss\") AS date, id_users AS idUser, id_post AS idPost, moderate FROM Comments WHERE id='.$idComment);\n\t\t//die(var_dump($idComment));\n\t\twhile($datas=$req->fetch(PDO::FETCH_ASSOC))\n\t\t{\n\t\t\t$comment=new Comments($datas);\n\t\t}\n\t\treturn $comment;\n\t}", "public static function minify($json) {\n\t\t$tokenizer = \"/\\\"|(\\/\\*)|(\\*\\/)|(\\/\\/)|\\n|\\r/\";\n\t\t$in_string = false;\n\t\t$in_multiline_comment = false;\n\t\t$in_singleline_comment = false;\n\t\t$tmp = null;\n\t\t$tmp2 = null;\n\t\t$new_str = array();\n\t\t$from = 0;\n\t\t$lc = null;\n\t\t$rc = null;\n\t\t$lastIndex = 0;\n\n\t\twhile (preg_match($tokenizer, $json, $tmp, PREG_OFFSET_CAPTURE, $lastIndex)) {\n\t\t\t$tmp = $tmp[0];\n\t\t\t$lastIndex = $tmp[1] + strlen($tmp[0]);\n\t\t\t$lc = substr($json, 0, $lastIndex - strlen($tmp[0]));\n\t\t\t$rc = substr($json, $lastIndex);\n\t\t\t\n\t\t\tif (!$in_multiline_comment && !$in_singleline_comment) {\n\t\t\t\t$tmp2 = substr($lc, $from);\n\t\t\t\tif (!$in_string)\n\t\t\t\t\t$tmp2 = preg_replace(\"/(\\n|\\r|\\s)*/\", null, $tmp2);\n\t\t\t\t\n\t\t\t\t$new_str[] = $tmp2;\n\t\t\t}\n\t\t\t\n\t\t\t$from = $lastIndex;\n\n\t\t\tif ($tmp[0] == '\"' && !$in_multiline_comment && !$in_singleline_comment) {\n\t\t\t\tpreg_match(\"/(\\\\\\\\)*$/\", $lc, $tmp2);\n\t\t\t\t\n\t\t\t\tif (!$in_string || !$tmp2 || (strlen($tmp2[0]) % 2) == 0) // start of string with \", or unescaped \" character found to end string\n\t\t\t\t\t$in_string = !$in_string;\n\t\t\t\t\n\t\t\t\t$from--; // include \" character in next catch\n\t\t\t\t$rc = substr($json, $from);\n\t\t\t} elseif ($tmp[0] == \"/*\" && !$in_string && !$in_multiline_comment && !$in_singleline_comment) {\n\t\t\t\t$in_multiline_comment = true;\n\t\t\t} elseif ($tmp[0] == \"*/\" && !$in_string && $in_multiline_comment && !$in_singleline_comment) {\n\t\t\t\t$in_multiline_comment = false;\n\t\t\t} elseif ($tmp[0] == \"//\" && !$in_string && !$in_multiline_comment && !$in_singleline_comment) {\n\t\t\t\t$in_singleline_comment = true;\n\t\t\t} elseif (($tmp[0] == \"\\n\" || $tmp[0] == \"\\r\") && !$in_string && !$in_multiline_comment && $in_singleline_comment) {\n\t\t\t\t$in_singleline_comment = false;\n\t\t\t} elseif (!$in_multiline_comment && !$in_singleline_comment && !(preg_match(\"/\\n|\\r|\\s/\", $tmp[0]))) {\n\t\t\t\t$new_str[] = $tmp[0];\n\t\t\t}\n\t\t}\n\t\t$new_str[] = $rc;\n\t\treturn implode(null, $new_str);\n\t}", "public static function createFromJson($json);", "public function __construct(Comment $comment, User $user)\n {\n $this->comment = $comment;\n $this->user = $user;\n }", "protected function buildDomainObject(array $row)\n {\n $comment = new Comment();\n $comment->setId($row['id']);\n $comment->setContent($row['content']);\n $comment->setCreatedAt($row['created_at']);\n\n if (array_key_exists('episode_id', $row))\n {\n // Find and set the associated episode\n $episodeId = $row['episode_id'];\n $episode = $this->episodeDAO->find($episodeId);\n $comment->setEpisode($episode);\n }\n if (array_key_exists('user_id', $row))\n {\n // Find and set the associated author\n $userId = $row['user_id'];\n $user = $this->userDAO->find($userId);\n $comment->setAuthor($user);\n }\n\n return $comment;\n }", "protected function buildDomainObject($row) {\n // Find the associated article\n $reservationId = $row['NUM_RESA'];\n $reservation = $this->reservationDAO->find($reservationId);\n\n $comment = new Comment();\n $comment->setId($row['COM_ID']);\n $comment->setUserId($row['USER_ID']);\n $comment->setContent($row['COM_CONTENT']);\n $comment->setReservation($row['NUM_RESA']);\n return $comment;\n }", "protected function buildDomainObject(array $row) {\n $comment = new Comment();\n $comment->setCommentId($row['com_id']);\n $comment->setContent($row['com_content']);\n $comment->setParentId($row['parent_id']);\n $comment->setReporting($row['com_reporting']);\n $comment->setDepth($row['com_depth']);\n\n if (array_key_exists('billet_id', $row)) {\n // Find and set the associated billet\n $billetId = $row['billet_id'];\n $billet = $this->billetDAO->find($billetId);\n $comment->setBillet($billet);\n }\n\n if (array_key_exists('usr_id', $row)) {\n // Find and set the associated author\n $userId = $row['usr_id'];\n $user = $this->userDAO->find($userId);\n $comment->setAuthor($user);\n }\n\n return $comment;\n }", "public function __construct($user_id, $comment_id, $comment)\n {\n $this->userId = $user_id;\n $this->comment = $comment;\n $this->commentId = $comment_id;\n }", "function insertComment() {\n if ($this->getRequestMethod() != \"POST\") {\n $this->response('', 406);\n }\n $comment = json_decode(file_get_contents(\"php://input\"),true);\n $auth = $this->getAuthorization();\n if (!$this->validateAuthorization($comment['user_id'], $auth)) {\n $this->response('', 406);\n }\n \n $columns = 'user_id, video_id, text';\n $values = $comment['user_id'] . ',' . $comment['video_id'] . ',\\'' . $comment['text'] . \"'\";\n \n $query = \"insert into comments(\". $columns . \") VALUES(\". $values . \");\";\n $r = $this->conn->query($query) or die($this->conn->error.__LINE__);\n $success = array('status' => \"Success\", \"msg\" => \"Comment Posted.\", \"data\" => $comment);\n $this->response(json_encode($success),200);\n }", "public function build($json)\n\t{\n\t\treturn $this->buildNode(json_decode($json));\n\t}", "public function testParsingComment()\n {\n $tokens = [\n new Token(TokenTypes::T_COMMENT_OPEN, '{#', 1),\n new Token(TokenTypes::T_EXPRESSION, 'foo', 1),\n new Token(TokenTypes::T_COMMENT_CLOSE, '#}', 1),\n ];\n $commentNode = new CommentNode();\n $commentNode->addChild(new ExpressionNode('foo'));\n $this->ast->getCurrentNode()\n ->addChild($commentNode);\n $this->assertEquals($this->ast, $this->parser->parse($tokens));\n }", "public function getRawComment()\n\t{\n\t\tFoundry::checkToken();\n\n\t\t// Only registered users are allowed here.\n\t\tFoundry::requireLogin();\n\n\t\t// Get the view\n\t\t$view = Foundry::view( 'comments', false );\n\n\t\t// Check for permission first\n\t\t$access = Foundry::access();\n\n\t\tif( !$access->allowed( 'comments.read' ) )\n\t\t{\n\t\t\t$view->setMessage( JText::_( 'COM_EASYSOCIAL_COMMENTS_NOT_ALLOWED_TO_READ' ) , SOCIAL_MSG_ERROR );\n\t\t\treturn $view->call( __FUNCTION__ );\n\t\t}\n\n\t\t$id = JRequest::getInt( 'id', 0 );\n\n\t\t$table = Foundry::table( 'comments' );\n\n\t\t$state = $table->load( $id );\n\n\t\tif( !$state )\n\t\t{\n\t\t\t$view->setMessage( $table->getError(), SOCIAL_MSG_ERROR );\n\t\t\treturn $view->call( __FUNCTION__ );\n\t\t}\n\n\t\t$comment = $table->comment;\n\n\t\t$stringLib = Foundry::get( 'string' );\n\n\t\t$comment = $stringLib->escape( $comment );\n\n\n\t\t$view->call( __FUNCTION__, $comment );\n\t}", "static function fromJson($json) {\n $obj = json_decode($json); // of stdClass\n $strategy = $obj->{'strategy'};\n $board = $obj->{'board'};\n $game = new Game();\n $game->board = Board::fromJson($board);\n $name = $strategy->{'name'};\n $game->strategy = $name::fromJson($strategy);\n $game->strategy->board = $game->board;\n return $game;\n }", "public function datasComment($author, $content, $idPost, $idUser)\n\t{\n\t\t$datas=array('author'=>$author, 'content'=>$content, 'idPost'=>$idPost, 'idUser'=>$idUser);\n\t\t$comment= new Comments($datas);\n\t\treturn $comment;\n\t}", "protected function _prepare_comment($comment)\n {\n }", "function __construct($json)\n {\n // Remove problematic characters for JSON parsing\r\n $json = str_replace(array(\"\\\\'\", '\\\\\"'), array(\"'\", \"''\"), $json);\r\n $this->jsonList = json_decode($json);\r\n pm_logDebug(3, $this->jsonList);\n }", "public function createComment(array $comment)\n {\n $comment[\"porcelain\"] = null; // wp-Cli returns only id\n return intval($this->runWpCliCommand(\"comment\", \"create\", $comment));\n }", "public static function buildFromJSON($json)\r\n\t{\r\n\t\t$json = json_decode($json);\r\n\t\t\r\n\t\t$builder = new PersonObjectBuilder();\r\n\t\t$builder->objectID($json->objectID)\r\n\t\t\t\t->globalID($json->globalID)\r\n\t\t\t\t->displayName($json->displayName);\r\n\t\t\t\t\r\n\t\tif(property_exists($json, 'profilePicture'))\r\n\t\t\t$builder->profilePicture($json->profilePicture);\r\n\t\t\t\r\n\t\tif(property_exists($json, 'profilePictureThumbnail'))\r\n\t\t\t$builder->profilePictureThumbnail($json->profilePictureThumbnail);\r\n\t\t\r\n\t\tif(property_exists($json, 'language'))\r\n\t\t\t$builder->language($json->language);\r\n\t\t\r\n\t\treturn $builder->build();\r\n\t}", "public function setComment($comment)\n {\n $this->values['Comment'] = $comment;\n return $this;\n }", "public function __construct($json)\n\t{\n\t\t$this->json = $json;\n\t\t$values = json_decode($json, true);\n\n\t\t$this->count = count($values);\n\n\t\tforeach ($values as $key => $value)\n\t\t{\n\t\t\t$this->$key = $value;\n\t\t}\n\t}", "static function fromJson($json){\n $obj = json_decode($json);\n $width = $obj['width'];\n $height = $obj['height'];\n $places = $obj;\n }", "static function from_json($data)\r\n {\r\n $decoded = json_decode($data, true);\r\n $decoded[\"admission_date\"] .= \" \" . $decoded[\"admission_time\"];\r\n $person = new Person();\r\n $person->from_array($decoded);\r\n if ((isset($decoded[\"id\"])) && (!empty($decoded[\"id\"]))){\r\n $person->id = $decoded[\"id\"];\r\n }\r\n return $person;\r\n }", "public static function from_json($json)\n\t\t{\n\t\t\t$model = get_called_class();\n\t\t\treturn new $model(\\System\\Json::decode($json));\n\t\t}", "protected static function createComment(Request $request){\n \t$videoId = InputSanitise::inputInt($request->get('video_id'));\n \t$userComment = $request->get('comment');\n \t$comment = new static;\n \t$comment->body = $userComment;\n \t$comment->course_video_id = $videoId;\n \t$comment->user_id = Auth::user()->id;\n \t$comment->save();\n \treturn $comment;\n }", "public function __construct(Report $report, Comment $comment)\n {\n $this->report = $report;\n $this->goal = $report->goal;\n $this->objective = $report->goal->objective;\n $this->comment = $comment;\n }", "function tweet_comment_preprocess_comment( $data ) {\n\treturn $data;\n}", "public function __construct() {\n parent::__construct();\n $this->_params = array(\n 'id' => '2',\n 'user_id' => '',\n 'rating_id' => '1',\n 'content' => 'this is comment 2',\n );\n $this->_method = 'POST';\n $this->_uri = 'api/comment/1';\n $this->_models = array('Comment', 'User', 'Login');\n }", "public static function fromJson(string $json_data): CacheItem\n {\n $json_data = json_decode($json_data, true);\n return new self(\n $json_data['filename'],\n $json_data['render_time'],\n $json_data['expiry_date'],\n $json_data['popularity'],\n $json_data['tags']\n );\n }", "private function setCommentData($reviewID,$username,$comment){\r\n\t\t\t$stmt = $this->myDatabase->prepare(\"INSERT INTO comments (reviewID,username,comment) \"\r\n\t\t\t. \"VALUES (?,?,?)\");\r\n\t\t\t$stmt->bind_Param('sss', $reviewID,$username,$comment);\r\n\t\t\t$stmt->execute();\r\n\t\t\t$commentIDObj = new stdClass();\r\n\t\t\t$commentIDObj->commentID = $stmt->insert_commentID;\r\n\t\t\t$this->statuscode = 201;\r\n\t\t\thttp_response_code(201);\r\n\t\t\techo json_encode($commentIDObj);\r\n\t\t}", "function &setComment(Comment $comment) {\n $this->setadditionalProperty('comment_type', get_class($comment));\n $this->setadditionalProperty('comment_id', $comment->getId());\n\n return $this;\n }", "public function comment($data)\n {\n return $this->comment->storeComment($data);\n }", "function Comment($content) {\n\n /* Variablen initialisieren */\n $this->content = $content;\n }", "public function create_comment($params = null, $options = null)\n {\n $url = $this->instanceUrl() . '/comments';\n list($response, $opts) = $this->_request('post', $url, $params, $options);\n $this->refreshFrom($response, $opts);\n return $this;\n }", "public function __construct($comment, $subscription)\n {\n $this->comment = $comment;\n $this->subscription = $subscription;\n }", "private function _createCommentField()\n {\n $comment = new Zend_Form_Element_Textarea('comment');\n $comment->setLabel('bankComment')\n ->addFilter(new Zend_Filter_StringTrim())\n ->addFilter(new Zend_Filter_StripTags())\n ->addValidator(new Zend_Validate_StringLength(array('min' => 5)))\n ->setAttribs(array('cols' => '60', 'rows' => '5'));\n\n return $comment;\n }", "protected function parseComment()\n {\n if (!$this->peekChar('/')) {\n return;\n }\n\n if ($this->peekChar('/', 1)) {\n return new ILess_Node_Comment($this->matchReg('/\\G\\/\\/.*/'), true, $this->position, $this->env->currentFileInfo);\n } //elseif($comment = $this->matchReg('/\\G\\/\\*(?:[^*]|\\*+[^\\/*])*\\*+\\/\\n?/'))\n elseif ($comment = $this->matchReg('/\\\\G\\/\\*(?s).*?\\*+\\/\\n?/')) {\n return new ILess_Node_Comment($comment, false, $this->position, $this->env->currentFileInfo);\n }\n }", "public function normaliseComment(string $comment): string;", "public function comment($comment)\n {\n return $this->setProperty('comment', $comment);\n }", "private function createCommentAttributes()\n {\n return [\n 'body' => 'Very interesting post!',\n 'post_id' => $this->post->id,\n 'user_id' => $this->user->id,\n ];\n }", "public function updateComment() {\n parse_str(file_get_contents('php://input'), $_PUT);\n\n if (isset($_PUT['btnUpdateComment'])) {\n $comment = $_PUT['comment'];\n $idComm = $_PUT['idComm'];\n\n $regComment = \"/[0-9A-Za-z.,\\n \\r?!]*/\";\n\n $errors = [];\n if($comment == \"\") {\n $errors[] = \"Cant be empty comment\";\n exit;\n }\n else if(!preg_match($regComment, $comment)) {\n $errors[] = \"Wrong format comment\";\n exit;\n }\n try {\n $modelComment = new Comments(Database::instance());\n $modelComment->updateComment($comment, $idComm);\n\n $this->commentLog(\"$comment\", \"UPDATE\", 204);\n\n\n } catch (\\PDOException $ex) {\n $this->errorLog(\"updateComment()\", $ex->getMessage());\n\n }\n } else {\n $this->json(null, 403);\n }\n }", "public function getComment(){\n $query = \"SELECT * FROM \" . $this->table_name . \" WHERE id = ?\";\n // prepare query statement\n $stmt = $this->connection->prepare($query);\n $stmt->bindParam(1, $this->id);\n $stmt->execute();\n\n // get retrieved row\n $row = $stmt->fetch(PDO::FETCH_ASSOC);\n\n // set values to object properties\n $this->id = $row['id'];\n $this->username = $row['username'];\n $this->message = $row['message'];\n\n }", "public function create($comment)\n {\n\n }", "public function chapterComment($comment)\n {\n $db = $this->dbConnect();\n $comments = $db->prepare('INSERT INTO comments(chapter_id, author, comment, comment_date) VALUES(:chapter_id, :author, :comment, NOW())');\n $comments->bindValue(':chapter_id', $comment->getChapter_id(), \\PDO::PARAM_INT);\n $comments->bindValue(':author', $comment->getAuthor(), \\PDO::PARAM_STR);\n $comments->bindValue('comment', $comment->getComment(), \\PDO::PARAM_STR);\n $comments->execute();\n\n return $comments;\n }", "public function __construct( $json = null )\n {\n if( $json )\n {\n $this->decodeJSONableArray($json);\n }\n else\n {\n $this->setTimestamp();\n //$this->setID();\n }\n }", "public function setComment($comment) {\n $this->properties['comment'] = $comment;\n\n return $this;\n }", "public function setComment($comment) {\n $this->properties['comment'] = $comment;\n\n return $this;\n }", "function Comment($commentText, $IPNumber, $name, $UID=\"\") {\n\n\t\t$this->commentText = substr(wordwrap($commentText, 100, \" \", 1), 0, 1000);\n\t\t$this->datePosted = time();\n\t\t$this->IPNumber = $IPNumber;\n\t\t$this->name = substr($name, 0, 100);\n\t\t$this->UID = $UID;\n\t}", "public static function getCommentById($id)\n {\n $id = intval($id);\n\n if ($id) {\n $commentItem = [];\n $db = Db::getConnection();\n $result = $db->query('SELECT * FROM comments WHERE id_to_what_post =' . $id);\n\n $i = 0;\n while($row = $result->fetch()) {\n //$commentItem[$i]['id_to_what_post'] = $row['id_to_what_post'];\n $commentItem[$i]['date'] = $row['date'];\n $commentItem[$i]['text'] = $row['text'];\n $commentItem[$i]['author'] = $row['author'];\n $i++;\n }\n\n return $commentItem;\n }\n }", "static public function createNewComment($userid, $articleid, $comment){\n $res = ArticleModel::createNewComment($userid, $articleid, $comment);\n return $res;\n }", "public function getComment() {}", "public static function fromJson($obj) {\n if ($obj === null) {\n return null;\n }\n\n $result = new Contact(array(\n \"id\" => isset($obj->id) ? $obj->id : null,\n \"addresses\" => isset($obj->addresses) ? Json::unpackArray(\"Address\", $obj->addresses) : null,\n \"appnotifications\" => isset($obj->appnotifications) ? $obj->appnotifications : null,\n \"apponboardingstatus\" => isset($obj->apponboardingstatus) ? $obj->apponboardingstatus : null,\n \"appoptin\" => isset($obj->appoptin) ? Appoptin::fromJson($obj->appoptin) : null,\n \"appphone\" => isset($obj->appphone) ? $obj->appphone : null,\n \"apptoken\" => isset($obj->apptoken) ? $obj->apptoken : null,\n \"birthdate\" => isset($obj->birthdate) ? Json::unpackTimestamp($obj->birthdate) : null,\n \"company\" => isset($obj->company) ? $obj->company : null,\n \"customertitleid\" => isset($obj->customertitleid) ? $obj->customertitleid : null,\n \"email\" => isset($obj->email) ? $obj->email : null,\n \"firstname\" => isset($obj->firstname) ? $obj->firstname : null,\n \"image\" => isset($obj->image) ? $obj->image : null,\n \"languagecode\" => isset($obj->languagecode) ? $obj->languagecode : null,\n \"lastname\" => isset($obj->lastname) ? $obj->lastname : null,\n \"lookup\" => isset($obj->lookup) ? $obj->lookup : null,\n \"middlename\" => isset($obj->middlename) ? $obj->middlename : null,\n \"optins\" => isset($obj->optins) ? Json::unpackArray(\"ContactOptIn\", $obj->optins) : null,\n \"organizationfunction\" => isset($obj->organizationfunction) ? $obj->organizationfunction : null,\n \"phonenumbers\" => isset($obj->phonenumbers) ? Json::unpackArray(\"Phonenumber\", $obj->phonenumbers) : null,\n \"relationships\" => isset($obj->relationships) ? Json::unpackArray(\"ContactRelationship\", $obj->relationships) : null,\n \"relationtypes\" => isset($obj->relationtypes) ? $obj->relationtypes : null,\n \"sendmail\" => isset($obj->sendmail) ? $obj->sendmail : null,\n \"sex\" => isset($obj->sex) ? $obj->sex : null,\n \"status\" => isset($obj->status) ? $obj->status : null,\n \"subscribed\" => isset($obj->subscribed) ? $obj->subscribed : null,\n \"vatnumber\" => isset($obj->vatnumber) ? $obj->vatnumber : null,\n \"isdeleted\" => isset($obj->isdeleted) ? $obj->isdeleted : null,\n \"createdts\" => isset($obj->createdts) ? Json::unpackTimestamp($obj->createdts) : null,\n \"lastupdatets\" => isset($obj->lastupdatets) ? Json::unpackTimestamp($obj->lastupdatets) : null,\n ));\n\n $result->custom_fields = array();\n foreach ($obj as $key => $value) {\n if (substr($key, 0, 2) === \"c_\") {\n $key = substr($key, 2);\n $result->custom_fields[$key] = $value;\n }\n }\n\n return $result;\n }", "function photos_comments_addComment ($photo_id, $comment_text) {\n\t\t$response = $this->execute(array('method' => 'flickr.photos.comments.addComment', 'photo_id' => $photo_id, 'comment_text' => $comment_text), 10);\n\t\t$object = unserialize($response);\n\t\tif ($object['stat'] == 'ok') {\n\t\t\treturn $object['comment']['id'];\n\t\t} else {\n\t\t\t$this->setError($object['message'], $object['code']);\n\t\t\treturn NULL;\n\t\t}\n\t}", "public function initialise($json, $smsObject)\n {\n// $this->smsObject = $smsObject;\n// $person = json_decode($json);\n// $this->consciousness = $person->consciousness;\n// $this->alive = $person->alive;\n// $this->id = $person->_id;\n }", "public function historyComment($historyComment){\n $this->request['historyComment'] = $historyComment;\n return $this;\n }", "public function historyComment($historyComment){\n $this->request['historyComment'] = $historyComment;\n return $this;\n }", "public function historyComment($historyComment){\n $this->request['historyComment'] = $historyComment;\n return $this;\n }", "public function historyComment($historyComment){\n $this->request['historyComment'] = $historyComment;\n return $this;\n }", "public function historyComment($historyComment){\n $this->request['historyComment'] = $historyComment;\n return $this;\n }", "public function historyComment($historyComment){\n $this->request['historyComment'] = $historyComment;\n return $this;\n }" ]
[ "0.5985771", "0.5589852", "0.55709434", "0.55709434", "0.55709434", "0.55100447", "0.5446352", "0.53683794", "0.531285", "0.5230024", "0.5207155", "0.5186762", "0.5132813", "0.5125865", "0.5114203", "0.5092782", "0.5072478", "0.5072292", "0.4999544", "0.49875295", "0.49864638", "0.49815685", "0.49689752", "0.49675167", "0.49553046", "0.49534497", "0.4946644", "0.49320874", "0.4928764", "0.49282622", "0.4927581", "0.4926352", "0.48994923", "0.4885817", "0.4879581", "0.48632315", "0.48612207", "0.4860605", "0.48515946", "0.48466977", "0.48394462", "0.48384658", "0.48376983", "0.48335636", "0.48288563", "0.4826944", "0.48153636", "0.48137677", "0.48135868", "0.4784052", "0.47761187", "0.47733465", "0.47730783", "0.47720435", "0.47595763", "0.4743175", "0.47376823", "0.47106814", "0.47080138", "0.4706127", "0.47046822", "0.46958962", "0.4690832", "0.46890455", "0.46854085", "0.4683925", "0.46833065", "0.46713132", "0.46677724", "0.46535677", "0.46469298", "0.4646574", "0.4644688", "0.46445882", "0.46440578", "0.46422252", "0.4635892", "0.46355638", "0.46305868", "0.46275052", "0.46182218", "0.4612716", "0.46080232", "0.460119", "0.45950836", "0.4593439", "0.45885578", "0.45885578", "0.45702684", "0.4562591", "0.45566657", "0.45540288", "0.45524588", "0.4550594", "0.45432195", "0.4534593", "0.4534593", "0.4534593", "0.4534593", "0.4534593", "0.4534593" ]
0.0
-1
The text or "message body" of the comment
public function getText() { return $this->text; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getCommentText()\n {\n return $this->commentText;\n }", "public function getCommentText() {\n\t\treturn $this->commentText;\n\t}", "public function getCommentTxt()\n {\n return $this->commentTxt;\n }", "protected function getComment() {\n\t\t$comment_body = elgg_view('output/longtext', array(\n\t\t\t'value' => $this->comment->description,\n\t\t));\n//\t\tif (elgg_view_exists('output/linkify')) {\n//\t\t\t$comment_body = elgg_view('output/linkify', array(\n//\t\t\t\t'value' => $comment_body\n//\t\t\t));\n//\t\t}\n\t\t$comment_body .= elgg_view('output/attached', array(\n\t\t\t'entity' => $this->comment,\n\t\t));\n\n\t\t$attachments = $this->comment->getAttachments(array('limit' => 0));\n\t\tif ($attachments && count($attachments)) {\n\t\t\t$attachments = array_map(function(\\ElggEntity $entity) {\n\t\t\t\treturn elgg_view('output/url', [\n\t\t\t\t\t'href' => $entity->getURL(),\n\t\t\t\t\t'text' => $entity->getDisplayName(),\n\t\t\t\t]);\n\t\t\t}, $attachments);\n\n\t\t\t$attachments_text = implode(', ', array_filter($attachments));\n\t\t\tif ($attachments_text) {\n\t\t\t\t$comment_body .= elgg_echo('interactions:attachments:labelled', array($attachments_text));\n\t\t\t}\n\t\t}\n\n\t\treturn strip_tags($comment_body, '<p><strong><em><span><ul><li><ol><blockquote><img><a>');\n\t}", "public function getCommentContent(): string {\n\t\treturn ($this->commentContent);\n\t}", "public function getCommentContent()\n {\n return $this->commentContent;\n }", "public function getComment() {}", "public function getComment();", "public function getComment();", "public function getComment();", "public function getComment();", "public function getComment();", "public function getComment();", "public function getComment(): string;", "public function getComment()\n {\n $value = $this->get(self::comment);\n return $value === null ? (string)$value : $value;\n }", "public function comment() {\n\t\treturn $this->comment;\n\t}", "public function getComment()\n {\n $value = $this->get(self::COMMENT);\n return $value === null ? (string)$value : $value;\n }", "public function FormattedComment() {\n\t\treturn $this->FormattedText($this->Comment);\n\t}", "public function getComment()\n { \n return $this->comment;\n }", "public function getComment()\r\n {\r\n return $this->comment;\r\n }", "public function get_comment()\n\t{\n\t\treturn $this->comment;\n\t}", "function get_comment_text($comment_id = 0, $args = array())\n {\n }", "public function getComment()\r\n\t{\r\n\r\n\t\t$answers = SurveyMonkeySurveyAnswer::get()->filter(array(\r\n\t\t\t'AnswerID' => $this->AnswerID,\r\n\t\t\t'SurveyMonkeySurveyResponseID' => $this->SurveyMonkeySurveyResponseID));\r\n\r\n\t\tforeach($answers as $answer) {\r\n\t\t\tif (($answer->getAnswerSection() == $this->getAnswerSection())) {\r\n\t\t\t\treturn $answer->Text;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn \"\";\r\n\t}", "function get_comment() {\n\t\treturn $this->comment;\n\t}", "public function getComment()\n {\n return $this->comment;\n }", "public function getComment()\n {\n return $this->comment;\n }", "public function getComment()\n {\n return $this->comment;\n }", "public function getComment()\n {\n return $this->comment;\n }", "public function getComment()\n {\n return $this->comment;\n }", "public function getComment()\n {\n return $this->comment;\n }", "public function getComment()\n {\n return $this->comment;\n }", "function comment_notification_text($notify_message, $comment_id) {\n extract($this->get_comment_data($comment_id));\n if ($comment->comment_type == 'facebook') {\n ob_start();\n $content = strip_tags($comment->comment_content);\n ?>\nNew Facebook Comment on your post \"<?php echo $post->post_title ?>\"\n\nAuthor : <?php echo $comment->comment_author ?> \nURL : <?php echo $comment->comment_author_url ?> \n\nComment:\n\n<?php echo $content ?> \n\nParticipate in the conversation here:\n<?php echo $this->get_permalink($post->ID) ?> \n\n <?php\n return ob_get_clean();\n } else {\n return $notify_message;\n }\n }", "public function getComment()\n\t{\n\t\treturn $this->comment;\n\t}", "public function getComment()\n {\n return $this->_comment;\n }", "public function getComment() {\n return $this->comment;\n }", "public function getCommentHTML() {\n return str_replace(\"\\n\", \"<br />\", trim(str_replace(array(\"/*\", \"*\"), array(\"\", \"\"), $this->getComment())));\n }", "public function get_comment()\n {\n return $this->get_default_property(self::PROPERTY_COMMENT);\n }", "function getComment() {\n return DataObjectPool::get($this->getAdditionalProperty('comment_type'), $this->getAdditionalProperty('comment_id'));\n }", "function getComment()\n {\n return $this->comment;\n }", "function get_content() {\n\t\treturn $this->get_data( 'comment_content' );\n\t}", "public function getComment()\n {\n\t$comment = Mage::getSingleton('checkout/session')->getData('customer_comment');\n\tif($comment) {\n\t return htmlspecialchars($comment);\n\t}\n\treturn '';\n }", "public function getDocComment();", "public function the_comment()\n {\n }", "function comment_text($comment_id = 0, $args = array())\n {\n }", "abstract public function comment();", "public function GetComment()\n\t{\n\t\tif (!$this->dataRead)\n\t\t\t$this->ReadData();\n\n\t\treturn $this->comment;\n\t}", "public function getRawComment()\n\t{\n\t\tFoundry::checkToken();\n\n\t\t// Only registered users are allowed here.\n\t\tFoundry::requireLogin();\n\n\t\t// Get the view\n\t\t$view = Foundry::view( 'comments', false );\n\n\t\t// Check for permission first\n\t\t$access = Foundry::access();\n\n\t\tif( !$access->allowed( 'comments.read' ) )\n\t\t{\n\t\t\t$view->setMessage( JText::_( 'COM_EASYSOCIAL_COMMENTS_NOT_ALLOWED_TO_READ' ) , SOCIAL_MSG_ERROR );\n\t\t\treturn $view->call( __FUNCTION__ );\n\t\t}\n\n\t\t$id = JRequest::getInt( 'id', 0 );\n\n\t\t$table = Foundry::table( 'comments' );\n\n\t\t$state = $table->load( $id );\n\n\t\tif( !$state )\n\t\t{\n\t\t\t$view->setMessage( $table->getError(), SOCIAL_MSG_ERROR );\n\t\t\treturn $view->call( __FUNCTION__ );\n\t\t}\n\n\t\t$comment = $table->comment;\n\n\t\t$stringLib = Foundry::get( 'string' );\n\n\t\t$comment = $stringLib->escape( $comment );\n\n\n\t\t$view->call( __FUNCTION__, $comment );\n\t}", "public function getCreditComment();", "public function message()\n {\n return 'wrong comment id';\n }", "public function getEscapedComment()\n {\n return $this->Comment;\n }", "public function getComment()\n {\n return array();\n }", "protected function get_formatted_comment(): string\n\t{\n\t\treturn $this->comment ? \"`$this->comment`\" : '';\n\t}", "public function message(): string\n {\n return sprintf('%s在评论中@了你', $this->sender->name);\n }", "function parse_comments ( &$comment_text, &$comment_author, $comment_email )\n\t{\n\t\tglobal $cbwordwrap, $wwwidth, $bbc, $htc, $wfcom, $comallowbr, $smilcom;\n \n $comment_text = str_replace ('&br;', ($comallowbr ? '<br />': ''), $comment_text);\n $comment_text = format_message ($comment_text, $htc, $bbc, $smilcom, $wfcom);\n\n\t\tif ( !empty ($comment_email) )\n\t\t{\n\t\t\t$comment_author = '<a href=\"mailto:' . $comment_email . '\">' . $comment_author . '</a>';\n\t\t}\n\t}", "private function readCommentString(): string\n {\n $length = strcspn($this->data, \"\\n\\r\", $this->position);\n\n return substr($this->data, ($this->position += $length) - $length, $length);\n }", "public function getCustomerOrderComment()\n\t{\n\t\treturn $this->getAurednikOrder()->getData('aurednik_order_comment');\n\t}", "public function comment($value = null)\n\t{\n\t\tif ($value != null)\n\t\t{\n\t\t\t$this->_comment = $value;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn $this->_comment;\n\t\t}\n\t}", "public function record_comment(){\n\t\t\t\n\t\t}", "function slack_comment( $comment_id ) : void {\n\t$comment = get_comment( $comment_id );\n\t$post = get_post( $comment->comment_post_ID );\n\t$category = get_the_category( $post->ID )[0]->slug;\n\t$author = get_user_by( 'id', $comment->user_id );\n\t$message = stripslashes( wp_strip_all_tags( sanitize_textarea_field( wp_unslash( $comment->comment_content ) ) ) );\n\n\t$channel = [\n\t\t'air' => '#airseries',\n\t\t'air-pro' => '#airseries-pro',\n\t\t'capsules' => '#capsules',\n\t\t'in-training-exam-prep' => '#ite-prep',\n\t][ $category ] ?? '#aliemu';\n\n\tslack_message(\n\t\t$channel,\n\t\t[\n\t\t\t'fallback' => \"Comment from {$comment->comment_author} on {$post->post_title}: {$message}\",\n\t\t\t'pretext' => \"*Comment Received: <{$post->guid}|{$post->post_title}>*\",\n\t\t\t'author_name' => $comment->comment_author,\n\t\t\t'author_link' => \"https://www.aliemu.com/user/{$author->user_login}\",\n\t\t\t'author_icon' => add_query_arg(\n\t\t\t\t[\n\t\t\t\t\t'size' => 16,\n\t\t\t\t\t'default' => 'mp',\n\t\t\t\t],\n\t\t\t\t'https://www.gravatar.com/avatar/' . md5( strtolower( trim( $author->user_email ) ) )\n\t\t\t),\n\t\t\t'text' => $message,\n\t\t\t'actions' => [\n\t\t\t\t(object) [\n\t\t\t\t\t'type' => 'button',\n\t\t\t\t\t'text' => 'View Comment',\n\t\t\t\t\t'url' => get_comment_link( $comment ),\n\t\t\t\t],\n\t\t\t],\n\t\t]\n\t);\n}", "public function isComment() {}", "public function formatComment(string $comment): string;", "public function getPostedComment() {\n\t\treturn $this->postedComment; \n\t}", "public function text()\n {\n return $this->message->text ?? $this->edited_message->text ?? null;\n }", "protected function report_comment_failure_message(){\r\n\t\treturn 'Sorry, the comment could not be reported.';\r\n\t}", "function the_comment()\n {\n }", "public function comment($comment)\n\t{\n\t\treturn $comment ? \"/* {$comment} */\" : null;\n\t}", "function Comment($commentText, $IPNumber, $name, $UID=\"\") {\n\n\t\t$this->commentText = substr(wordwrap($commentText, 100, \" \", 1), 0, 1000);\n\t\t$this->datePosted = time();\n\t\t$this->IPNumber = $IPNumber;\n\t\t$this->name = substr($name, 0, 100);\n\t\t$this->UID = $UID;\n\t}", "public function getUploadcomment() {}", "public function getBodyText(): string\n {\n return $this->textMessage;\n }", "function get_comment_author_email($comment_id = 0)\n {\n }", "public function getCommentTitle()\n {\n return $this->commentTitle;\n }", "public function getDescription()\n {\n \tthrow new Lib_Exception(\"Comments cannot be asked for their description\");\n }", "public function getWikiDescription() {\n\t\tforeach ( $this->gpml->Comment as $comment ) {\n\t\t\tif ( $comment['Source'] == COMMENT_WP_DESCRIPTION ) {\n\t\t\t\treturn (string)$comment;\n\t\t\t}\n\t\t}\n\t}", "public function getInternalComment()\n {\n return $this->internal_comment;\n }", "public function getCommentText()\n {\n $helper = Mage::helper('tigo_tigomoney');\n return\n $helper->__('Your store has two URIs which will be used by Tigo Payment Server. They are:') . '<br />' .\n '<strong>Redirect URI:</strong> ' . $this->_getRedirectUri() . ' <br />' .\n '<strong>Callback URI:</strong> ' . $this->_getCallbackUrl() . ' <br />';\n }", "function Comment($content) {\n\n /* Variablen initialisieren */\n $this->content = $content;\n }", "public function getText()\n {\n if (!isset($this->_text)) {\n $this->_text = \"\";\n $pageDoc = $this->getPageComment();\n $match = $match2 = array();\n if (preg_match('/(?:\\/\\*\\*|^)[\\s\\*\\r\\f\\n]*\\S.*?[\\r\\f\\n]/', $pageDoc, $match)) {\n if (preg_match('/[\\s\\*\\r\\f\\n]([^@\\{]+)/si', $pageDoc, $match2, 0, mb_strlen($match[0]))) {\n $this->_text = trim(preg_replace('/^\\s*\\*\\s*/Um', '', $match2[1]));\n }\n }\n }\n return $this->_text;\n }", "public function didUserPressPostComment(){\n\t\t\tif(isset($_POST['comment'])){\n\t\t\t\t\n\t\t\t\treturn $_POST['comment'];\n\t\t\t}\n\t\t\treturn \"\";\n\t\t}", "public function getCommentID()\n {\n return $this->commentID;\n }", "function recvcommentdata( $parid, $username, $usermessage ) {\n\t\t$this->result = $this->conn->addcomment ( \"x@y\", $parid, $usermessage );\n\t\tif( !$this->result ) {\n\t\t\t$this->outstr .= \"<error>\" . mysql_error() . \"</error>\";\n\t\t\treturn $this->outstr;\n\t\t}\n\t\treturn \"<ok>ok</ok>\";\n\t}", "function get_comment_ID()\n {\n }", "public function getComment()\n\t{\n\t\treturn explode('~',(string) $this->xml->GBSeq_comment);\n\t}", "private function getCommentShell() {\n // if comment author is NULL (not really a normal data condition), then actually fetch the comment and return it\n if ($this->commentAuthorID === null) {\n try {\n return Connect\\SocialQuestionComment::fetch($this->connectObj->ID);\n }\n catch (\\Exception $e) {\n // failure is probably due to testing, so just fall-through\n }\n }\n return parent::getSocialObjectShell('SocialQuestionComment', $this->socialQuestion, $this->commentAuthorID ?: null);\n }", "public function loadComment(){\n\n if($this->id == -1 || empty($this->databasePath))\n return \"\";\n\n $sqlQuery = 'SELECT text FROM comments WHERE book='.$this->id;\n\n $comment = \"\";\n $pdo = new SPDO($this->databasePath);\n foreach ($pdo->query($sqlQuery) as $row)\n $comment .= $row['text'];\n \n return $comment;\n }", "private function _createCommentField()\n {\n $comment = new Zend_Form_Element_Textarea('comment');\n $comment->setLabel('bankComment')\n ->addFilter(new Zend_Filter_StringTrim())\n ->addFilter(new Zend_Filter_StripTags())\n ->addValidator(new Zend_Validate_StringLength(array('min' => 5)))\n ->setAttribs(array('cols' => '60', 'rows' => '5'));\n\n return $comment;\n }", "function plc_comment_post( $incoming_comment ) {\n\n\t// convert everything in a comment to display literally\n\t$incoming_comment['comment_content'] = htmlspecialchars($incoming_comment['comment_content']);\n\n\t// the one exception is single quotes, which cannot be #039; because WordPress marks it as spam\n\t$incoming_comment['comment_content'] = str_replace( \"'\", '&apos;', $incoming_comment['comment_content'] );\n\n\treturn( $incoming_comment );\n}", "function OutputComment() {\n\t\t$pagecomment = trim($this->shortDescription) ? PrepString($this->shortDescription).\"<br />\" : \"\";\n\t\t$pagecomment .= trim($this->longDescription) ? PrepString($this->longDescription).\"<br />\" : \"\";\n\t\t$pagecomment .= trim($this->tags) ? \"<i>\".PrepString($this->tags).\"</i>\" : \"\";\n\t\t$pagecomment = $pagecomment ? $pagecomment : \"<i>(Undocumented)</i>\";\n\t\t$pagecomment = \"<div class='pagecomment'>$pagecomment</div>\";\n\t\treturn $pagecomment;\n\t}", "function tweet_comment_preprocess_comment( $data ) {\n\treturn $data;\n}", "public function comment() {\n if (isLoggedIn() == false) {\n flash('login_to_post', 'Please, login to comment');\n redirect('/users/login');\n }\n\n if ($_SERVER['REQUEST_METHOD'] == 'POST') {\n\n // Sanitize array\n $_POST = filter_input_array(INPUT_POST, FILTER_SANITIZE_STRING);\n\n $data = [\n 'body' => trim($_POST['body']),\n 'post_id' => trim($_POST['post_id']),\n 'user_id' => $_SESSION['user_id'],\n 'user_name' => $this->userModel->getUserById($_SESSION['user_id'])->name\n ];\n\n if (!empty($data['body']) && !empty($data['post_id']) && !empty($data['user_id']) && !empty($data['user_name'])) {\n // Save comment\n $this->postModel->comment($data);\n $post = $this->postModel->getPostById($data['post_id']);\n $receiver = $this->userModel->getUserById($post->user_id);\n if ($receiver->receive_email == true) {\n $this->mail($receiver->email, $receiver->name, $post->id);\n }\n }\n redirect('/posts/show/' . $_POST['post_id']);\n }\n\n }", "private function add_comment()\n\t{\n\t\tif(!$this->owner->logged_in())\n\t\t\treturn new View('public_forum/login');\n\t\t\n\t\tif(empty($_POST['body']))\n\t\t\treturn 'Reply cannot be empty.';\n\t\t\n\t\t$post_id = $this->filter;\n\t\t$new_comment = ORM::Factory('forum_cat_post_comment');\n\t\t$new_comment->forum_cat_post_id = $post_id;\n\t\t$new_comment->owner_id\t= $this->owner->get_user()->id;\n\t\t$new_comment->body\t\t\t= $_POST['body'];\n\t\t$new_comment->save();\n\t\treturn 'Thank you, your comment has been added!';\t\t\n\t}", "public function comments(): ?string\n {\n return $this->comments;\n }", "function get_instance_comment($cId) \n {\n return $this->instance->get_instance_comment($cId);\n }", "public function getCustomerComment() {\r\n\r\n\t\tself::errorReset();\r\n\t\t$this->reload();\r\n\t\treturn $this->customerComment;\r\n\t}", "protected function report_comment_success_message(){\r\n\t\treturn 'The comment has been reported.';\r\n\t}", "function comment_text_rss()\n {\n }", "function rawComment($commentid) {\n\t$commentid = intval($commentid);\n\treturn(dbFirstResult(\"SELECT text FROM comments WHERE id=$commentid\"));\n}", "function get_comment_excerpt($comment_id = 0)\n {\n }", "public function getText()\n {\n return $this->hasText() ? $this->update->message->text : null;\n }", "function do_salmon_as_comment($module,$id,$self_url,$self_title,$title=NULL,$post=NULL,$email='',$poster_name_if_guest='',$forum=NULL,$validated=NULL)\n\t{\n\t\tif (!is_null($post)) $_POST['post'] = $post;\n\t\tif (!is_null($title)) $_POST['title'] = $title;\n\t\t$_POST['email'] = $email;\n\t\t$_POST['poster_name_if_guest'] = $poster_name_if_guest;\n\t\t\n\t\treturn do_comments(true,$module,$id,$self_url,$self_title,$forum,true,$validated,false,true);\n\t}", "public function getCommentId()\n {\n return $this->comment_id;\n }", "public function get_message_text()\n {\n return $this->message_text;\n }" ]
[ "0.81483984", "0.8079359", "0.77895933", "0.77465856", "0.7724915", "0.75973344", "0.75740904", "0.7534672", "0.7534672", "0.7534672", "0.7534672", "0.7534672", "0.7534672", "0.74198496", "0.7377613", "0.736731", "0.73610365", "0.7335587", "0.73297894", "0.7290058", "0.7274623", "0.7273715", "0.7249417", "0.7237969", "0.7229838", "0.7229838", "0.7229838", "0.7229838", "0.7229838", "0.7229838", "0.7229838", "0.72060555", "0.7191266", "0.71785206", "0.7165691", "0.70979583", "0.7057285", "0.7038168", "0.7009672", "0.6985748", "0.69801223", "0.69723046", "0.6939063", "0.6886675", "0.6851681", "0.6819338", "0.6809836", "0.67791736", "0.67660356", "0.6730935", "0.6700559", "0.66805315", "0.6664067", "0.6647529", "0.6541835", "0.6521194", "0.65194833", "0.64991194", "0.64591503", "0.64443654", "0.6435543", "0.64165276", "0.6406318", "0.63964623", "0.63882154", "0.6355471", "0.63451", "0.63274384", "0.63151807", "0.63147765", "0.630272", "0.62896764", "0.6277962", "0.6270032", "0.62670684", "0.6254481", "0.62509966", "0.62454027", "0.6244722", "0.6243865", "0.62424743", "0.6231808", "0.6224427", "0.62160933", "0.6210251", "0.62098664", "0.6205853", "0.61844134", "0.6173724", "0.6173437", "0.61723894", "0.61710906", "0.6168809", "0.6158524", "0.6154418", "0.6151625", "0.61445624", "0.6120501", "0.61166215", "0.61096275", "0.6105082" ]
0.0
-1
The text or "message body" of the comment
public function setText($text) { $this->text = $text; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getCommentText()\n {\n return $this->commentText;\n }", "public function getCommentText() {\n\t\treturn $this->commentText;\n\t}", "public function getCommentTxt()\n {\n return $this->commentTxt;\n }", "protected function getComment() {\n\t\t$comment_body = elgg_view('output/longtext', array(\n\t\t\t'value' => $this->comment->description,\n\t\t));\n//\t\tif (elgg_view_exists('output/linkify')) {\n//\t\t\t$comment_body = elgg_view('output/linkify', array(\n//\t\t\t\t'value' => $comment_body\n//\t\t\t));\n//\t\t}\n\t\t$comment_body .= elgg_view('output/attached', array(\n\t\t\t'entity' => $this->comment,\n\t\t));\n\n\t\t$attachments = $this->comment->getAttachments(array('limit' => 0));\n\t\tif ($attachments && count($attachments)) {\n\t\t\t$attachments = array_map(function(\\ElggEntity $entity) {\n\t\t\t\treturn elgg_view('output/url', [\n\t\t\t\t\t'href' => $entity->getURL(),\n\t\t\t\t\t'text' => $entity->getDisplayName(),\n\t\t\t\t]);\n\t\t\t}, $attachments);\n\n\t\t\t$attachments_text = implode(', ', array_filter($attachments));\n\t\t\tif ($attachments_text) {\n\t\t\t\t$comment_body .= elgg_echo('interactions:attachments:labelled', array($attachments_text));\n\t\t\t}\n\t\t}\n\n\t\treturn strip_tags($comment_body, '<p><strong><em><span><ul><li><ol><blockquote><img><a>');\n\t}", "public function getCommentContent(): string {\n\t\treturn ($this->commentContent);\n\t}", "public function getCommentContent()\n {\n return $this->commentContent;\n }", "public function getComment() {}", "public function getComment();", "public function getComment();", "public function getComment();", "public function getComment();", "public function getComment();", "public function getComment();", "public function getComment(): string;", "public function getComment()\n {\n $value = $this->get(self::comment);\n return $value === null ? (string)$value : $value;\n }", "public function comment() {\n\t\treturn $this->comment;\n\t}", "public function getComment()\n {\n $value = $this->get(self::COMMENT);\n return $value === null ? (string)$value : $value;\n }", "public function FormattedComment() {\n\t\treturn $this->FormattedText($this->Comment);\n\t}", "public function getComment()\n { \n return $this->comment;\n }", "public function getComment()\r\n {\r\n return $this->comment;\r\n }", "function get_comment_text($comment_id = 0, $args = array())\n {\n }", "public function get_comment()\n\t{\n\t\treturn $this->comment;\n\t}", "public function getComment()\r\n\t{\r\n\r\n\t\t$answers = SurveyMonkeySurveyAnswer::get()->filter(array(\r\n\t\t\t'AnswerID' => $this->AnswerID,\r\n\t\t\t'SurveyMonkeySurveyResponseID' => $this->SurveyMonkeySurveyResponseID));\r\n\r\n\t\tforeach($answers as $answer) {\r\n\t\t\tif (($answer->getAnswerSection() == $this->getAnswerSection())) {\r\n\t\t\t\treturn $answer->Text;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn \"\";\r\n\t}", "function get_comment() {\n\t\treturn $this->comment;\n\t}", "public function getComment()\n {\n return $this->comment;\n }", "public function getComment()\n {\n return $this->comment;\n }", "public function getComment()\n {\n return $this->comment;\n }", "public function getComment()\n {\n return $this->comment;\n }", "public function getComment()\n {\n return $this->comment;\n }", "public function getComment()\n {\n return $this->comment;\n }", "public function getComment()\n {\n return $this->comment;\n }", "function comment_notification_text($notify_message, $comment_id) {\n extract($this->get_comment_data($comment_id));\n if ($comment->comment_type == 'facebook') {\n ob_start();\n $content = strip_tags($comment->comment_content);\n ?>\nNew Facebook Comment on your post \"<?php echo $post->post_title ?>\"\n\nAuthor : <?php echo $comment->comment_author ?> \nURL : <?php echo $comment->comment_author_url ?> \n\nComment:\n\n<?php echo $content ?> \n\nParticipate in the conversation here:\n<?php echo $this->get_permalink($post->ID) ?> \n\n <?php\n return ob_get_clean();\n } else {\n return $notify_message;\n }\n }", "public function getComment()\n\t{\n\t\treturn $this->comment;\n\t}", "public function getComment()\n {\n return $this->_comment;\n }", "public function getComment() {\n return $this->comment;\n }", "public function getCommentHTML() {\n return str_replace(\"\\n\", \"<br />\", trim(str_replace(array(\"/*\", \"*\"), array(\"\", \"\"), $this->getComment())));\n }", "public function get_comment()\n {\n return $this->get_default_property(self::PROPERTY_COMMENT);\n }", "function getComment() {\n return DataObjectPool::get($this->getAdditionalProperty('comment_type'), $this->getAdditionalProperty('comment_id'));\n }", "function getComment()\n {\n return $this->comment;\n }", "function get_content() {\n\t\treturn $this->get_data( 'comment_content' );\n\t}", "public function getComment()\n {\n\t$comment = Mage::getSingleton('checkout/session')->getData('customer_comment');\n\tif($comment) {\n\t return htmlspecialchars($comment);\n\t}\n\treturn '';\n }", "public function getDocComment();", "public function the_comment()\n {\n }", "function comment_text($comment_id = 0, $args = array())\n {\n }", "abstract public function comment();", "public function GetComment()\n\t{\n\t\tif (!$this->dataRead)\n\t\t\t$this->ReadData();\n\n\t\treturn $this->comment;\n\t}", "public function getRawComment()\n\t{\n\t\tFoundry::checkToken();\n\n\t\t// Only registered users are allowed here.\n\t\tFoundry::requireLogin();\n\n\t\t// Get the view\n\t\t$view = Foundry::view( 'comments', false );\n\n\t\t// Check for permission first\n\t\t$access = Foundry::access();\n\n\t\tif( !$access->allowed( 'comments.read' ) )\n\t\t{\n\t\t\t$view->setMessage( JText::_( 'COM_EASYSOCIAL_COMMENTS_NOT_ALLOWED_TO_READ' ) , SOCIAL_MSG_ERROR );\n\t\t\treturn $view->call( __FUNCTION__ );\n\t\t}\n\n\t\t$id = JRequest::getInt( 'id', 0 );\n\n\t\t$table = Foundry::table( 'comments' );\n\n\t\t$state = $table->load( $id );\n\n\t\tif( !$state )\n\t\t{\n\t\t\t$view->setMessage( $table->getError(), SOCIAL_MSG_ERROR );\n\t\t\treturn $view->call( __FUNCTION__ );\n\t\t}\n\n\t\t$comment = $table->comment;\n\n\t\t$stringLib = Foundry::get( 'string' );\n\n\t\t$comment = $stringLib->escape( $comment );\n\n\n\t\t$view->call( __FUNCTION__, $comment );\n\t}", "public function getCreditComment();", "public function message()\n {\n return 'wrong comment id';\n }", "public function getEscapedComment()\n {\n return $this->Comment;\n }", "public function getComment()\n {\n return array();\n }", "protected function get_formatted_comment(): string\n\t{\n\t\treturn $this->comment ? \"`$this->comment`\" : '';\n\t}", "public function message(): string\n {\n return sprintf('%s在评论中@了你', $this->sender->name);\n }", "function parse_comments ( &$comment_text, &$comment_author, $comment_email )\n\t{\n\t\tglobal $cbwordwrap, $wwwidth, $bbc, $htc, $wfcom, $comallowbr, $smilcom;\n \n $comment_text = str_replace ('&br;', ($comallowbr ? '<br />': ''), $comment_text);\n $comment_text = format_message ($comment_text, $htc, $bbc, $smilcom, $wfcom);\n\n\t\tif ( !empty ($comment_email) )\n\t\t{\n\t\t\t$comment_author = '<a href=\"mailto:' . $comment_email . '\">' . $comment_author . '</a>';\n\t\t}\n\t}", "private function readCommentString(): string\n {\n $length = strcspn($this->data, \"\\n\\r\", $this->position);\n\n return substr($this->data, ($this->position += $length) - $length, $length);\n }", "public function getCustomerOrderComment()\n\t{\n\t\treturn $this->getAurednikOrder()->getData('aurednik_order_comment');\n\t}", "public function comment($value = null)\n\t{\n\t\tif ($value != null)\n\t\t{\n\t\t\t$this->_comment = $value;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn $this->_comment;\n\t\t}\n\t}", "public function record_comment(){\n\t\t\t\n\t\t}", "function slack_comment( $comment_id ) : void {\n\t$comment = get_comment( $comment_id );\n\t$post = get_post( $comment->comment_post_ID );\n\t$category = get_the_category( $post->ID )[0]->slug;\n\t$author = get_user_by( 'id', $comment->user_id );\n\t$message = stripslashes( wp_strip_all_tags( sanitize_textarea_field( wp_unslash( $comment->comment_content ) ) ) );\n\n\t$channel = [\n\t\t'air' => '#airseries',\n\t\t'air-pro' => '#airseries-pro',\n\t\t'capsules' => '#capsules',\n\t\t'in-training-exam-prep' => '#ite-prep',\n\t][ $category ] ?? '#aliemu';\n\n\tslack_message(\n\t\t$channel,\n\t\t[\n\t\t\t'fallback' => \"Comment from {$comment->comment_author} on {$post->post_title}: {$message}\",\n\t\t\t'pretext' => \"*Comment Received: <{$post->guid}|{$post->post_title}>*\",\n\t\t\t'author_name' => $comment->comment_author,\n\t\t\t'author_link' => \"https://www.aliemu.com/user/{$author->user_login}\",\n\t\t\t'author_icon' => add_query_arg(\n\t\t\t\t[\n\t\t\t\t\t'size' => 16,\n\t\t\t\t\t'default' => 'mp',\n\t\t\t\t],\n\t\t\t\t'https://www.gravatar.com/avatar/' . md5( strtolower( trim( $author->user_email ) ) )\n\t\t\t),\n\t\t\t'text' => $message,\n\t\t\t'actions' => [\n\t\t\t\t(object) [\n\t\t\t\t\t'type' => 'button',\n\t\t\t\t\t'text' => 'View Comment',\n\t\t\t\t\t'url' => get_comment_link( $comment ),\n\t\t\t\t],\n\t\t\t],\n\t\t]\n\t);\n}", "public function isComment() {}", "public function formatComment(string $comment): string;", "public function getPostedComment() {\n\t\treturn $this->postedComment; \n\t}", "public function text()\n {\n return $this->message->text ?? $this->edited_message->text ?? null;\n }", "protected function report_comment_failure_message(){\r\n\t\treturn 'Sorry, the comment could not be reported.';\r\n\t}", "function the_comment()\n {\n }", "public function comment($comment)\n\t{\n\t\treturn $comment ? \"/* {$comment} */\" : null;\n\t}", "function Comment($commentText, $IPNumber, $name, $UID=\"\") {\n\n\t\t$this->commentText = substr(wordwrap($commentText, 100, \" \", 1), 0, 1000);\n\t\t$this->datePosted = time();\n\t\t$this->IPNumber = $IPNumber;\n\t\t$this->name = substr($name, 0, 100);\n\t\t$this->UID = $UID;\n\t}", "public function getUploadcomment() {}", "function get_comment_author_email($comment_id = 0)\n {\n }", "public function getBodyText(): string\n {\n return $this->textMessage;\n }", "public function getCommentTitle()\n {\n return $this->commentTitle;\n }", "public function getDescription()\n {\n \tthrow new Lib_Exception(\"Comments cannot be asked for their description\");\n }", "public function getWikiDescription() {\n\t\tforeach ( $this->gpml->Comment as $comment ) {\n\t\t\tif ( $comment['Source'] == COMMENT_WP_DESCRIPTION ) {\n\t\t\t\treturn (string)$comment;\n\t\t\t}\n\t\t}\n\t}", "public function getInternalComment()\n {\n return $this->internal_comment;\n }", "public function getCommentText()\n {\n $helper = Mage::helper('tigo_tigomoney');\n return\n $helper->__('Your store has two URIs which will be used by Tigo Payment Server. They are:') . '<br />' .\n '<strong>Redirect URI:</strong> ' . $this->_getRedirectUri() . ' <br />' .\n '<strong>Callback URI:</strong> ' . $this->_getCallbackUrl() . ' <br />';\n }", "function Comment($content) {\n\n /* Variablen initialisieren */\n $this->content = $content;\n }", "public function getText()\n {\n if (!isset($this->_text)) {\n $this->_text = \"\";\n $pageDoc = $this->getPageComment();\n $match = $match2 = array();\n if (preg_match('/(?:\\/\\*\\*|^)[\\s\\*\\r\\f\\n]*\\S.*?[\\r\\f\\n]/', $pageDoc, $match)) {\n if (preg_match('/[\\s\\*\\r\\f\\n]([^@\\{]+)/si', $pageDoc, $match2, 0, mb_strlen($match[0]))) {\n $this->_text = trim(preg_replace('/^\\s*\\*\\s*/Um', '', $match2[1]));\n }\n }\n }\n return $this->_text;\n }", "public function didUserPressPostComment(){\n\t\t\tif(isset($_POST['comment'])){\n\t\t\t\t\n\t\t\t\treturn $_POST['comment'];\n\t\t\t}\n\t\t\treturn \"\";\n\t\t}", "public function getCommentID()\n {\n return $this->commentID;\n }", "function recvcommentdata( $parid, $username, $usermessage ) {\n\t\t$this->result = $this->conn->addcomment ( \"x@y\", $parid, $usermessage );\n\t\tif( !$this->result ) {\n\t\t\t$this->outstr .= \"<error>\" . mysql_error() . \"</error>\";\n\t\t\treturn $this->outstr;\n\t\t}\n\t\treturn \"<ok>ok</ok>\";\n\t}", "function get_comment_ID()\n {\n }", "public function getComment()\n\t{\n\t\treturn explode('~',(string) $this->xml->GBSeq_comment);\n\t}", "private function getCommentShell() {\n // if comment author is NULL (not really a normal data condition), then actually fetch the comment and return it\n if ($this->commentAuthorID === null) {\n try {\n return Connect\\SocialQuestionComment::fetch($this->connectObj->ID);\n }\n catch (\\Exception $e) {\n // failure is probably due to testing, so just fall-through\n }\n }\n return parent::getSocialObjectShell('SocialQuestionComment', $this->socialQuestion, $this->commentAuthorID ?: null);\n }", "public function loadComment(){\n\n if($this->id == -1 || empty($this->databasePath))\n return \"\";\n\n $sqlQuery = 'SELECT text FROM comments WHERE book='.$this->id;\n\n $comment = \"\";\n $pdo = new SPDO($this->databasePath);\n foreach ($pdo->query($sqlQuery) as $row)\n $comment .= $row['text'];\n \n return $comment;\n }", "function plc_comment_post( $incoming_comment ) {\n\n\t// convert everything in a comment to display literally\n\t$incoming_comment['comment_content'] = htmlspecialchars($incoming_comment['comment_content']);\n\n\t// the one exception is single quotes, which cannot be #039; because WordPress marks it as spam\n\t$incoming_comment['comment_content'] = str_replace( \"'\", '&apos;', $incoming_comment['comment_content'] );\n\n\treturn( $incoming_comment );\n}", "private function _createCommentField()\n {\n $comment = new Zend_Form_Element_Textarea('comment');\n $comment->setLabel('bankComment')\n ->addFilter(new Zend_Filter_StringTrim())\n ->addFilter(new Zend_Filter_StripTags())\n ->addValidator(new Zend_Validate_StringLength(array('min' => 5)))\n ->setAttribs(array('cols' => '60', 'rows' => '5'));\n\n return $comment;\n }", "function OutputComment() {\n\t\t$pagecomment = trim($this->shortDescription) ? PrepString($this->shortDescription).\"<br />\" : \"\";\n\t\t$pagecomment .= trim($this->longDescription) ? PrepString($this->longDescription).\"<br />\" : \"\";\n\t\t$pagecomment .= trim($this->tags) ? \"<i>\".PrepString($this->tags).\"</i>\" : \"\";\n\t\t$pagecomment = $pagecomment ? $pagecomment : \"<i>(Undocumented)</i>\";\n\t\t$pagecomment = \"<div class='pagecomment'>$pagecomment</div>\";\n\t\treturn $pagecomment;\n\t}", "function tweet_comment_preprocess_comment( $data ) {\n\treturn $data;\n}", "public function comment() {\n if (isLoggedIn() == false) {\n flash('login_to_post', 'Please, login to comment');\n redirect('/users/login');\n }\n\n if ($_SERVER['REQUEST_METHOD'] == 'POST') {\n\n // Sanitize array\n $_POST = filter_input_array(INPUT_POST, FILTER_SANITIZE_STRING);\n\n $data = [\n 'body' => trim($_POST['body']),\n 'post_id' => trim($_POST['post_id']),\n 'user_id' => $_SESSION['user_id'],\n 'user_name' => $this->userModel->getUserById($_SESSION['user_id'])->name\n ];\n\n if (!empty($data['body']) && !empty($data['post_id']) && !empty($data['user_id']) && !empty($data['user_name'])) {\n // Save comment\n $this->postModel->comment($data);\n $post = $this->postModel->getPostById($data['post_id']);\n $receiver = $this->userModel->getUserById($post->user_id);\n if ($receiver->receive_email == true) {\n $this->mail($receiver->email, $receiver->name, $post->id);\n }\n }\n redirect('/posts/show/' . $_POST['post_id']);\n }\n\n }", "private function add_comment()\n\t{\n\t\tif(!$this->owner->logged_in())\n\t\t\treturn new View('public_forum/login');\n\t\t\n\t\tif(empty($_POST['body']))\n\t\t\treturn 'Reply cannot be empty.';\n\t\t\n\t\t$post_id = $this->filter;\n\t\t$new_comment = ORM::Factory('forum_cat_post_comment');\n\t\t$new_comment->forum_cat_post_id = $post_id;\n\t\t$new_comment->owner_id\t= $this->owner->get_user()->id;\n\t\t$new_comment->body\t\t\t= $_POST['body'];\n\t\t$new_comment->save();\n\t\treturn 'Thank you, your comment has been added!';\t\t\n\t}", "function get_instance_comment($cId) \n {\n return $this->instance->get_instance_comment($cId);\n }", "public function comments(): ?string\n {\n return $this->comments;\n }", "public function getCustomerComment() {\r\n\r\n\t\tself::errorReset();\r\n\t\t$this->reload();\r\n\t\treturn $this->customerComment;\r\n\t}", "protected function report_comment_success_message(){\r\n\t\treturn 'The comment has been reported.';\r\n\t}", "function comment_text_rss()\n {\n }", "function rawComment($commentid) {\n\t$commentid = intval($commentid);\n\treturn(dbFirstResult(\"SELECT text FROM comments WHERE id=$commentid\"));\n}", "function get_comment_excerpt($comment_id = 0)\n {\n }", "public function getText()\n {\n return $this->hasText() ? $this->update->message->text : null;\n }", "function do_salmon_as_comment($module,$id,$self_url,$self_title,$title=NULL,$post=NULL,$email='',$poster_name_if_guest='',$forum=NULL,$validated=NULL)\n\t{\n\t\tif (!is_null($post)) $_POST['post'] = $post;\n\t\tif (!is_null($title)) $_POST['title'] = $title;\n\t\t$_POST['email'] = $email;\n\t\t$_POST['poster_name_if_guest'] = $poster_name_if_guest;\n\t\t\n\t\treturn do_comments(true,$module,$id,$self_url,$self_title,$forum,true,$validated,false,true);\n\t}", "public function getCommentId()\n {\n return $this->comment_id;\n }", "public function get_message_text()\n {\n return $this->message_text;\n }" ]
[ "0.81485116", "0.8079281", "0.7789316", "0.7746151", "0.772457", "0.75963295", "0.7573937", "0.75343406", "0.75343406", "0.75343406", "0.75343406", "0.75343406", "0.75343406", "0.7419674", "0.7377234", "0.73674643", "0.7360479", "0.7335973", "0.7329521", "0.728968", "0.72747445", "0.7274306", "0.724996", "0.72379214", "0.7229452", "0.7229452", "0.7229452", "0.7229452", "0.7229452", "0.7229452", "0.7229452", "0.72074586", "0.71908176", "0.7178044", "0.7165247", "0.70983696", "0.7056934", "0.7037335", "0.7009608", "0.6983894", "0.6980275", "0.69729376", "0.69404984", "0.6888121", "0.6852331", "0.6818698", "0.6809175", "0.6779361", "0.6768457", "0.673171", "0.6699327", "0.66817605", "0.6666115", "0.6648395", "0.6541808", "0.6520784", "0.6520158", "0.6499778", "0.64599425", "0.6445127", "0.6436287", "0.6417106", "0.6406229", "0.63983124", "0.6389153", "0.6356521", "0.634492", "0.63266754", "0.63165873", "0.6314796", "0.63027316", "0.6289274", "0.62765783", "0.6270987", "0.6269062", "0.6255115", "0.62512434", "0.62459636", "0.6245106", "0.6244365", "0.62433726", "0.62308013", "0.6224471", "0.6216504", "0.6209644", "0.6208915", "0.6206522", "0.6183738", "0.6174357", "0.617408", "0.6171597", "0.6171349", "0.6168606", "0.6160111", "0.6155311", "0.6151645", "0.61448014", "0.61202633", "0.61174697", "0.6109861", "0.6105341" ]
0.0
-1
Returns the associative array for this Comment
public function toArray() { $a = parent::toArray(); if ($this->text) { $a["text"] = $this->text; } if ($this->created) { $a["created"] = $this->created; } if ($this->contributor) { $a["contributor"] = $this->contributor->toArray(); } return $a; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function toArray()\n\t{\n\t\treturn $this->commentArray;\n\t}", "public function toArray(){\n\t\t$ret = ['comment' => $this->comment];\n\t\treturn $ret;\n\t}", "public function getComment()\n {\n return array();\n }", "public function getComments() {\n\t\treturn $this->arrComments;\n\t}", "private function createCommentAttributes()\n {\n return [\n 'body' => 'Very interesting post!',\n 'post_id' => $this->post->id,\n 'user_id' => $this->user->id,\n ];\n }", "public function comment_sections()\n {\n /*\n if (count($this->comment_sections) > 0) {\n return $this->comment_sections;\n }\n else {\n $this->comment_sections = ($this->attr_raw != '') ? explode(\"\\n\",$this->attr_raw) : array();\n return $this->comment_sections;\n }\n */\n return ($this->attr_raw != '') ? explode(\"\\n\\n\",$this->attr_raw) : array();\n }", "public function prepareCommentsAsArray()\n {\n $comments = $this->comments; //$post has many comments\n \n /*build an array to be transfered as a result*/\n $preparedComments = [];\n foreach ($comments as $comment) {\n $id = $comment->id;\n $preparedComments[$id]['user_id'] = $comment->user_id;\n $preparedComments[$id]['post_id'] = $comment->post_id;\n $preparedComments[$id]['text'] = HtmlPurifier::process($comment->text);\n $preparedComments[$id]['authorname'] = Html::encode($comment->user->username); //comment has one user\n $preparedComments[$id]['authorpicture'] = $comment->user->getPicture();\n $preparedComments[$id]['id'] = $comment->id;\n $preparedComments[$id]['updated_at'] = Yii::$app->formatter->asDatetime($comment->updated_at);\n $preparedComments[$id]['authornickname'] = Html::encode($comment->user->getNickname());\n }\n \n return $preparedComments;\n }", "public function jsonSerialize(): array {\n\t\t$fields = get_object_vars($this);\n\t\t$fields[\"commentId\"] = $this->commentId->toString();\n\t\t$fields[\"commentProfileId\"] = $this->commentProfileId->toString();\n\t\t$fields[\"commentTrailId\"] = $this->commentTrailId->toString();\n\t\t//format the date so that the front end can consume it\n\t\t$fields[\"commentTimestamp\"] = round(floatval($this->commentTimestamp->format(\"U.u\")) * 1000);\n\t\treturn ($fields);\n\t}", "public function getComments()\n {\n return $this->comments;\n }", "public function getComments()\n {\n return $this->comments;\n }", "public function getComments()\n {\n return $this->comments;\n }", "public function getComments()\n {\n return $this->comments;\n }", "public function getComments() {\n \n return $this->comments;\n }", "public function getCommentsData()\n {\n $query = $this->getComments()->orderBy(['tree' => SORT_ASC, 'lft' => SORT_ASC]);\n $dependency = new TagDependency(['tags' => [self::CACHE_TAG_POST_ALL_COMMENTS]]);\n return self::getDb()->cache(static function () use ($query) {\n return $query->all();\n }, self::CACHE_DURATION, $dependency);\n }", "protected function result() {\n\t\t\\Automattic\\Jetpack\\Sync\\Actions::mark_sync_read_only();\n\n\t\t$comment = get_comment( $this->comment_id );\n\t\tif ( empty( $comment ) ) {\n\t\t\treturn new WP_Error( 'comment_not_found', __( 'Comment not found', 'jetpack' ), 404 );\n\t\t}\n\n\t\t$allowed_keys = array(\n\t\t\t'comment_ID',\n\t\t\t'comment_post_ID',\n\t\t\t'comment_author',\n\t\t\t'comment_author_email',\n\t\t\t'comment_author_url',\n\t\t\t'comment_author_IP',\n\t\t\t'comment_date',\n\t\t\t'comment_date_gmt',\n\t\t\t'comment_content',\n\t\t\t'comment_karma',\n\t\t\t'comment_approved',\n\t\t\t'comment_agent',\n\t\t\t'comment_type',\n\t\t\t'comment_parent',\n\t\t\t'user_id',\n\t\t);\n\n\t\t$comment = array_intersect_key( $comment->to_array(), array_flip( $allowed_keys ) );\n\t\t$comment_meta = get_comment_meta( $comment['comment_ID'] );\n\n\t\treturn array(\n\t\t\t'comment' => $comment,\n\t\t\t'meta' => is_array( $comment_meta ) ? $comment_meta : array(),\n\t\t);\n\t}", "public function getComments()\n\t{\n\n\t\treturn $this->comments;\n\t}", "public function getCommentContent()\n {\n return $this->commentContent;\n }", "public function getComments()\n\t\t{\n\t\t\tif ($this->comments === NULL)\n\t\t\t{\n\t\t\t\t$this->comments = new ECash_Application_Comments($this->db, $this->application_id, $this->getCompanyId());\n\t\t\t}\n\n\t\t\treturn $this->comments;\n\t\t}", "public function toArray(): array\n {\n return [\n 'id' => intval($this->id),\n 'title' => strval($this->title),\n 'body' => strval($this->body),\n 'owner' => new UserResource($this->whenLoaded('owner')),\n 'children' => CommentResource::collection($this->whenLoaded('children')),\n 'created_at' => strval($this->created_at),\n 'updated_at' => strval($this->updated_at),\n ];\n }", "public function getCommentTags()\n {\n return $this->data['fields']['comment_tags'];\n }", "public function getCommentaries()\n {\n return $this->_commentaries;\n }", "public function toArray($request)\n {\n return [\n CommentModel::PROP_ID => $this->id,\n CommentModel::TEXT => $this->text,\n CommentModel::PROP_PARENT_ID => $this->parent_id\n ];\n }", "public function getComments() {\n if(!isset($this->comments)) {\n $this->comments = MergeRequestComment::getListByExample(\n new DBExample(array(\n 'mergeRequestId' => $this->id\n )),\n null,\n array(),\n array(\n 'parentId' => DB::SORT_ASC,\n 'ctime' => DB::SORT_ASC\n )\n );\n }\n\n return $this->comments;\n }", "public function toArray()\r\n {\r\n return [\r\n self::DEFAULT_COMMENT => __('Default Comment'),\r\n self::DISQUS => __('Disqus Comment'),\r\n self::FACEBOOK => __('Facebook Comment'),\r\n self::DISABLE => __('Disable Completely')\r\n ];\r\n }", "function getComment($commentID) {\n if ($commentID && $comment = $this->CI->Model('SocialComment')->get($commentID)->result) {\n return array(\n 'data' => $comment,\n 'metadata' => $comment::getMetadata(),\n );\n }\n }", "public static function getAllComment() {\n\t\treturn array(self::_getDao()->count(), self::_getDao()->getAll());\n\t}", "protected function _configs()\n {\n return array(\n \t\t'collectionName' => 'comments_samx',\n \t'documentSchemaArray' => array(\n \t\t'content'\t=>\t'string',\n 'content_uf' => \"string\", //unfiltered content\n 'name' => \"string\", //sort of title for the comment. A substr of fcontent\n 'node' => $this->cSchema,\n \t 'pid' => 'string', //parent comment id \t\n \t\t'u'\t=>\t$this->cSchema, //user who posted this\n \t\t'ts'\t=>\t'int',\n \t\t'attachments' => array(\n \t\t\t\tarray(\n \t\t\t\t\t\t'u' => $this->cSchema,\n \t\t\t\t\t\t'id' => 'string',\n \t\t\t\t\t\t'ext' => 'string',\n \t\t\t\t\t\t'path' => 'string',\n \t\t\t\t\t\t'name' => 'string'\n \t\t\t\t)\n \t\t),\n \t 'counter' => array(\n \t 'vote' => 'int',\n 'spam' => 'int'\n \t ),\n 'status' => 'string', // approved|queued\n 'is_spam' => 'int', // 0 | 1\n \t));\n }", "public function toArray()\n {\n return [\n 'timestamp' => $this->timestamp,\n 'type' => $this->type,\n 'content' => $this->content\n ];\n }", "public function getArray() {\n \treturn array(\n \t\t\t'id' => $this->id,\n \t\t\t'name' => $this->name,\n \t\t\t'path' => $this->path,\n \t\t\t'description' => $this->description,\n \t\t\t'version' => $this->version,\n \t\t\t'groups' => $this->groups,\n \t\t\t'enabled' => $this->enabled\n \t);\n }", "protected function convertCommentToArray(Comment $comment)\n {\n // Retrieve commment flag count.\n $flagCount = Flag::where('CommentID',$comment->CommentID)->count();\n\n // Retrieve all subcomments.\n\n $subcomments = array();\n\n foreach($comment->comments()->get() as $c) {\n $subcomments[] = $this->convertCommentToArray($c);\n }\n\n return array(\n 'comment_id' => $comment->CommentID,\n 'narrative_id' => $comment->NarrativeID,\n 'parent_id' => $comment->CommentParentID,\n 'created_at' => with(new Carbon($comment->DateCreated))->diffForHumans(),\n 'deleted' \t => $comment->Deleted,\n 'name' => e($comment->Name),\n 'agrees' => $comment->Agrees,\n 'disagrees' => $comment->Disagrees,\n 'indifferents' => $comment->Indifferents,\n 'body' => e($comment->Comment),\n 'report_count' => $flagCount,\n 'children' => $subcomments,\n );\n }", "public function getComments() {\n\t\treturn $this->api->getCommentsByPhotoId($this->getId());\n\t}", "public function getArray() {\r\n \r\n $data = [\r\n \"id\" => $this->id,\r\n \"name\" => $this->name,\r\n \"description\" => $this->desc,\r\n \"url_file\" => $this->url_file,\r\n \"filename\" => $this->filename,\r\n \"filepath\" => $this->filepath,\r\n \"filesize\" => $this->filesize,\r\n \"mime\" => $this->mime,\r\n \"active\" => $this->active,\r\n \"approved\" => $this->approved,\r\n \"meta\" => $this->extra_data,\r\n \"date\" => $this->Date,\r\n \"author\" => $this->Author->getArray(),\r\n \"url\" => $this->url->getURLs(),\r\n \"thumbnail\" => $this->getThumbnail(),\r\n \"icon\" => $this->getIcon(),\r\n ];\r\n \r\n return $data;\r\n \r\n }", "public function getComments()\n {\n return $this->api->_request('GET', '/api/comments?id='.$this->ID);\n }", "function getComment() {\n return DataObjectPool::get($this->getAdditionalProperty('comment_type'), $this->getAdditionalProperty('comment_id'));\n }", "public function getArray() {\n return array(\n \"id\" => $this->id, \n \"nombreGrupo\" => $this->nombre, \n //\"idag\" => $this->idap, \n );\n }", "private function getCommentSessionValuesFromForm()\n {\n $comment = [\n 'content' => $this->request->getPost('content'),\n 'name' => $this->request->getPost('name'),\n 'web' => $this->request->getPost('web'),\n 'mail' => $this->request->getPost('mail'),\n 'timestamp' => time(),\n 'ip' => $this->request->getServer('REMOTE_ADDR'),\n 'id' => $this->request->getPost('id'),\n 'gravatar' => 'http://www.gravatar.com/avatar/' . md5(strtolower(trim($this->request->getPost('mail')))) . '.jpg',\n 'pageKey' => $this->request->getPost('pageKey'),\n ];\n return $comment;\n }", "public function toArray() {\n $a = parent::toArray();\n if( $this->description ) {\n $a[\"description\"] = $this->description;\n }\n if( $this->name ) {\n $a[\"name\"] = $this->name;\n }\n if( $this->id ) {\n $a[\"id\"] = $this->id;\n }\n return $a;\n }", "public function toArray() {\n\t\treturn array(\n\t\t\tself::FIELD_ID_CHAT=>$this->getIdChat(),\n\t\t\tself::FIELD_ID_JOUEUR=>$this->getIdJoueur(),\n\t\t\tself::FIELD_PSEUDO=>$this->getPseudo(),\n\t\t\tself::FIELD_QUAND=>$this->getQuand(),\n\t\t\tself::FIELD_MESSAGE=>$this->getMessage());\n\t}", "public function toArray() {\n return [\n 'content' => $this->content,\n 'status' => $this->status\n ];\n }", "public function getAllComments() {\r\n \r\n $commentEntries = array();\r\n\r\n $sql = \"SELECT *\r\n FROM RecipeComments\r\n WHERE page = '$this->page'\r\n ORDER BY timestamp\"; \r\n \r\n $result = $this->conn->query($sql);\r\n \r\n $rows = $result->num_rows;\r\n \r\n for($i=1; $i<=$rows; $i++) {\r\n $row = $result->fetch_assoc();\r\n array_push($commentEntries, $row[\"username\"]);\r\n array_push($commentEntries, $row[\"comment\"]);\r\n array_push($commentEntries, $row[\"timestamp\"]);\r\n \r\n }\r\n\r\n return $commentEntries;\r\n \r\n }", "public function getComments(): Collection\n {\n return $this->comments;\n }", "public function comments()\n {\n // check if user is already loaded, if not, we fetch it from database\n if ($this->_comments) {\n return $this->_comments;\n } else {\n $comments = new Application_Model_DbTable_Comments();\n\n foreach ($comments->findAllBy('post_id', $this->_id) as $comment) {\n $this->_comments[] = $comment ;\n }\n return $this->_comments;\n }\n }", "public function getComments()\n {\n return $this->tpComments;\n }", "public function jsonSerialize()\n {\n return [\n 'id' => $this->getId(),\n 'done' => $this->getDone(),\n 'title' => $this->getTitle(),\n 'author' => $this->getAuthor()->getId(),\n ];\n }", "public function getAllComment()\n {\n return Comment::find()->with('user')->orderBy(['created_date'=>SORT_DESC])->all();\n \n }", "public function toJsonArray()\n {\n return array(\n 'id' => $this->getId(),\n 'date_created' => $this->getDateCreated()->getTimestamp(),\n 'content' => $this->getContent(),\n );\n }", "public function toArray()\n {\n return array(\n 'id' => $this->id,\n 'name' => $this->name,\n 'email' => $this->email,\n 'twitterHandler' => $this->twitterHandler\n );\n }", "public function toArray() {\n\t\treturn array(\n\t\t\t'tagName' => $this->_tagName,\n\t\t\t'description' => esc_html($this->_description),\n\t\t\t'enclosed' => $this->_enclosed,\n\t\t\t'attributes' => $this->_attributes,\n\t\t\t'attributes_keys' => array_keys($this->_attributes),\n\t\t\t'schema' => $this->__schema\n\t\t);\n\t}", "public function toArray()\r\n {\r\n \treturn array(\r\n \t\t'guid'\t=> $this->guid,\r\n \t\t'pollGuid'\t=> $this->pollGuid,\r\n \t\t'text' => $this->text,\r\n \t\t'hits' => $this->hits\r\n \t);\r\n }", "public function getComments() {}", "public function getAllTheComments(){\n\t\t try{\n\t\t\t $conn=DBConnection::GetConnection();\n\t\t\t $myquery=\"SELECT comment_id,comment_description,comment_date,news_id,user_name FROM comment\";\n\t\t\t $result= $conn->query($myquery);\n\t\t\t $comments=array();\n\t\t\t foreach($result as $comment){\n\t\t\t\t$c1=new Comment();\n\t\t\t\t$c1->setCommentId($comment[\"comment_id\"]);\n\t\t\t\t$c1->setCommentDescription($comment[\"comment_description\"]);\n\t\t\t\t$c1->setCommentDate($comment[\"comment_date\"]);\n\t\t\t\t$c1->setNewsId($comment[\"news_id\"]);\n\t\t\t\t$c1->setUserName($comment[\"user_name\"]);\n\t\t\t\tarray_push($comments,$c1);\t\t\t\t\n\t\t\t }\n\t\t\t$conn =null;\n\t\t\treturn $comments;\n\t\t }catch(PDOException $p){\n\t\t\t echo 'Fail to connect';\n\t\t\t echo $p->getMessage();\n\t\t }\n\t }", "public function transform(Comment $comment): array\n {\n return [\n 'id' => (int) $comment->id,\n 'title' => (string) $comment->title,\n 'content' => (string) $comment->content,\n 'time_ago' => time_ago($comment->created_at)\n ];\n }", "public function getUserComments(): array {\n $query = \"SELECT * \n FROM Comments \n WHERE toUserID = :userID OR fromUserID = :userID\";\n \n $stmt = $this->_db->prepare ( $query );\n $stmt->bindValue ( ':userID', $this->_userID );\n $stmt->execute ();\n $objects = [];\n while ( $row = $stmt->fetch ( PDO::FETCH_ASSOC ) ) {\n $comment = new Comment ( $this->_db );\n $comment->commentID = $row ['commentID'];\n $comment->get();\n $objects [] = $comment;\n }\n \n return $objects;\n }", "public function data()\n\t{\n\t\t// the start of a new topic, so assign the topic_id to itself\n\t\t// and assign the topic accordingly\n\t\t\n\t\t//$type = $this->topic ? GalaxyAPIConstants::kTypeForumMessage : GalaxyAPIConstants::kTypeForumTopic;\n\t\t$topic = $this->topic ? $this->topic : $this->id;\n\t\t\n\t\treturn array('_id' => $this->id,\n\t\t\t 'title' => $this->title,\n\t\t 'body' => $this->body,\n\t\t 'author' => $this->author,\n\t\t 'source' => $this->context->source(),\n\t\t 'topic' => $topic,\n\t\t 'topic_origin' => $this->topic_origin,\n\t\t 'created' => $this->created,\n\t\t 'type' => GalaxyAPIConstants::kTypeForumMessage);\n\t}", "public function getComments() : Collection\n {\n return $this->comments;\n }", "public function jsonSerialize()\n {\n return [\n 'id' => $this->id,\n 'title' => $this->title,\n 'content' => $this->content,\n 'image' => $this->image,\n 'legend' => $this->legend,\n 'creationDate' => $this->creationDate\n ];\n }", "public static function getMap()\n\t{\n\t\treturn [\n\t\t\tnew IntegerField(\n\t\t\t\t'ID',\n\t\t\t\t[\n\t\t\t\t\t'primary' => true,\n\t\t\t\t\t'autocomplete' => true,\n\t\t\t\t\t'title' => Loc::getMessage('MONITOR_COMMENT_ENTITY_ID_FIELD')\n\t\t\t\t]\n\t\t\t),\n\t\t\tnew IntegerField(\n\t\t\t\t'USER_LOG_ID',\n\t\t\t\t[\n\t\t\t\t\t'required' => true,\n\t\t\t\t\t'title' => Loc::getMessage('MONITOR_COMMENT_ENTITY_USER_LOG_ID_FIELD')\n\t\t\t\t]\n\t\t\t),\n\t\t\tnew IntegerField(\n\t\t\t\t'USER_ID',\n\t\t\t\t[\n\t\t\t\t\t'required' => true,\n\t\t\t\t\t'title' => Loc::getMessage('MONITOR_COMMENT_ENTITY_USER_ID_FIELD')\n\t\t\t\t]\n\t\t\t),\n\t\t\tnew TextField(\n\t\t\t\t'COMMENT',\n\t\t\t\t[\n\t\t\t\t\t'title' => Loc::getMessage('MONITOR_COMMENT_ENTITY_COMMENT_FIELD')\n\t\t\t\t]\n\t\t\t),\n\t\t];\n\t}", "public function toArray()\n {\n return [\n 'id' => $this->getId(),\n 'userId' => $this->getUserId(),\n 'hash' => $this->getHash()\n ];\n }", "public function getComments()\n {\n return $this->hasMany(Comment::class, ['created_by' => 'id']);\n }", "function view_comments($album_id){\n $album_id = (int)$album_id;\n $comments = array();\n $query = mysql_query(\"SELECT * FROM comments WHERE album_id = $album_id\");\n\n while($comment_row = mysql_fetch_assoc($query)){\n $comments[] = array(\n 'id' => $comment_row['comment_id'],\n 'user_id' => $comment_row['user_id'],\n 'comment' => $comment_row['comment'],\n 'timestamp' => $comment_row['timestamp']\n );\n }\n return $comments;\n }", "public function toArray()\n {\n return $this->content;\n }", "public function toArray()\n {\n return [\n 'config' => $this->config,\n 'type' => $this->type,\n ];\n }", "public function jsonSerialize()\n {\n return [\n 'id' => $this->getId(),\n 'textNotification' => $this->getTextNotification(),\n 'createdAt' => $this->getCreatedAt()\n ];\n }", "public function get($commentFk):array {\n return ObjectManager::get(\"SELECT * FROM ellia_sub_comment WHERE topic_fk = '$commentFk'\", SubComment::class);\n }", "public function toArray(): array\n {\n return [\n 'contentId' => $this->getContentId(),\n 'versionNo' => $this->getVersionNo(),\n 'locationId' => $this->getLocationId(),\n 'contentTypeIdentifier' => $this->getContentTypeIdentifier(),\n 'languageCode' => $this->getLanguageCode(),\n 'siteaccess' => $this->getSiteaccess(),\n ];\n }", "public function toArray(){\n $result = [];\n $result['id'] = $this->getId();\n $result['description'] = $this->getDescripcion();\n return $result;\n }", "public function toArray()\n {\n $array = [];\n if (! empty($this->data)) {\n $array['data'] = $this->data->toIdentifier();\n }\n if (! empty($this->meta)) {\n $array['meta'] = $this->meta;\n }\n if (! empty($this->links)) {\n $array['links'] = $this->links;\n }\n\n return $array;\n }", "public function toArray() {\n return array(\n '_id' => $this->_id,\n '_v' => $this->_v,\n 'url' => $this->url,\n 'hybridGraph' => $this->hybridGraph->toArray(),\n 'openGraph' => $this->openGraph->toArray(),\n 'htmlInferred' => $this->htmlInferred->toArray(),\n 'requestInfo' => $this->requestInfo->toArray(),\n 'accessed' => $this->accessed,\n 'updated' => $this->updated,\n 'created' => $this->created,\n 'version' => $this->version\n );\n }", "public function toArray() {\n\t\t$ret = array(\n\t\t\t\"contactDetails\" => array(\n\t\t\t\t\"contactName\" => Client::clean($this->name),\n\t\t\t\t\"telephone\" => Client::clean($this->phoneNumber),\n\t\t\t),\n\t\t\t\"address\" => $this->address->toArray(),\n\t\t);\n\t\tif ($this->emailAddress || $this->mobileNumber) {\n\t\t\t$ret['notificationDetails'] = array();\n\t\t}\n\t\tif ($this->emailAddress) {\n\t\t\t$ret['notificationDetails']['email'] = Client::clean($this->emailAddress);\n\t\t}\n\t\tif ($this->mobileNumber) {\n\t\t\t$ret['notificationDetails']['mobile'] = Client::clean($this->mobileNumber);\n\t\t}\n\t\treturn $ret;\n\t}", "public function findAll() {\n $sql = \"select * from t_comment order by com_id desc\";\n $result = $this->getDb()->fetchAll($sql);\n\n // Convert query result to an array of domain objects\n $comments = array();\n foreach ($result as $row) {\n $id = $row['com_id'];\n $comments[$id] = $this->buildDomainObject($row);\n }\n return $comments;\n }", "public function jsonSerialize()\n {\n return [\n 'id'=> $this->getId(),\n 'title'=> $this->getTitle(),\n 'image'=> $this->getImage(),\n 'content'=> $this->getContent(),\n 'date_added'=> $this->getDateAdded(),\n 'id_user'=> $this->getIdUser(),\n 'user'=> $this->user->getName(),\n ];\n }", "public function toArray()\n {\n return [\n 'message' => '<span class=\"text-gray-800 font-medium\">'.$this->reply->owner->full_name.'</span> vous a mentionné dans le sujet <span class=\"text-gray-800 font-medium\">'. $this->reply->thread->title.'</span>',\n 'link' => $this->reply->path(),\n 'user_profile' => $this->reply->owner->username,\n 'user_photo' => $this->reply->owner->picture,\n 'action' => 'mention'\n ];\n }", "public function transform(Comment $comment)\n {\n return $comment->toArray();\n }", "public function toArray()\n {\n return $this->info;\n }", "public function get_comments()\n {\n }", "public function toArray()\n\t{\n\t\treturn array(\n\t\t\t'name' => $this->name,\n\t\t\t'title' => $this->title,\n\t\t\t'hasPermission' => $this->hasPermission,\n\t\t\t'messages' => $this->messages,\n\t\t\t'confirmation' => $this->confirmation,\n\t\t);\n\t}", "public function getComment()\n {\n return $this->_comment;\n }", "public function toArray()\n {\n return array(\n 'id' => $this->id,\n 'description' => $this->description,\n 'involvementKindID' => $this->involvementKindID,\n 'reportKindID' => $this->reportKindID,\n 'locationID' => $this->locationID,\n 'personID' => $this->personID,\n 'departmentID' => $this->departmentID,\n 'dateTime' => $this->dateTime,\n 'statusID' => $this->statusID,\n 'actionTaken' => $this->actionTaken,\n 'photoPath' => $this->photoPath\n );\n }", "function asArray()\n {\n $poco = array();\n\n $poco['preferredUsername'] = $this->preferredUsername;\n $poco['displayName'] = $this->displayName;\n\n if (!empty($this->note)) {\n $poco['note'] = $this->note;\n }\n\n if (!empty($this->address)) {\n $poco['addresses'] = $this->address->asArray();\n }\n\n if (!empty($this->urls)) {\n\n $urls = array();\n\n foreach ($this->urls as $url) {\n $urls[] = $url->asArray();\n }\n\n $poco['urls'] = $urls;\n }\n\n return $poco;\n }", "public function toAssociativeArray() {\n // TODO\n }", "public function toAssociativeArray() {\n // TODO\n }", "public function getComments() \n {\n return $this->hasMany(Comment::className(), [\n 'post_id' => 'id',\n ]);\n }", "public function getAsArray() {\n return array(\"id\" => $this->id, \"name\" => $this->name, \"park\" => get_object_vars($this->park), \"code\" => $this->code);\n }", "public function getAllComments()\n\t{\n\t\t$req=$this->_bdd->query('SELECT Comments.id, content_com AS content, DATE_FORMAT(date_com, \"%d/%m/%Y %Hh%imin%ss\") AS date, id_users, id_post, moderate, login FROM Comments INNER JOIN Users ON id_users=Users.id WHERE moderate >0 ORDER BY moderate DESC');\n\t\t\n\t\t$comments=[];\n\t\twhile($datas=$req->fetch(PDO::FETCH_ASSOC))\n\t\t{\n\t\t\t\n\t\t\t\t $comments[]=new Comments($datas);\n\t\t\t\t //return $comments;\n\t\t\t\n\t\t\t\n\t\t}\n\t\treturn $comments;\n\t}", "public function getClid() : array\n {\n\n return [ $this->parsed['class'], $this->parsed['id'] ];\n }", "public function jsonSerialize() : array {\n\t\t\t\treturn [\n\t\t\t\t\t'id' => $this->getId(),\n\t\t\t\t\t'cep' => $this->getCep(),\n\t\t\t\t\t'bairro' => $this->getBairro(),\n\t\t\t\t\t'cidade' => $this->getCidade(),\n\t\t\t\t\t'rua' => $this->getRua(),\n\t\t\t\t\t'estado' => $this->getEstado(),\n\t\t\t\t];\n\t\t\t}", "public function comments()\n {\n return new Comments($this->getClient());\n }", "public function toArray(): array\n {\n return array(\n 'id' => $this->ID,\n 'public_id' => $this->PublicID,\n 'request_time' => $this->RequestTime\n );\n }", "public function getAllComments(){\n $comments = $this->db->query('SELECT * FROM comments');\n return $comments;\n }", "public function getArrayCopy() {\r\n return array(\r\n 'id' => $this->_id,\r\n 'artist' => $this->_artist,\r\n 'title' => $this->_title);\r\n }", "public function comments(){\n\t\t// Comment, 'foreign_key', 'local_key'\n\t\treturn $this->hasMany(Comment::class, 'post_id', 'id');\n\t}", "public function toArray()\n {\n return [\n 'description' => $this->description,\n 'type' => $this->required ? Type::nonNull($this->type) : $this->type,\n 'defaultValue' => $this->defaultValue\n ];\n }", "public function getData()\n {\n return [\n 'fetchBlock' => $this->fetchBlock,\n 'generateKey' => $this->generateKey,\n 'hits' => $this->hits,\n 'strategyClass' => $this->strategyClass,\n ];\n }", "public function comments()\n\t{\n\t\treturn $this->has_many('comment');\n\t}", "function get_content() {\n\t\treturn $this->get_data( 'comment_content' );\n\t}", "public function getArray() {\n return array(\n \"id\" => $this->id, \n \"nombreDepartamento\" => $this->nombre, \n //\"idap\" => $this->idap, \n );\n }", "public static function hookData() {\r\n return array_merge_recursive( array (\r\n 'contentComment' => \r\n array (\r\n 0 => \r\n array (\r\n 'selector' => 'li.ipsDataItem > div.ipsDataItem_main > div.ipsType_break.ipsContained > h4.ipsType_sectionHead.ipsContained > a.ipsType_blendLinks > span.cSearchResultHighlight',\r\n 'type' => 'add_before',\r\n 'content' => '{{if $comment->item()->prefix()}}\r\n\t{{$prefix = \\IPS\\Application::load(\"advancedtagsprefixes\")->getPrefixByTitle( $comment->item()->prefix() );}}\r\n\t{{if $prefix instanceof \\IPS\\advancedtagsprefixes\\Prefix and $prefix->id}}\r\n\t\t{$prefix->pre|raw}\r\n\t\t{{if $prefix->showtitle}}\r\n\t\t\t{$comment->item()->prefix()}\r\n\t\t{{endif}}\r\n\t\t{$prefix->post|raw}\r\n\t{{endif}}\r\n{{endif}}',\r\n ),\r\n ),\r\n), parent::hookData() );\r\n}", "public function comments()\n {\n $sort = Sorter::getCommentSortId();\n $orderField = $sort == 1 ? 'rate' : 'id';\n $orderDir = $sort == 1 ? 'desc' : 'asc';\n return $this->morphMany(Comment::class, 'commentable')->orderBy($orderField, $orderDir);\n }", "public function toArray()\n {\n return array(\n 'name' => $this->getName(),\n 'phone' => $this->getPhone(),\n 'address' => $this->getAddress() ? $this->getAddress()->toArray() : null\n );\n }", "public function toArray()\n {\n \n return $this->getConfig();\n }" ]
[ "0.81148976", "0.790437", "0.7384908", "0.7126048", "0.70945626", "0.6872952", "0.67979026", "0.6701596", "0.6632917", "0.6632917", "0.6632917", "0.6632917", "0.65782917", "0.6538239", "0.6510632", "0.6496325", "0.64057267", "0.6382843", "0.6349658", "0.63181543", "0.6279311", "0.62777585", "0.6252792", "0.62459964", "0.62440413", "0.6213316", "0.62084", "0.6184011", "0.61838305", "0.617975", "0.6166197", "0.61602324", "0.6152855", "0.6120373", "0.61201775", "0.6113877", "0.6067196", "0.6040572", "0.60405564", "0.6032921", "0.6028842", "0.6023764", "0.60025144", "0.5995746", "0.5991045", "0.59893906", "0.59879065", "0.5987876", "0.5984662", "0.5965222", "0.5941023", "0.59363663", "0.5931934", "0.5927111", "0.59240615", "0.59207207", "0.5918344", "0.59161395", "0.5915062", "0.5899451", "0.5894987", "0.58948004", "0.5887804", "0.58767027", "0.5863312", "0.58621836", "0.58509517", "0.5850857", "0.5845822", "0.58452255", "0.5844484", "0.58352166", "0.5833669", "0.5831129", "0.5830127", "0.58202463", "0.58158505", "0.5805462", "0.5799557", "0.5796998", "0.5796998", "0.57959735", "0.57946146", "0.578942", "0.5786186", "0.57800424", "0.5777499", "0.5776651", "0.57738304", "0.57706857", "0.5769567", "0.57661504", "0.5762693", "0.5758659", "0.5754237", "0.5754162", "0.5750795", "0.57499546", "0.57435614", "0.57414126" ]
0.5818949
76
Initializes this Comment from an associative array
public function initFromArray(array $o) { if (isset($o['text'])) { $this->text = $o["text"]; unset($o['text']); } if (isset($o['created'])) { $this->created = $o["created"]; unset($o['created']); } if (isset($o['contributor'])) { $this->contributor = $o['contributor'] instanceof ResourceReference ? $o["contributor"] : new ResourceReference($o["contributor"]); unset($o['contributor']); } parent::initFromArray($o); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function fromArray(array $array){\n if(array_key_exists($this->idField, $array)){//verifica se possui id se sim seta o id;\n $this->{$this->idField} = $array[$this->idField];\n }\n $this->content = $array;\n }", "public function __construct($array)\n {\n if ($array !== null) {\n foreach ($array as $key => $value) {\n $this->$key = $value;\n }\n }\n }", "public function __construct($arr)\n {\n $this->emailContent = $arr;\n }", "public function init_from_array($array)\n { \n foreach($array as $key => $val)\n { \n $this->set($key,$val);\n }\n }", "public function __construct()\n {\n $this->commentaire=new ArrayCollection();\n }", "public function __construct($array)\n {\n foreach ($array as $elem) {\n $this->insert($elem);\n }\n }", "public function setFromArray($array){\n\t\tif(isset($array['nome_artista'])) $this->nome_artista = $array['nome_artista'];\n\t\tif(isset($array['foto'])) $this->foto = $array['foto'];\n\t\tif(isset($array['autore'])) $this->autore = $array['autore'];\n\t\tif(isset($array['genere'])) $this->genere = $array['genere'];\n\t\tif(isset($array['data'])) $this->data = $array['data'];\n\t\tif(isset($array['stato'])) $this->stato = $array['stato'];\n\t\tif(isset($array['stato_pubblicazione'])) $this->stato_pubblicazione = $array['stato_pubblicazione'];\n\t\tif(isset($array['id'])) $this->id = $array['id'];\n\t\tif(isset($array['id_artista'])) $this->id_artista = $array['id_artista'];\n\t\tif(isset($array['descrizione'])) $this->descrizione = $array['descrizione'];\n\t\t\n\t}", "public function fromArray($array)\n {\n if (isset($array['rev'])) {\n $this->setRev($array['rev']);\n }\n if (isset($array['cover'])) {\n $this->setCover($array['cover']);\n }\n if (isset($array['wiki_id'])) {\n $this->setWikiId($array['wiki_id']);\n }\n if (isset($array['title'])) {\n $this->setTitle($array['title']);\n }\n if (isset($array['html_cache'])) {\n $this->setHtmlCache($array['html_cache']);\n }\n if (isset($array['content'])) {\n $this->setContent($array['content']);\n }\n if (isset($array['tags'])) {\n $this->setTags($array['tags']);\n }\n if (isset($array['comment_tags'])) {\n $this->setCommentTags($array['comment_tags']);\n }\n if (isset($array['model'])) {\n $this->setModel($array['model']);\n }\n if (isset($array['has_video'])) {\n $this->setHasVideo($array['has_video']);\n }\n if (isset($array['like_num'])) {\n $this->setLikeNum($array['like_num']);\n }\n if (isset($array['dislike_num'])) {\n $this->setDislikeNum($array['dislike_num']);\n }\n if (isset($array['watched_num'])) {\n $this->setWatchedNum($array['watched_num']);\n }\n if (isset($array['admin_id'])) {\n $this->setAdminId($array['admin_id']);\n }\n if (isset($array['do_date'])) {\n $this->setDoDate($array['do_date']);\n }\n if (isset($array['source'])) {\n $this->setSource($array['source']);\n }\n if (isset($array['tvsou_id'])) {\n $this->setTvsouId($array['tvsou_id']);\n }\n if (isset($array['first_letter'])) {\n $this->setFirstLetter($array['first_letter']);\n }\n if (isset($array['douban_id'])) {\n $this->setDoubanId($array['douban_id']);\n }\n if (isset($array['verify'])) {\n $this->setVerify($array['verify']);\n }\n if (isset($array['created_at'])) {\n $this->setCreatedAt($array['created_at']);\n }\n if (isset($array['updated_at'])) {\n $this->setUpdatedAt($array['updated_at']);\n }\n\n }", "public function fromArray(array $array)\n {\n $this->uid = $array['uid'];\n $this->title = $array['title'];\n $this->description = $array['description'];\n $this->itemTableName = $array['table_name'];\n }", "public function __construct($comment)\n {\n }", "public function init()\n\t{\n\t\tparent::init();\n\t\t$this->_commentMapper = new Application_Model_CommentMapper();\n\t}", "public function __construct($comment)\n {\n $this->comment = $comment;\n }", "public function fromArray($array)\n {\n if (isset($array['channel_code'])) {\n $this->setChannelCode($array['channel_code']);\n }\n if (isset($array['time'])) {\n $this->setTime($array['time']);\n }\n\n }", "protected function _construct()\n {\n $this->_init('inchoo_supportticket/ticket_comment', 'ticket_comment_id');\n }", "function __construct(array $data)\n {\n if (isset($data)) {\n $this->id = $data['id'];\n $this->title = $data['title'];\n $this->shortDescription = $data['short_description'];\n $this->content = $data['content'];\n $this->imagePath = $data['image_path'];\n $this->visible = $data['visible'];\n }\n }", "function __construct() {\n parent::__construct();\n\n $array = JRequest::getVar('cid', 0, '', 'array');\n $this->setId((string) $array[0]);\n }", "public function initAnswerComments()\n\t{\n\t\t$this->collAnswerComments = array();\n\t}", "function __construct( $comment ) {\n\n\t\t$this->id = $comment->comment_ID;\n\t\t$this->comment = $comment;\n\n\t\t$this->report_type = get_comment_meta( $this->id, APP_REPORTS_C_RECIPIENT_TYPE_KEY, true );\n\t\t$this->recipient_id = get_comment_meta( $this->id, APP_REPORTS_C_RECIPIENT_KEY, true );\n\n\t\t$meta = get_comment_meta( $this->id, APP_REPORTS_C_DATA_KEY, true );\n\t\t$this->meta = wp_parse_args( $meta, $this->meta );\n\t}", "public function __construct(array $arr)\n {\n $this->data = $arr;\n }", "public function fromArray(array $array)\n\t{\n\t\treturn $this\n ->setAvatarclientmessageId($array['avatarclientmessage_id'])\n ->setCreatedTimestamp($array['created'])\n ->setAvatarId($array['avatar_id'])\n ->setKey($array['key'])\n ->setData($array['data']);\n\t}", "public function initQuestionComments()\n\t{\n\t\t$this->collQuestionComments = array();\n\t}", "function __construct() {\r\n parent::__construct();\r\n\r\n $array = JRequest::getVar('cid', 0, '', 'array');\r\n $this->setId((int) $array[0]);\r\n }", "public function __construct(array $config)\n\t{\n\t\tforeach ( $config AS $key => $value )\n\t\t{\n $this->$key = $value;\n\t\t}\n\t}", "public function _construct()\n {\n $this->_init('productcomment/productcomment', 'productcomment_id');\n }", "public function fromArray($array) {\n \n foreach ( $array as $key => $value ) {\n \n $this->$key = $value; \n }\n \n //return $this;\n }", "public final function initFromArray( array $data )\n {\n\n $this->Instructions = isset( $data[ 'Instructions' ] )\n ? $data[ 'Instructions' ]\n : ( isset( $data[ 'Special Instructions' ] )\n ? $data[ 'Special Instructions' ]\n : null\n );\n\n $this->TransmissionReference = isset( $data[ 'Transmission Reference' ] )\n ? $data[ 'Transmission Reference' ]\n : ( isset( $data[ 'Original Transmission Reference' ] )\n ? $data[ 'Original Transmission Reference' ]\n : null\n );\n\n $this->Credit = isset( $data[ 'Credit' ] ) ? $data[ 'Credit' ] : null;\n $this->Source = isset( $data[ 'Source' ] ) ? $data[ 'Source' ] : null;\n\n }", "function __construct()\r\n {\r\n parent::__construct();\r\n\r\n $array = JRequest::getVar('cid', 0, '', 'array');\r\n $this->setId((int)$array[0]);\r\n }", "public function __construct(array $data){\n $this->id = $data['a_id'];\n $this->date = $data['a_date'];\n $this->titre = $data['a_titre'];\n $this->description = $data['a_description'];\n $this->contenu = $data['a_texte'];\n $this->lien = $data['a_lien'];\n $this->validation = $data['a_validation'];\n $this->idAuteur = $data['a_user_fk'];\n $this->idCategorie = $data['a_categorie_fk'];\n }", "function __construct($comment_text='', $filename='')\n {\n $this->attr_raw = $comment_text;\n $this->attr_filename = $filename;\n }", "public function __construct(Comment $comment)\n {\n $this->comment = $comment;\n }", "public function __construct(Comment $comment)\n {\n $this->comment = $comment;\n }", "public function __construct(Comment $comment)\n {\n $this->comment = $comment;\n }", "public function __construct(Comment $comment, $data)\n {\n //\n $this->comment = $comment;\n $this->data = $data;\n }", "public function fromArray(array $data)\n {\n\n $this->event_id = $data['event_id'] ?? null;\n $this->marketing_id = $data['marketing_id'] ?? null;\n $this->value = $data['value'] ?? null;\n\n }", "function __construct()\n {\n parent::__construct();\n\n $array = JRequest::getVar('cid', array(0), '', 'array');\n $this->setId($array[0]);\n }", "public function __construct($confArray) {\n $this->confArray = $confArray;\n }", "public function __construct($array)\n {\n $array = (object)$array;\n $this->credentials = $array;\n }", "function __construct()\n\t{\n\t\tparent::__construct();\n\t\t$array = JRequest::getVar('cid', 0, '', 'array');\n\t\t$this->setId((int)$array[0]);\n\t}", "public function __construct(array $array = [])\n {\n $this->fillFromArray($array);\n }", "public function __construct($configVar_arr =array())\n {\n if(!empty($configVar_arr)) {\n foreach ($configVar_arr as $key => $value) {\n $this->config_arr[$key] = $value;\n }\n }\n\n }", "function __construct(array $data)\n\t{\n if (isset($data)) {\n $this->id = $data['id'];\n $this->name = $data['name'];\n $this->description = $data['description'];\n }\n\t}", "public function __construct(array $data = array()) {\n foreach ($data as $key => $value) {\n $this->$key = $value;\n }\n }", "public function __construct(array $data = array()) {\n foreach ($data as $key => $value) {\n $this->$key = $value;\n }\n }", "public function __construct(array $data = array()) {\n foreach ($data as $key => $value) {\n $this->$key = $value;\n }\n }", "public function __construct($array)\n\t{\n\t\tif (is_array($array))\n\t\t{\n\t\t $this->var = $array;\n\t\t}//end if\n\t}", "public function __construct($data = array()) {\n \n if(!is_array($data)){\n return;\n }\n \n foreach ($data as $key => $value) {\n $key = $this->_getKey($key);\n if(!$key) {\n continue;\n }\n \n $this->$key = $value;\n }\n }", "public function setComments(array $comments)\n {\n $this->comments = $comments;\n return $this;\n }", "public function __construct(Array $data)\n {\n //\n $this->_data = $data;\n }", "public function __construct(array $array)\n {\n parent::hydrate($array);\n }", "public function __construct( $data = array() )\n {\n if( isset( $data['id'] ))\n $this->id = $data['id'];\n if( isset( $data['publicationDate'] ))\n $this->publicationDate = $data['publicationDate'];\n if( isset( $data['username'] ))\n $this->username = preg_replace ( \"/[^\\.\\,\\-\\_\\'\\\"\\@\\?\\!\\:\\$ a-zA-Z0-9()]/\", \"\", $data['username'] );\n if( isset( $data['commentString'] ))\n $this->commentString = preg_replace ( \"/[^\\.\\,\\-\\_\\'\\\"\\@\\?\\!\\:\\$ a-zA-Z0-9()]/\", \"\", $data['commentString'] );\n if( isset( $data['articleId'] ))\n $this->articleId = $data['articleId'];\n }", "protected function __construct(array $config = [])\n {\n foreach ($config as $name => $value) {\n if (is_string($name) && $value !== null) {\n $this->{$name} = $value;\n }\n }\n }", "public function __construct(TicketModel $ticket, UserModel $sender, array $comment)\n {\n $this->ticket = $ticket;\n $this->sender = $sender;\n $this->comment = $comment;\n }", "public function initFromArray($o) {\n parent::initFromArray($o);\n if( isset($o['description']) ) {\n $this->description = $o[\"description\"];\n }\n if( isset($o['name']) ) {\n $this->name = $o[\"name\"];\n }\n if( isset($o['id']) ) {\n $this->id = $o[\"id\"];\n }\n }", "public function __construct($dbRow) {\n $this->_commentID = $dbRow['commentID'];\n $this->_comment = $dbRow['comment'];\n $this->_iSBNNo = $dbRow['iSBNNo'];\n $this->_customerID = $dbRow['customerID'];\n $this->_dateTime = $dbRow['dateTime'];\n }", "public function __construct()\n {\n $this->commentaires = new ArrayCollection();\n $this->photos = new ArrayCollection();\n }", "function __construct(array $data)\n {\n if (isset($data)) {\n $this->id = $data['id'];\n $this->code = $data['code'];\n $this->startDate = $data['start_date'];\n $this->endDate = $data['end_date'];\n $this->discount = $data['discount'];\n }\n }", "public function __construct(array $data) {\n // no id if we're creating\n if(isset($data['id'])) {\n $this->id = $data['id'];\n }\n\n $this->rua = $data['rua'];\n $this->numero = $data['numero'];\n $this->bairro = $data['bairro'];\n $this->cidade = $data['cidade'];\n $this->estado = $data['estado'];\n $this->cep = $data['cep'];\n }", "public function __construct(array $array) {\n $this->data = $array;\n foreach($array as $language => $row) {\n $this->translations[$language] = $row->translation;\n }\n \n $language = $_SESSION[\"lang\"];\n \n if(isset($this->translations[$language])) {\n $this->current = $this->translations[$language];\n } else {\n $this->current = current($this->translations);\n }\n }", "public function __construct(array $post)\n {\n $this->data = $post;\n }", "public function __construct(array $post)\n {\n $this->data = $post;\n }", "public function __construct($ticketComment, $MailsArr, $files, $ticket)\n {\n $this->ticketComment = $ticketComment;\n $this->MailsArr = $MailsArr;\n $this->files = $files;\n $this->ticket = $ticket;\n }", "public function fromArray(array $array)\n {\n if (isset($array['id'])) {\n $this->setId($array['id']);\n }\n if (isset($array['artist'])) {\n $this->setArtist($array['artist']);\n }\n if (isset($array['title'])) {\n $this->setTitle($array['title']);\n }\n\n return $this;\n }", "public function __construct( array $data = array() )\n {\n\n $this->initFromArray( $data );\n\n }", "public function __construct(array $array)\n {\n if (isset($array['approvedDateTime'])) {\n $array['approvedDateTime'] = new Carbon($array['approvedDateTime']);\n }\n\n if (isset($array['createDateTime'])) {\n $array['createDateTime'] = new Carbon($array['createDateTime']);\n }\n\n if (isset($array['endTime'])) {\n $array['endTime'] = new Carbon($array['endTime']);\n }\n\n if (isset($array['lastModifiedDateTime'])) {\n $array['lastModifiedDateTime'] = new Carbon($array['lastModifiedDateTime']);\n }\n\n if (isset($array['requestDate'])) {\n $array['requestDate'] = new Carbon($array['requestDate']);\n }\n\n if (isset($array['startTime'])) {\n $array['startTime'] = new Carbon($array['startTime']);\n }\n\n parent::__construct($array);\n }", "public function __construct($commentId)\n\t{\n\t\t$this->commentId = $commentId;\n\t}", "public function fromArray($data)\n {\n $this->data = $data;\n\n\n }", "public function __construct(array $array)\n {\n parent::__construct($array);\n }", "public function __construct(array $array)\n {\n if (isset($array['expenseDate'])) {\n $array['expenseDate'] = new Carbon($array['expenseDate']);\n }\n\n parent::__construct($array);\n }", "public function __construct(array $config)\n {\n $this->_config = $config;\n }", "public function __construct()\n {\n parent::__construct();\n $this->keyarray = [\n '本文约',\n '文章内容',\n '相关阅读',\n '《》',\n '相干浏览',\n '面击拜访',\n '七君',\n '文去自',\n '参考材料',\n '大家皆是产物司理',\n '扫码',\n 'Reference',\n 'https',\n 'http',\n '本文链接',\n '本文题目',\n '本题目',\n '参考文献',\n '常识星球截图',\n '编纂',\n '滥觞大众号',\n '本文由',\n '大众号',\n '本文本',\n '来源公众号',\n '文章出处',\n '参考链接',\n '本文来自'\n ];\n }", "public function __construct(array $config = [])\n {\n // TODO should we complain if $config is an indexed array?\n $this->data = $config;\n }", "public function __construct(array $data){\t\n\t\t$this->data=$data;\n\t}", "public function __construct(Array $sentInfo)\n {\n $this->sentInfo = $sentInfo;\n }", "public function __construct($arr)\n\t{\n\t\t$this->_object = $arr; \n\t}", "public function __construct(array $data = array())\n {\n $this->setFromArray($data);\n }", "public function __construct() {\n parent::__construct();\n $this->_params = array(\n 'id' => '2',\n 'user_id' => '',\n 'rating_id' => '1',\n 'content' => 'this is comment 2',\n );\n $this->_method = 'POST';\n $this->_uri = 'api/comment/1';\n $this->_models = array('Comment', 'User', 'Login');\n }", "public function __construct(array $params) {\n\t\tif(isset($params['delimiter']))\n\t\t\t$this->delimiter = $params['delimiter'];\n\t\t\t\n\t\tif(isset($params['enclosure']))\n\t\t\t$this->enclosure = $params['enclosure'];\n\t\t\t\n\t\tif(isset($params['escape']))\n\t\t\t$this->escape= $params['escape'];\t\t\n\t}", "public function __construct($array)\n\t{\n\t\tif(count($array) > 0)\n\t\t{\n\t\t\tforeach($array as $k => $v)\n\t\t\t{\n\t\t\t\t$this->{$k} = $v;\n\t\t\t}\n\t\t}\n\n\t\tif(!empty($this->totalrows) && !empty($this->limit))\n\t\t{\n\t\t\t$this->numofpages = $this->totalrows / $this->limit;\n\t\t}\t\n\t}", "public function __construct($user_id, $comment_id, $comment)\n {\n $this->userId = $user_id;\n $this->comment = $comment;\n $this->commentId = $comment_id;\n }", "public function __construct($arr = array())\n\t{\n\t\tparent::__construct($arr);\n\t}", "public function __construct($arr = array())\n\t{\n\t\tparent::__construct($arr);\n\t}", "public function __construct($arr = array())\n\t{\n\t\tparent::__construct($arr);\n\t}", "public function __construct($arr = array())\n\t{\n\t\tparent::__construct($arr);\n\t}", "public function __construct(array $data){\n\t\t$this->data=$data;\n\t}", "public function __construct(array $data)\n {\n if (isset($data['id'])) {\n $this->id = $data['id'];\n }\n $this->firstname = $data['firstname'];\n $this->lastname = $data['lastname'];\n $this->weight = $data['weight'];\n $this->birthday = $data['birthday'];\n $this->sex = $data['sex'];\n }", "public function initWithArray($array)\n {\n $this->array = $array;\n return $this;\n }", "public function __construct($data = Array()){\n\n if(is_object($data)){\n $data = (array) $data;\n }//if\n\n if(count($data)){\n $this->data = array_merge( array_intersect_key($data, array_flip(array_keys($this->definition) ) ) );\n }//if\n\n }", "public function __construct( array $data = [] )\n {\n\n $this->reinitFromArray( $data );\n\n }", "function __construct(array $data)\n\t{\n if (isset($data)) {\n $this->id = $data['id'];\n $this->productid = $data['product_id'];\n $this->pattern = $data['pattern'];\n }\n\t}", "public function __construct(CommentInterface $entry)\n {\n $this->entry = $entry;\n }", "public function __construct($comment, $subscription)\n {\n $this->comment = $comment;\n $this->subscription = $subscription;\n }", "public function __construct()\n {\n $args = func_get_args();\n\n // if an array or object load using fromArray\n if (!empty($args[0]) && (Validate::isAssociativeArray($args[0]) || is_object($args[0]))) {\n $this->fromArray((array)$args[0]);\n }\n }", "public function __construct(array $data)\n {\n //\n $this->data = $data;\n }", "public function __construct(array $data) {\n // no id if we're creating as it comes from the database\n if(isset($data['id'])) {\n $this->id = $data['id'];\n }\n $this->jsonData = $data['jsonData'];\n $this->electionTitle = $data['electionTitle'];\n $this->beginDate = $data['beginDate'];\n $this->endDate = $data['endDate'];\n $this->coefficients = $data['coefficients'];\n $this->appVersion = $data['appVersion'];\n }", "public function __construct(array $data)\n {\n if (isset($data['from'])) {\n $data['attrs']['source_name'] = $data['from'];\n unset($data['from']);\n }\n if (isset($data['to'])) {\n $data['attrs']['extract_name'] = $data['to'];\n unset($data['to']);\n }\n parent::__construct($data);\n }", "function __construct($array = []) {\n $this->array = $array;\n $this->setCalculate();\n }", "function __construct(array $data=null)\n\t\t{\n\t\t\t$this->data = $data;\n\t\t\t\n\t\t\t$this->data['id'] = null;\n\t\t\tif(array_key_exists('url', $this->data))\n\t\t\t{\n\t\t\t\t$uid = str_replace('https://openlibrary.org/authors/', '', $this->data['url']);\n\t\t\t\t$this->data['id'] = substr($uid, 0, strpos($uid, '/'));\n\t\t\t}\n\t\t}", "public function fromArray($arr)\n\t{\n\t\t$arr = array_key_exists('results', $arr) ? $arr['results'] : $arr;\n\t\tforeach($arr as $trackData)\t{\n\t\t\t$this->add(new Track($trackData));\n\t\t}\n\t}", "static function fromArray($array)\n {\n return new self($array[0], $array[1], $array[2], $array[3], rtrim($array[4], PHP_EOL));\n }", "public function __construct(array $data) {\n $this->data = $data;\n }" ]
[ "0.64191735", "0.6079663", "0.6045793", "0.60017407", "0.5901037", "0.58738106", "0.58180106", "0.5809017", "0.58049256", "0.57948434", "0.573899", "0.57179433", "0.57178134", "0.57031876", "0.56859285", "0.5680675", "0.56656575", "0.56536233", "0.5646917", "0.56397885", "0.5614608", "0.5612521", "0.560833", "0.56053996", "0.56032366", "0.558841", "0.5567263", "0.55531555", "0.5551268", "0.5546834", "0.5546834", "0.5546834", "0.5544187", "0.5534585", "0.54996103", "0.5498455", "0.5494938", "0.54928625", "0.54918766", "0.54881394", "0.5474155", "0.5472569", "0.5472569", "0.5472569", "0.54717433", "0.5465622", "0.54379123", "0.5421315", "0.54204994", "0.5419791", "0.5417903", "0.54087234", "0.54035085", "0.5396416", "0.5395923", "0.5394707", "0.5387069", "0.53802955", "0.537628", "0.537628", "0.53488433", "0.5346971", "0.5331992", "0.53243446", "0.53088814", "0.5308008", "0.53049326", "0.53031", "0.53018075", "0.5288007", "0.52822053", "0.5256008", "0.5254306", "0.52446264", "0.5241846", "0.52363205", "0.5235353", "0.5233419", "0.52317154", "0.5231161", "0.5231161", "0.5231161", "0.5231161", "0.52216905", "0.52168787", "0.52167803", "0.5201371", "0.51958674", "0.5193131", "0.5190564", "0.519021", "0.5189101", "0.51886314", "0.5183215", "0.5181747", "0.51815003", "0.5179226", "0.51731044", "0.51700824", "0.5169083" ]
0.52181715
84
Sets a known child element of Comment from an XML reader.
protected function setKnownChildElement(\XMLReader $xml) { $happened = parent::setKnownChildElement($xml); if ($happened) { return true; } else if (($xml->localName == 'text') && ($xml->namespaceURI == 'http://familysearch.org/v1/')) { $child = ''; while ($xml->read() && $xml->hasValue) { $child = $child . $xml->value; } $this->text = $child; $happened = true; } else if (($xml->localName == 'created') && ($xml->namespaceURI == 'http://familysearch.org/v1/')) { $child = ''; while ($xml->read() && $xml->hasValue) { $child = $child . $xml->value; } $this->created = $child; $happened = true; } else if (($xml->localName == 'contributor') && ($xml->namespaceURI == 'http://familysearch.org/v1/')) { $child = new ResourceReference($xml); $this->contributor = $child; $happened = true; } return $happened; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function set_comment($new_comment)\n {\n $this->comment = $new_comment;\n }", "protected static function parseXslComment(DOMElement $ir, DOMElement $node)\n\t{\n\t\t$comment = self::appendElement($ir, 'comment');\n\n\t\t// Parse this branch's content\n\t\tself::parseChildren($comment, $node);\n\t}", "public function setComment($comment);", "public function setComment($comment);", "function setComment($comment)\n {\n $this->comment = $comment;\n }", "function setComment($comment)\n {\n $this->comment = $comment;\n }", "public function setComment(string $comment): void\n {\n $this->description = '';\n $this->tags = [];\n $this->comment = $comment;\n\n $this->parseComment($comment);\n }", "public function setComment(Comment $comment): void;", "public function changeComment($comment)\r\n {\r\n\r\n }", "public function setCommentAttrribute($comment)\n {\n $this->attributes['comment'] = strip_tags($comment);\n }", "protected function parseXslComment(DOMElement $ir, DOMElement $node)\n\t{\n\t\t$comment = $this->appendElement($ir, 'comment');\n\t\t$this->parseChildren($comment, $node);\n\t}", "function set_commentid($new_commentid)\n {\n $this->commentid = $new_commentid;\n }", "public function add_child(\\WP_Comment $child)\n {\n }", "public function setComment($comment)\n {\n $this->values['Comment'] = $comment;\n return $this;\n }", "public function set_comment($comment)\n {\n $this->set_default_property(self::PROPERTY_COMMENT, $comment);\n }", "public function setDocComment(string $newDocComment): void\n {\n $entry = new StringEntry($newDocComment);\n\n // TODO: investigate what to do with string copying\n $this->node->doc_comment = $entry->copy()->getRawValue();\n }", "function &setComment(Comment $comment) {\n $this->setadditionalProperty('comment_type', get_class($comment));\n $this->setadditionalProperty('comment_id', $comment->getId());\n\n return $this;\n }", "public function comment($comment)\n {\n return $this->setProperty('comment', $comment);\n }", "public function setComment($comment)\n {\n $this->_comment = (string) $comment;\n return $this;\n }", "public static function setComment($comment)\n {\n self::$comment = str_replace([\"\\r\", \"\\n\"], '', $comment);\n }", "public function setComment($comment){\n\t\tif(FW_Validate::isValidUrl($comment)){\n\t\t\t$this->_comment = $comment;\n\t\t}\n\t}", "public function readComment($row, $column) {\n\t}", "protected function _prepare_comment($comment)\n {\n }", "public function set_comment($comment) \n\t{\n\t\t$this->comment = $comment;\n\t\treturn $this;\n\t}", "public function setComment($comment) {\n $this->comment = $comment;\n return $this;\n }", "protected function setKnownChildElement(\\XMLReader $xml)\n {\n $happened = parent::setKnownChildElement($xml);\n if ($happened) {\n return true;\n } else {\n if (($xml->localName == 'originalLabel') && ($xml->namespaceURI == 'http://gedcomx.org/v1/')) {\n $child = '';\n while ($xml->read() && $xml->hasValue) {\n $child = $child . $xml->value;\n }\n $this->originalLabel = $child;\n $happened = true;\n } else {\n if (($xml->localName == 'description') && ($xml->namespaceURI == 'http://gedcomx.org/v1/')) {\n $child = new TextValue($xml);\n if (!isset($this->description)) {\n $this->description = array();\n }\n array_push($this->description, $child);\n $happened = true;\n } else {\n if (($xml->localName == 'value') && ($xml->namespaceURI == 'http://gedcomx.org/v1/')) {\n $child = new FieldValueDescriptor($xml);\n if (!isset($this->values)) {\n $this->values = array();\n }\n array_push($this->values, $child);\n $happened = true;\n }\n }\n }\n }\n\n return $happened;\n }", "function SetItemcommentid($value) { $this->itemCommentId=$value; }", "public function setComment($comment)\n {\n $this->comment = $comment;\n return $this;\n }", "public function setComment($comment)\r\n {\r\n $this->comment = $comment;\r\n\r\n return $this;\r\n }", "function set_comment() {\n $this->sale_lib->set_comment($this->input->post('comment'));\n }", "protected function takeChildFromDOM($child)\n {\n $absoluteNodeName = $child->namespaceURI . ':' . $child->localName;\n\n switch ($absoluteNodeName) {\n case $this->lookupNamespace('apps') . ':' . 'login';\n $login = new Zend_Gdata_Gapps_Extension_Login();\n $login->transferFromDOM($child);\n $this->_login = $login;\n break;\n case $this->lookupNamespace('apps') . ':' . 'nickname';\n $nickname = new Zend_Gdata_Gapps_Extension_Nickname();\n $nickname->transferFromDOM($child);\n $this->_nickname = $nickname;\n break;\n default:\n parent::takeChildFromDOM($child);\n break;\n }\n }", "public function setComment($comment) {\n $this->properties['comment'] = $comment;\n\n return $this;\n }", "public function setComment($comment) {\n $this->properties['comment'] = $comment;\n\n return $this;\n }", "private function update_fb_comment($post, $comment, $parent_id = null) {\n $wp_comment_id = $this->get_wp_comment_for_fb($post->ID, $comment->id);\n\n if (!$wp_comment_id) {\n if (preg_match('/((\\d\\d\\d\\d)-(\\d\\d)-(\\d\\d))T((\\d\\d):(\\d\\d):(\\d\\d))/', $comment->created_time, $matches)) {\n $gmdate = \"{$matches[1]} {$matches[5]}\";\n } else {\n $gmdate = gmdate('Y-m-d H:i:s');\n }\n\n $comment_data = array(\n 'comment_post_ID' => $post->ID,\n 'comment_author' => $comment->from->name,\n 'comment_content' => $comment->message,\n 'comment_date' => get_date_from_gmt($gmdate),\n 'comment_date_gmt' => $gmdate,\n 'comment_approved' => '1',\n 'comment_type' => 'facebook',\n 'comment_author_url' => 'http://facebook.com/profile.php?id='.$comment->from->id\n );\n\n if (!is_null($parent_id)) {\n $comment_data['comment_parent'] = $parent_id;\n }\n\n $wp_comment_id = $this->wp_new_comment($comment_data);\n\n if ($wp_comment_id && !is_wp_error($wp_comment_id)) {\n wp_update_comment_count($post->ID);\n update_comment_meta($wp_comment_id, 'fb_comment', $comment);\n update_comment_meta($wp_comment_id, 'fb_comment_id', $comment->id);\n update_comment_meta($wp_comment_id, 'fb_commenter_id', $comment->from->id);\n } else {\n // print_r($wp_comment_id);\n }\n }\n\n if ($comment->comments) {\n foreach($comment->comments->data as $reply) {\n $this->update_fb_comment($post, $reply, $wp_comment_id);\n }\n }\n }", "protected function takeChildFromDOM($child)\n {\n $absoluteNodeName = $child->namespaceURI . ':' . $child->localName;\n\n switch ($absoluteNodeName) {\n case $this->lookupNamespace('apps') . ':' . 'login';\n $login = new Zend_Gdata_Gapps_Extension_Login();\n $login->transferFromDOM($child);\n $this->_login = $login;\n break;\n case $this->lookupNamespace('apps') . ':' . 'name';\n $name = new Zend_Gdata_Gapps_Extension_Name();\n $name->transferFromDOM($child);\n $this->_name = $name;\n break;\n case $this->lookupNamespace('apps') . ':' . 'quota';\n $quota = new Zend_Gdata_Gapps_Extension_Quota();\n $quota->transferFromDOM($child);\n $this->_quota = $quota;\n break;\n case $this->lookupNamespace('gd') . ':' . 'feedLink';\n $feedLink = new Zend_Gdata_Extension_FeedLink();\n $feedLink->transferFromDOM($child);\n $this->_feedLink[] = $feedLink;\n break;\n default:\n parent::takeChildFromDOM($child);\n break;\n }\n }", "protected function takeChildFromDOM($child)\n {\n $absoluteNodeName = $child->namespaceURI . ':' . $child->localName;\n switch ($absoluteNodeName) {\n case $this->lookupNamespace('atom') . ':' . 'generator':\n $generator = new Zend_Gdata_App_Extension_Generator();\n $generator->transferFromDOM($child);\n $this->_generator = $generator;\n break;\n case $this->lookupNamespace('atom') . ':' . 'icon':\n $icon = new Zend_Gdata_App_Extension_Icon();\n $icon->transferFromDOM($child);\n $this->_icon = $icon;\n break;\n case $this->lookupNamespace('atom') . ':' . 'logo':\n $logo = new Zend_Gdata_App_Extension_Logo();\n $logo->transferFromDOM($child);\n $this->_logo = $logo;\n break;\n case $this->lookupNamespace('atom') . ':' . 'subtitle':\n $subtitle = new Zend_Gdata_App_Extension_Subtitle();\n $subtitle->transferFromDOM($child);\n $this->_subtitle = $subtitle;\n break;\n default:\n parent::takeChildFromDOM($child);\n break;\n }\n }", "public function setDocComment(Comment\\Doc $docComment);", "public function comment($comment)\n {\n $this->comments[] = $comment;\n }", "public function setComment($comment)\n {\n $this->comment = $comment;\n\n return $this;\n }", "public function setComment($comment)\n {\n $this->comment = $comment;\n\n return $this;\n }", "public function setComment($comment)\n {\n $this->comment = $comment;\n\n return $this;\n }", "protected function set__comments( $val )\n\t{\n\t\t\n\t}", "public function setComment( $comment ) {\n\t\tif ( !empty( $comment ) ) {\n\t\t\t$this->content = TRUE;\n\t\t\t$this->setParameter( \"description\", $comment );\n\t\t}\n\t}", "public function setChild($child)\n {\n $this->child = $child;\n }", "public function setComment($value)\n {\n return $this->set('Comment', $value);\n }", "public function setComment($value)\n {\n return $this->set('Comment', $value);\n }", "public function testParsingComment()\n {\n $tokens = [\n new Token(TokenTypes::T_COMMENT_OPEN, '{#', 1),\n new Token(TokenTypes::T_EXPRESSION, 'foo', 1),\n new Token(TokenTypes::T_COMMENT_CLOSE, '#}', 1),\n ];\n $commentNode = new CommentNode();\n $commentNode->addChild(new ExpressionNode('foo'));\n $this->ast->getCurrentNode()\n ->addChild($commentNode);\n $this->assertEquals($this->ast, $this->parser->parse($tokens));\n }", "private function readComment($line, $col, \\GraphQL\\Language\\Token $prev)\n {\n }", "public function __construct(Comment $comment)\n {\n $this->comment = $comment;\n }", "public function __construct(Comment $comment)\n {\n $this->comment = $comment;\n }", "public function __construct(Comment $comment)\n {\n $this->comment = $comment;\n }", "public function set($child) {\n\t\t$this->childs = array($child);\n\t}", "protected function parseComment(string $comment): void\n {\n // Strip the opening and closing tags of the docblock\n $comment = \\substr($comment, 3, -2);\n\n // Split into arrays of lines\n $comment = \\preg_split('/\\r?\\n\\r?/', $comment);\n\n // Trim asterisks and whitespace from the beginning and whitespace from the end of lines\n $comment = \\array_map(function ($line) {\n return \\ltrim(\\rtrim($line), \"* \\t\\n\\r\\0\\x0B\");\n }, $comment);\n\n // Group the lines together by @tags\n $blocks = [];\n $b = -1;\n foreach ($comment as $line) {\n if (self::isTagged($line)) {\n $b++;\n $blocks[] = [];\n } elseif ($b == -1) {\n $b = 0;\n $blocks[] = [];\n }\n $blocks[$b][] = $line;\n }\n\n // Parse the blocks\n foreach ($blocks as $block => $body) {\n $body = \\trim(\\implode(\"\\n\", $body));\n\n if ($block == 0 && !self::isTagged($body)) {\n // This is the description block\n $this->description = $body;\n continue;\n } else {\n // This block is tagged\n $tag = (string)\\substr(self::strTag($body), 1);\n $body = \\ltrim((string)\\substr($body, \\strlen($tag) + 2));\n\n if (isset(self::$vectors[$tag])) {\n // The tagged block is a vector\n $count = \\count(self::$vectors[$tag]);\n if ($body) {\n $parts = \\preg_split('/\\s+/', $body, $count);\n } else {\n $parts = [];\n }\n // Default the trailing values\n $parts = \\array_pad($parts, $count, null);\n $mapped = \\array_combine(\n self::$vectors[$tag],\n $parts\n );\n\n if (isset($mapped['var']) && \\substr($mapped['var'], 0, 3) === '...') {\n $mapped['var'] = substr($mapped['var'], 3);\n }\n // Store as a mapped array\n $this->tags[$tag][] = $mapped;\n } else {\n // The tagged block is only text\n $this->tags[$tag][] = $body;\n }\n }\n }\n }", "function setCommentContent (string $newCommentContent) {\n\t\t$newCommentContent = trim($newCommentContent);\n\t\t$newCommentContent = filter_var($newCommentContent,FILTER_SANITIZE_STRING, FILTER_FLAG_NO_ENCODE_QUOTES);\n\t\tif(empty($newCommentContent) === true) {\n\t\t\tthrow(new \\InvalidArgumentException(\"tweet content is empty or insecure\"));\n\t\t}\n\n\t\t// verify the comment content will fit in the database\n\t\tif(strlen($newCommentContent) > 256) {\n\t\t\tthrow(new \\RangeException(\"comment content too large\"));\n\t\t}\n\n\t\t// store the comment content\n\t\t$this->commentContent = $newCommentContent;\n\t}", "protected function parseComment()\n {\n if (!$this->peekChar('/')) {\n return;\n }\n\n if ($this->peekChar('/', 1)) {\n return new ILess_Node_Comment($this->matchReg('/\\G\\/\\/.*/'), true, $this->position, $this->env->currentFileInfo);\n } //elseif($comment = $this->matchReg('/\\G\\/\\*(?:[^*]|\\*+[^\\/*])*\\*+\\/\\n?/'))\n elseif ($comment = $this->matchReg('/\\\\G\\/\\*(?s).*?\\*+\\/\\n?/')) {\n return new ILess_Node_Comment($comment, false, $this->position, $this->env->currentFileInfo);\n }\n }", "public function setCommentId($comment_id)\n {\n $this->comment_id = $comment_id;\n }", "protected function comment($comment, $depth, $args)\n {\n }", "private function comment()\n {\n // Comments always begin with a / character.\n $this->nextOrFail('/');\n\n if ($this->currentByte === '/') {\n $this->inlineComment();\n } elseif ($this->currentByte === '*') {\n $this->blockComment();\n } else {\n $this->throwSyntaxError('Unrecognized comment');\n }\n }", "protected function readElementNode()\n {\n $this->element = $this->createVirtualElement();\n\n if ($this->reader->hasAttributes) {\n foreach ($this->readElementAttributes() as $attribute => $value) {\n $this->element->put($attribute, $value);\n }\n }\n }", "protected function fill_descendants($comments)\n {\n }", "public function lazyload_comment_meta($check, $comment_id)\n {\n }", "private function readComment(): bool\n {\n $this->readWhitespace();\n if (!$this->readChar('#')) {\n return false;\n }\n $type = strpbrk($this->data[$this->position] ?? '', '~|,:.') ?: '';\n $this->position += strlen($type);\n // Only a single space might be optionally added\n $this->readChar(' ');\n switch ($type) {\n case '':\n $data = $this->readCommentString();\n $this->translation->getComments()->add($data);\n break;\n case '~':\n if ($this->translation->getPreviousOriginal() !== null) {\n throw new Exception(\"Inconsistent use of #~{$this->getErrorPosition()}\");\n }\n $this->translation->disable();\n $this->isDisabled = true;\n break;\n case '|':\n if ($this->translation->getPreviousOriginal() !== null) {\n throw new Exception('Cannot redeclare the previous comment #|, '\n . \"ensure the definitions are in the right order{$this->getErrorPosition()}\");\n }\n $this->inPreviousPart = true;\n $this->translation->setPreviousContext($this->readIdentifier('msgctxt'));\n $this->translation->setPreviousOriginal($this->readIdentifier('msgid', true));\n $this->translation->setPreviousPlural($this->readIdentifier('msgid_plural'));\n $this->inPreviousPart = false;\n break;\n case ',':\n $data = $this->readCommentString();\n foreach (array_map('trim', explode(',', trim($data))) as $value) {\n $this->translation->getFlags()->add($value);\n }\n break;\n case ':':\n $data = $this->readCommentString();\n foreach (preg_split('/\\s+/', trim($data)) as $value) {\n if (preg_match('/^(.+)(:(\\d*))?$/U', $value, $matches)) {\n $line = isset($matches[3]) ? intval($matches[3]) : null;\n $this->translation->getReferences()->add($matches[1], $line);\n }\n }\n break;\n case '.':\n $data = $this->readCommentString();\n $this->translation->getExtractedComments()->add($data);\n break;\n }\n\n return true;\n }", "public function setComment($value)\n {\n return $this->set(self::COMMENT, $value);\n }", "public function setCommentID($value)\n {\n return $this->set('CommentID', $value);\n }", "public function setCommentID($value)\n {\n return $this->set('CommentID', $value);\n }", "public function setCommentID($value)\n {\n return $this->set('CommentID', $value);\n }", "public function setCommentID($value)\n {\n return $this->set('CommentID', $value);\n }", "public function setCommentID($value)\n {\n return $this->set('CommentID', $value);\n }", "public function setCommentID($value)\n {\n return $this->set('CommentID', $value);\n }", "public function setCommentID($value)\n {\n return $this->set('CommentID', $value);\n }", "public function setCommentID($value)\n {\n return $this->set('CommentID', $value);\n }", "public function setCommentID($value)\n {\n return $this->set('CommentID', $value);\n }", "public function setCommentID($value)\n {\n return $this->set('CommentID', $value);\n }", "function setCommentId(int $newCommentId = null) {\n\tif($newCommentId === null) {\n\t\t$this->commentId = mull;\n\t\treturn;\n\t}\n\n\t// verify the comment id is positive\n\tif($newCommentId <= 0) {\n\t\tthrow(new \\RangeException(\"comment id is not positive\"));\n\t}\n\n\t// convert and store the comment id\n\t$this->commentId = $newCommentId;\n}", "public function setCommentID($commentID)\n {\n $this->commentID = $commentID;\n\n return $this;\n }", "public function __construct($comment)\n {\n $this->comment = $comment;\n }", "public function setComment($value)\n {\n return $this->set(self::comment, $value);\n }", "function setCommentDate($newCommentDate = null) {\n\tif($newCommentDate === null) {\n\t\t$this->commentDate = new \\DateTime();\n\t\treturn;\n\t}\n\n\t// store the comment date\n\ttry {\n\t\t$newCommentDate = self::validateDateTime($newCommentDate);\n\t} catch(\\InvalidArgumentException $invalidArgument)\n\t{\n\t\tthrow(new \\InvalidArgumentException($invalidArgument->getMessage(), 0, $invalidArgument));\n\t} catch(\\RangeException $range) {\n\tthrow(new \\RangeException($range->getMessage(), 0, $range));\n\t}\n\t$this->commentDate = $newCommentDate;\n}", "protected function setKnownChildElement($xml) {\n $happened = parent::setKnownChildElement($xml);\n if ($happened) {\n return true;\n }\n else if (($xml->localName == 'father') && ($xml->namespaceURI == 'http://familysearch.org/v1/')) {\n $child = new \\Gedcomx\\Common\\ResourceReference($xml);\n $this->father = $child;\n $happened = true;\n }\n else if (($xml->localName == 'mother') && ($xml->namespaceURI == 'http://familysearch.org/v1/')) {\n $child = new \\Gedcomx\\Common\\ResourceReference($xml);\n $this->mother = $child;\n $happened = true;\n }\n else if (($xml->localName == 'child') && ($xml->namespaceURI == 'http://familysearch.org/v1/')) {\n $child = new \\Gedcomx\\Common\\ResourceReference($xml);\n $this->child = $child;\n $happened = true;\n }\n else if (($xml->localName == 'fatherFact') && ($xml->namespaceURI == 'http://familysearch.org/v1/')) {\n $child = new \\Gedcomx\\Conclusion\\Fact($xml);\n if (!isset($this->fatherFacts)) {\n $this->fatherFacts = array();\n }\n array_push($this->fatherFacts, $child);\n $happened = true;\n }\n else if (($xml->localName == 'motherFact') && ($xml->namespaceURI == 'http://familysearch.org/v1/')) {\n $child = new \\Gedcomx\\Conclusion\\Fact($xml);\n if (!isset($this->motherFacts)) {\n $this->motherFacts = array();\n }\n array_push($this->motherFacts, $child);\n $happened = true;\n }\n return $happened;\n }", "function register_block_core_comment_content()\n {\n }", "function __construct( $comment ) {\n\n\t\t$this->id = $comment->comment_ID;\n\t\t$this->comment = $comment;\n\n\t\t$this->report_type = get_comment_meta( $this->id, APP_REPORTS_C_RECIPIENT_TYPE_KEY, true );\n\t\t$this->recipient_id = get_comment_meta( $this->id, APP_REPORTS_C_RECIPIENT_KEY, true );\n\n\t\t$meta = get_comment_meta( $this->id, APP_REPORTS_C_DATA_KEY, true );\n\t\t$this->meta = wp_parse_args( $meta, $this->meta );\n\t}", "public function setComment(?WorkbookComment $value): void {\n $this->getBackingStore()->set('comment', $value);\n }", "protected function setChild(?string $nodename, NodeInterface $child)\n {\n $context = new ExceptionContext(\n 'exception.propimmutable',\n 'Read only'\n );\n\n throw new PropImmutableException($context);\n }", "public function setCommentContent($commentID, $newContent)\n {\n $comment = $this->findOrFail($commentID);\n $comment->comment = $newContent;\n $comment->save();\n }", "public function setComment(string $comment): Mailcode_Commands_Command;", "public function __construct(CommentInterface $entry)\n {\n $this->entry = $entry;\n }", "function replace_instance_comment($cId, $activityId, $activity, $user, $title, $comment) \n {\n return $this->instance->replace_instance_comment($cId, $activityId, $activity, $user, $title, $comment);\n }", "protected function getDocCommentParser() {}", "protected function getDocCommentParser() {}", "protected function getDocCommentParser() {}", "public function setIdComment($idComment)\n {\n $this->idComment = $idComment;\n\n return $this;\n }", "public function setIdComment($idComment)\n {\n $this->idComment = $idComment;\n\n return $this;\n }", "public function idComment($idComment)\n\t{\n\t\t$datas= array('id'=>$idComment);\n\t\t$comment= new Comments($datas);\n\t\treturn $comment;\n\t}", "public function addComment($comment, $packageId = null)\n {\n if (null === $this->_htmlHeadEntrySet) {\n throw new Zap_Exception(\n sprintf(\n \"Child class '%s' did not \".\n 'instantiate a HTML head entry set. This should be done in '.\n 'the constructor either by calling parent::__construct() or '.\n 'by creating a new HTML head entry set.', get_class($this)\n )\n );\n }\n\n $this->_htmlHeadEntrySet->addEntry(\n new SwatCommentHtmlHeadEntry($comment, $packageId)\n );\n }", "public function setComment(?string $value): void {\n $this->getBackingStore()->set('comment', $value);\n }", "public function setInternalComment($internal_comment)\n {\n $this->internal_comment = $internal_comment;\n }", "public function setComment(VotableCommentInterface $comment)\n {\n $this->comment = $comment;\n }", "function setIdComentaire($idCommentaire) {\n $this->idCommentaire = $idCommentaire;\n }", "public function get_comments_by_parent_id($idParent) {\n $root = simplexml_load_file('data/comments.xml');\n $comments = [];\n foreach($root->xpath(\"//comment\") as $comment) {\n if(intval($comment['idParent']) === $idParent){\n array_push($comments, array(\n 'author' => (string) $comment->author,\n 'mark' => intval($comment->mark),\n 'comment' => (string) $comment->text)\n );\n }\n }\n return $comments;\n }", "function get_comment() {\n\t\treturn $this->comment;\n\t}" ]
[ "0.5871284", "0.5756039", "0.5741529", "0.5741529", "0.57179004", "0.57179004", "0.5568992", "0.55243963", "0.54353034", "0.5427854", "0.54210854", "0.53944606", "0.5358718", "0.5358177", "0.5350284", "0.5326946", "0.532239", "0.52859074", "0.527416", "0.5257207", "0.52309835", "0.5229595", "0.52248913", "0.5198659", "0.51374733", "0.51287943", "0.5097743", "0.5094115", "0.50884473", "0.5069576", "0.5058034", "0.50441617", "0.50441617", "0.5004273", "0.49842244", "0.49622405", "0.49538445", "0.49253404", "0.48960575", "0.48960575", "0.48960575", "0.4889441", "0.4887703", "0.48644364", "0.48604268", "0.48604268", "0.48585674", "0.48580155", "0.48286134", "0.48286134", "0.48286134", "0.4824742", "0.48134822", "0.4806636", "0.47715956", "0.4755234", "0.47325176", "0.47318926", "0.47205845", "0.469989", "0.4693301", "0.46874547", "0.46779022", "0.4672929", "0.46723422", "0.46723422", "0.46723422", "0.46723422", "0.46723422", "0.46723422", "0.46703112", "0.466993", "0.466993", "0.4666734", "0.46633774", "0.46499524", "0.46471378", "0.46399444", "0.4633403", "0.4621744", "0.46193314", "0.46075428", "0.4598348", "0.4594899", "0.45850757", "0.45802662", "0.45802155", "0.4579515", "0.4579515", "0.4579515", "0.45660084", "0.45660084", "0.45575613", "0.45542616", "0.4536189", "0.45295995", "0.45219746", "0.4517206", "0.4513053", "0.45126474" ]
0.51482344
24
Sets a known attribute of Comment from an XML reader.
protected function setKnownAttribute(\XMLReader $xml) { if (parent::setKnownAttribute($xml)) { return true; } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setCommentAttrribute($comment)\n {\n $this->attributes['comment'] = strip_tags($comment);\n }", "public function setComment($comment){\n\t\tif(FW_Validate::isValidUrl($comment)){\n\t\t\t$this->_comment = $comment;\n\t\t}\n\t}", "function set_comment($new_comment)\n {\n $this->comment = $new_comment;\n }", "function setComment($comment)\n {\n $this->comment = $comment;\n }", "function setComment($comment)\n {\n $this->comment = $comment;\n }", "public function setComment($comment);", "public function setComment($comment);", "public function setComment(string $comment): void\n {\n $this->description = '';\n $this->tags = [];\n $this->comment = $comment;\n\n $this->parseComment($comment);\n }", "public static function setComment($comment)\n {\n self::$comment = str_replace([\"\\r\", \"\\n\"], '', $comment);\n }", "public function set_comment($comment)\n {\n $this->set_default_property(self::PROPERTY_COMMENT, $comment);\n }", "public function setComment(Comment $comment): void;", "public function setDocComment(string $newDocComment): void\n {\n $entry = new StringEntry($newDocComment);\n\n // TODO: investigate what to do with string copying\n $this->node->doc_comment = $entry->copy()->getRawValue();\n }", "public function changeComment($comment)\r\n {\r\n\r\n }", "public function setComment($comment)\n {\n $this->_comment = (string) $comment;\n return $this;\n }", "function set_commentid($new_commentid)\n {\n $this->commentid = $new_commentid;\n }", "function set_comment() {\n $this->sale_lib->set_comment($this->input->post('comment'));\n }", "public function setComment($comment)\n {\n $this->values['Comment'] = $comment;\n return $this;\n }", "function SetItemcommentid($value) { $this->itemCommentId=$value; }", "function &setComment(Comment $comment) {\n $this->setadditionalProperty('comment_type', get_class($comment));\n $this->setadditionalProperty('comment_id', $comment->getId());\n\n return $this;\n }", "public function setComments( $url ) {\n\t\t$this->comments = RSSCreator::ensureLinkProtocol( $url );\n\t}", "public function comment($comment)\n {\n return $this->setProperty('comment', $comment);\n }", "protected function setKnownAttribute(\\XMLReader $xml)\n {\n if (parent::setKnownAttribute($xml)) {\n return true;\n }\n\n return false;\n }", "public function set_comment($comment) \n\t{\n\t\t$this->comment = $comment;\n\t\treturn $this;\n\t}", "protected function set__comments( $val )\n\t{\n\t\t\n\t}", "private function readComment($line, $col, \\GraphQL\\Language\\Token $prev)\n {\n }", "public function readComment($row, $column) {\n\t}", "public function setDocComment(Comment\\Doc $docComment);", "public function setComment(string $comment): Mailcode_Commands_Command;", "public function setIdentifyingAttribute($string);", "function setCommentContent (string $newCommentContent) {\n\t\t$newCommentContent = trim($newCommentContent);\n\t\t$newCommentContent = filter_var($newCommentContent,FILTER_SANITIZE_STRING, FILTER_FLAG_NO_ENCODE_QUOTES);\n\t\tif(empty($newCommentContent) === true) {\n\t\t\tthrow(new \\InvalidArgumentException(\"tweet content is empty or insecure\"));\n\t\t}\n\n\t\t// verify the comment content will fit in the database\n\t\tif(strlen($newCommentContent) > 256) {\n\t\t\tthrow(new \\RangeException(\"comment content too large\"));\n\t\t}\n\n\t\t// store the comment content\n\t\t$this->commentContent = $newCommentContent;\n\t}", "function setCommentDate($newCommentDate = null) {\n\tif($newCommentDate === null) {\n\t\t$this->commentDate = new \\DateTime();\n\t\treturn;\n\t}\n\n\t// store the comment date\n\ttry {\n\t\t$newCommentDate = self::validateDateTime($newCommentDate);\n\t} catch(\\InvalidArgumentException $invalidArgument)\n\t{\n\t\tthrow(new \\InvalidArgumentException($invalidArgument->getMessage(), 0, $invalidArgument));\n\t} catch(\\RangeException $range) {\n\tthrow(new \\RangeException($range->getMessage(), 0, $range));\n\t}\n\t$this->commentDate = $newCommentDate;\n}", "public function setComment($comment) {\n $this->comment = $comment;\n return $this;\n }", "public function setComment($comment) {\n $this->properties['comment'] = $comment;\n\n return $this;\n }", "public function setComment($comment) {\n $this->properties['comment'] = $comment;\n\n return $this;\n }", "public function setComment($comment)\n {\n $this->comment = $comment;\n return $this;\n }", "public function setAnnotationReader($reader)\n {\n $this->wrapped->setAnnotationReader($reader);\n }", "protected function parseXslComment(DOMElement $ir, DOMElement $node)\n\t{\n\t\t$comment = $this->appendElement($ir, 'comment');\n\t\t$this->parseChildren($comment, $node);\n\t}", "public function setComment($comment)\r\n {\r\n $this->comment = $comment;\r\n\r\n return $this;\r\n }", "public function setComment( $comment ) {\n\t\tif ( !empty( $comment ) ) {\n\t\t\t$this->content = TRUE;\n\t\t\t$this->setParameter( \"description\", $comment );\n\t\t}\n\t}", "protected static function parseXslComment(DOMElement $ir, DOMElement $node)\n\t{\n\t\t$comment = self::appendElement($ir, 'comment');\n\n\t\t// Parse this branch's content\n\t\tself::parseChildren($comment, $node);\n\t}", "function setCommentId(int $newCommentId = null) {\n\tif($newCommentId === null) {\n\t\t$this->commentId = mull;\n\t\treturn;\n\t}\n\n\t// verify the comment id is positive\n\tif($newCommentId <= 0) {\n\t\tthrow(new \\RangeException(\"comment id is not positive\"));\n\t}\n\n\t// convert and store the comment id\n\t$this->commentId = $newCommentId;\n}", "public function setComment(?string $value): void {\n $this->getBackingStore()->set('comment', $value);\n }", "function __set($attributeToChange, $newValueToAssign) {\n //check that name is valid class attribute\n switch($attributeToChange) {\n case \"name\":\n $this->name = $newValueToAssign;\n break;\n case \"favoriteFood\":\n $this->favoriteFood = $newValueToAssign;\n break;\n case \"sound\":\n $this->sound = $newValueToAssign;\n break;\n default:\n echo $attributeToChange . \" was not found <br>\";\n }\n echo \"Set \" . $attributeToChange . \" to \" . $newValueToAssign . \"<br>\";\n }", "public function __construct($comment)\n {\n $this->comment = $comment;\n }", "public function setServiceComment($comment) {\n $this->serviceComment = check_plain(trim($comment));\n }", "public function __construct(Comment $comment)\n {\n $this->comment = $comment;\n }", "public function __construct(Comment $comment)\n {\n $this->comment = $comment;\n }", "public function __construct(Comment $comment)\n {\n $this->comment = $comment;\n }", "public function setComment(?WorkbookComment $value): void {\n $this->getBackingStore()->set('comment', $value);\n }", "public function setComment($comment)\n {\n $this->comment = $comment;\n\n return $this;\n }", "public function setComment($comment)\n {\n $this->comment = $comment;\n\n return $this;\n }", "public function setComment($comment)\n {\n $this->comment = $comment;\n\n return $this;\n }", "public function comment($comment)\n {\n $this->comments[] = $comment;\n }", "protected function _prepare_comment($comment)\n {\n }", "public function setCommentChar(string $commentChar): CsvImport\n {\n $this->commentChar = $commentChar;\n return $this;\n }", "public function setComments($url);", "public function setCommentText($value)\n {\n $this->commentText=$value;\n }", "public function setComment($value)\n {\n return $this->set('Comment', $value);\n }", "public function setComment($value)\n {\n return $this->set('Comment', $value);\n }", "public function setCommentTimestamp($newCommentTimestamp = null): void {\n\t\t// base case: if the date is null, use the current date and time\n\t\tif($newCommentTimestamp === null) {\n\t\t\t$this->commentTimestamp = new \\DateTime();\n\t\t\treturn;\n\t\t}\n\t\t// store the comment timestamp using the ValidateDate trait\n\t\ttry {\n\t\t\t$newCommentTimestamp = self::validateDateTime($newCommentTimestamp);\n\t\t} catch(\\InvalidArgumentException | \\RangeException $exception) {\n\t\t\t$exceptionType = get_class($exception);\n\t\t\tthrow(new $exceptionType($exception->getMessage(), 0, $exception));\n\t\t}\n\t\t$this->commentTimestamp = $newCommentTimestamp;\n\t}", "function update_comment_meta($comment_id, $meta_key, $meta_value, $prev_value = '')\n {\n }", "public function setAttributeMetadata($attributeName, $definition){\n\t\tActiveRecordMetaData::setAttributeMetadata($this->_source, $this->_schema, $attributeName, $definition);\n\t}", "function xgb_mark_comments_as_read() {\n\t\n\t// Security Check\n\tif( !isset( $_POST['xgb_nonce_for_comment'] ) || !wp_verify_nonce( $_POST['xgb_nonce_for_comment'], 'xgb-nonce-x' ) )\n\t\tdie();\n\t\n\tupdate_comment_meta($_POST['comment_id'], 'xgb_comment_read_status', 1);\n\tdie();\t// Always die() While Working With Ajax\n}", "public function testSetCommentaire() {\n\n $obj = new FichesControlesEntetes();\n\n $obj->setCommentaire(\"commentaire\");\n $this->assertEquals(\"commentaire\", $obj->getCommentaire());\n }", "public function set_attribute($name, $value)\n {\n }", "function SaveRating($commentID) {\n add_comment_meta($commentID, 'crfp-rating', $_POST['crfp-rating'], true);\n }", "function __construct( $comment ) {\n\n\t\t$this->id = $comment->comment_ID;\n\t\t$this->comment = $comment;\n\n\t\t$this->report_type = get_comment_meta( $this->id, APP_REPORTS_C_RECIPIENT_TYPE_KEY, true );\n\t\t$this->recipient_id = get_comment_meta( $this->id, APP_REPORTS_C_RECIPIENT_KEY, true );\n\n\t\t$meta = get_comment_meta( $this->id, APP_REPORTS_C_DATA_KEY, true );\n\t\t$this->meta = wp_parse_args( $meta, $this->meta );\n\t}", "public function comm($c){\n\t\t$this->comment = $c;\n\t}", "public function __set($attribute, $param) {\n $this->$attribute = $param;\n }", "protected function determineComment()\n {\n if (starts_with($this->source, '//')) {\n $this->isInterrupted = true;\n } elseif (starts_with($this->source, '#')) {\n log_warning('Using the # symbol for comments is deprecated');\n $this->isInterrupted = true;\n } elseif (starts_with($this->source, '/*')) {\n if (ends_with($this->source, '*/')) {\n return;\n }\n $this->isComment = true;\n } elseif (ends_with($this->source, '*/')) {\n $this->isComment = false;\n }\n }", "public function setAttribute($attribute, $value)\n {\n }", "public function setCommentaire($v)\n\t{\n\t\tif ($v !== null) {\n\t\t\t$v = (string) $v;\n\t\t}\n\n\t\tif ($this->commentaire !== $v) {\n\t\t\t$this->commentaire = $v;\n\t\t\t$this->modifiedColumns[] = CampaignPeer::COMMENTAIRE;\n\t\t}\n\n\t\treturn $this;\n\t}", "public function setAttribute($name, $value);", "function setIdComentaire($idCommentaire) {\n $this->idCommentaire = $idCommentaire;\n }", "public function setComment($var)\n {\n GPBUtil::checkString($var, True);\n $this->comment = $var;\n\n return $this;\n }", "public function setCommentId($comment_id)\n {\n $this->comment_id = $comment_id;\n }", "function setCommentProfileId(int $newCommentProfileId) {\n\tif($newCommentProfileId <= 0) {\n\t\tthrow(new \\RangeException(\"comment profile id is not positive\"));\n\t}\n\n\t// convert and store the profile id\n\t$this->commentProfileId = $newCommentProfileId;\n}", "public function testSetCommentaire() {\n\n $obj = new Materiels();\n\n $obj->setCommentaire(\"commentaire\");\n $this->assertEquals(\"commentaire\", $obj->getCommentaire());\n }", "public function setDocComment($comment)\n {\n $this->docComment = $comment;\n }", "public function lazyload_comment_meta($check, $comment_id)\n {\n }", "function change_request_comment($comm,$id)\n\t{\n\t\t$data['request_comment'] =$comm;\n\t return $this->db->update('pamm_requests', $data, \"request_id = $id\");\n\t}", "public function setAttribute(string $attribute, string $value);", "public function comment($comment = null) {\n\t\tif ($comment) {\n\t\t\t$this->_config['comment'] = $comment;\n\t\t\treturn $this;\n\t\t}\n\t\treturn $this->_config['comment'];\n\t}", "public function setAttribute($name, $value)\n\t\t{\n\t\t\tswitch(strtolower($name))\n\t\t\t{\n\t\t\t\tcase 'mode':\n\t\t\t\t\t$this->setDisplayMode($value);\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tparent::setAttribute($name, $value);\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}", "function set_attr($attr=array()) {\n $this->other_attr = $attr;\n }", "function __construct($comment_text='', $filename='')\n {\n $this->attr_raw = $comment_text;\n $this->attr_filename = $filename;\n }", "public function setComment($value)\n {\n return $this->set(self::comment, $value);\n }", "public function setComment($value)\n {\n return $this->set(self::COMMENT, $value);\n }", "public function offsetSet($offset, $value) { if (is_null($offset)) { $this->dataComment[] = $value; } else { $this->dataComment[$offset] = $value; }}", "function Comment($commentText, $IPNumber, $name, $UID=\"\") {\n\n\t\t$this->commentText = substr(wordwrap($commentText, 100, \" \", 1), 0, 1000);\n\t\t$this->datePosted = time();\n\t\t$this->IPNumber = $IPNumber;\n\t\t$this->name = substr($name, 0, 100);\n\t\t$this->UID = $UID;\n\t}", "function get_comment() {\n\t\treturn $this->comment;\n\t}", "public function __set($attribute, $value){\n\t\t$this->$attribute = $value;\n\t}", "private function comment()\n {\n // Comments always begin with a / character.\n $this->nextOrFail('/');\n\n if ($this->currentByte === '/') {\n $this->inlineComment();\n } elseif ($this->currentByte === '*') {\n $this->blockComment();\n } else {\n $this->throwSyntaxError('Unrecognized comment');\n }\n }", "public function setComment(VotableCommentInterface $comment)\n {\n $this->comment = $comment;\n }", "public function setIdComment($idComment)\n {\n $this->idComment = $idComment;\n\n return $this;\n }", "public function setIdComment($idComment)\n {\n $this->idComment = $idComment;\n\n return $this;\n }", "public function comments(string $comments): self\r\n {\r\n $comments = str_replace(\"'\", \"\\'\", $comments);\r\n $this->comments = $comments;\r\n return $this;\r\n }", "protected function setKnownAttribute($xml) {\r\n\r\n return false;\r\n }", "public function setAttribute($attribute, $value)\r\n\t{\r\n\t\t\r\n\t}", "public function setInternalComment($internal_comment)\n {\n $this->internal_comment = $internal_comment;\n }" ]
[ "0.65803456", "0.61772245", "0.6174319", "0.60730314", "0.60730314", "0.6041736", "0.6041736", "0.5983917", "0.5874573", "0.57752144", "0.5615691", "0.560182", "0.55873084", "0.5550743", "0.55292344", "0.5298252", "0.5268659", "0.5234808", "0.5200653", "0.5186821", "0.5182485", "0.5181116", "0.51792043", "0.5166641", "0.5165625", "0.51569897", "0.51545715", "0.51507664", "0.51185805", "0.5074773", "0.5067347", "0.5056151", "0.50339556", "0.50339556", "0.50327325", "0.5017168", "0.4990458", "0.49874645", "0.4964362", "0.4959975", "0.4929215", "0.49212098", "0.49181095", "0.4887005", "0.48841622", "0.48740312", "0.48740312", "0.48740312", "0.4854764", "0.48364764", "0.48364764", "0.48364764", "0.48198813", "0.4805955", "0.47846597", "0.47586906", "0.47581103", "0.47259736", "0.47259736", "0.4701734", "0.46959507", "0.46906623", "0.4683616", "0.46774045", "0.4659242", "0.46429154", "0.46328667", "0.46272773", "0.4627066", "0.4626157", "0.4619486", "0.46178037", "0.46096435", "0.4608511", "0.46080196", "0.4605796", "0.4602281", "0.4597747", "0.45965502", "0.45881867", "0.4583747", "0.45776165", "0.45749673", "0.45644096", "0.4555526", "0.45503047", "0.45459735", "0.45360255", "0.4533609", "0.4532606", "0.4527382", "0.45248646", "0.45208934", "0.45150387", "0.45093077", "0.45093077", "0.45060626", "0.450174", "0.4499793", "0.4487394" ]
0.5356942
15
Writes the contents of this Comment to an XML writer. The startElement is expected to be already provided.
public function writeXmlContents(\XMLWriter $writer) { parent::writeXmlContents($writer); if ($this->text) { $writer->startElementNs('fs', 'text', null); $writer->text($this->text); $writer->endElement(); } if ($this->created) { $writer->startElementNs('fs', 'created', null); $writer->text($this->created); $writer->endElement(); } if ($this->contributor) { $writer->startElementNs('fs', 'contributor', null); $this->contributor->writeXmlContents($writer); $writer->endElement(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function toXML() {\n return \"<!-- \" . strval($this->content) . \"-->\";\n }", "public function output_xml()\n {\n $this->comment(sprintf(\"Estimated Execution Time Is: %s\"\n , (preg_replace(\n '/^0\\.(\\d+) (\\d+)$/', '\\2.\\1', microtime()) - START_TIME)\n ));\n\n $this->comments2xml($this->xmlw, $this->comments);\n $this->close_xml();\n $xml_out = $this->xmlw->outputMemory();\n $this->debug('---- Start XML Output ----');\n $this->debug(explode(\"\\n\", $xml_out));\n $this->debug('---- End XML Output ----');\n echo $xml_out;\n exit();\n }", "public function write() {\n\t\tcopy($this->_path, str_replace('.css', getDatetime(time(), 'Y-m-d_H-i-s') . '.css', $this->_path));\n\t\t$cssData = preg_replace('/\\/\\*\\* @_START_@ \\*\\/(.*?)\\/\\*\\* @_END_@ \\*\\//s', '/** @_START_@ */\n' . $this->toString() . '\n/** @_END_@ */', $this->_fileContent);\n\t\tfile_put_contents($this->_path, $cssData);\n\t}", "public function writeTo(XmlWriter $w) { }", "public function writeContentTo(XmlWriter $w) { }", "public function export(\n \\DOMElement $parent, $element\n ) {\n $docblock = $element->getDocBlock();\n if (!$docblock) {\n $parent->setAttribute('package', $element->getDefaultPackageName());\n return;\n }\n\n $child = new \\DOMElement('docblock');\n $parent->appendChild($child);\n\n // TODO: custom attached member variable, make real\n $child->setAttribute('line', $docblock->line_number);\n\n $this->addDescription($child, $docblock);\n $this->addLongDescription($child, $docblock);\n $this->addTags($child, $docblock->getTags(), $element);\n $this->setParentsPackage($parent, $docblock, $element);\n }", "protected function startDocument()\n {\n $this->writer->startDocument(\"1.0\", 'UTF-8', \"no\");\n $this->writer->setIndent(true);\n $this->writer->setIndentString(' ');\n $this->writer->startDTD(\n 'score-partwise',\n '-//Recordare//DTD MusicXML 3.0 Partwise//EN',\n 'http://www.musicxml.org/dtds/partwise.dtd'\n );\n $this->writer->endDocument();\n $this->writer->startElement('score-partwise');\n $this->writer->writeAttribute(\"version\", \"3.0\");\n\n }", "public function write($xml);", "public function startSitemap()\n {\n $this->setWriter(new \\XMLWriter());\n $this->getWriter()->openURI($this->getFile());\n $this->getWriter()->startDocument('1.0', 'UTF-8');\n $this->getWriter()->setIndent(true);\n $this->getWriter()->startElement('urlset');\n $this->getWriter()->writeAttribute('xmlns', self::SCHEMA);\n }", "public function output() {\n header('Content-Type: application/xml');\n $dom = new \\DOMDocument('1.0');\n $dom->preserveWhiteSpace = false;\n $dom->formatOutput = true;\n $dom->loadXML($this->xml->asXML());\n echo $dom->saveXML();\n }", "function write_domaine( $domaine ) {\r\n global $CFG;\r\n // initial string;\r\n $expout = \"\";\r\n // add comment\r\n // $expout .= \"\\n\\n<!-- domaine: $domaine->id -->\\n\";\r\n\t\t//\r\n\t\tif ($domaine){\r\n\t\t\t$id = $this->writeraw( $domaine->id );\r\n $code = $this->writeraw( trim($domaine->code_domaine) );\r\n $description_domaine = $this->writetext(trim($domaine->description_domaine));\r\n $ref_referentiel = $this->writeraw( $domaine->ref_referentiel );\r\n\t\t\t$num_domaine = $this->writeraw( $domaine->num_domaine );\r\n\t\t\t$nb_competences = $this->writeraw( $domaine->nb_competences );\r\n\r\n\t\t\t$type_domaine = $this->writeraw( trim($domaine->type_domaine));\r\n\t\t\t$seuil_domaine = $this->writeraw( trim($domaine->seuil_domaine));\r\n\r\n\t\t\t$minima_domaine = $this->writeraw( trim($domaine->minima_domaine));\r\n\r\n $expout .= \" <domaine>\\n\";\r\n\t\t\t// $expout .= \" <id>$id</id>\\n\";\r\n\t\t\t$expout .= \" <code_domaine>$code</code_domaine>\\n\";\r\n $expout .= \" <description_domaine>\\n$description_domaine</description_domaine>\\n\";\r\n $expout .= \" <type_domaine>$type_domaine</type_domaine>\\n\";\r\n $expout .= \" <seuil_domaine>$seuil_domaine</seuil_domaine>\\n\";\r\n $expout .= \" <minima_domaine>$minima_domaine</minima_domaine>\\n\";\r\n // $expout .= \" <ref_referentiel>$ref_referentiel</ref_referentiel>\\n\";\r\n $expout .= \" <num_domaine>$num_domaine</num_domaine>\\n\";\r\n $expout .= \" <nb_competences>$nb_competences</nb_competences>\\n\\n\";\r\n\r\n\t\t\t// LISTE DES COMPETENCES DE CE DOMAINE\r\n\t\t\t$compteur_competence=0;\r\n\t\t\t$records_competences = referentiel_get_competences($domaine->id);\r\n\t\t\tif ($records_competences){\r\n\t\t\t\t// DEBUG\r\n\t\t\t\t// echo \"<br/>DEBUG :: COMPETENCES <br />\\n\";\r\n\t\t\t\t// print_r($records_competences);\r\n\t\t\t\tforeach ($records_competences as $record_c){\r\n\t\t\t\t\t$expout .= $this->write_competence( $record_c );\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t$expout .= \" </domaine>\\n\\n\";\r\n }\r\n return $expout;\r\n }", "public function output(){\n header('Content-type: text/xml');\n echo $this->getDocument();\n }", "private function generateNewPart(): void\n {\n if (null !== $this->buffer) {\n $this->closeFeed();\n }\n\n $this->bufferSize = 0;\n ++$this->bufferPart;\n\n if (!$this->folder->isWritable()) {\n throw new \\RuntimeException(sprintf('Unable to write to folder: %s', (string) $this->folder));\n }\n\n $filename = sprintf('%s/feed_%05d.xml', (string) $this->folder, $this->bufferPart);\n $buffer = fopen($filename, 'w');\n if (false === $buffer) {\n throw new \\Exception(sprintf('Cannot open file %s.', $filename));\n }\n $this->buffer = $buffer;\n\n $written = fwrite(\n $this->buffer,\n <<<XML\n <?xml version=\"1.0\" encoding=\"UTF-8\"?>\n <!DOCTYPE gsafeed PUBLIC \"-//Google//DTD GSA Feeds//EN\" \"$this->dtd\">\n <gsafeed>\n <header>\n <datasource>$this->datasource</datasource>\n <feedtype>$this->feedtype</feedtype>\n </header>\n\n <group>\n\n XML\n );\n if (false === $written) {\n throw new \\Exception(sprintf('Cannot write file %s.', $filename));\n }\n\n $this->bufferSize += $written;\n }", "private function _writeComment()\n {\n $connectionTime = time() - $this->start;\n if ($connectionTime % $this->keepAliveTime === 0) {\n $comment = sprintf(': %s', sha1(mt_rand()) . PHP_EOL);\n\n echo $comment . PHP_EOL;\n }\n }", "function OutputComment() {\n\t\t$pagecomment = trim($this->shortDescription) ? PrepString($this->shortDescription).\"<br />\" : \"\";\n\t\t$pagecomment .= trim($this->longDescription) ? PrepString($this->longDescription).\"<br />\" : \"\";\n\t\t$pagecomment .= trim($this->tags) ? \"<i>\".PrepString($this->tags).\"</i>\" : \"\";\n\t\t$pagecomment = $pagecomment ? $pagecomment : \"<i>(Undocumented)</i>\";\n\t\t$pagecomment = \"<div class='pagecomment'>$pagecomment</div>\";\n\t\treturn $pagecomment;\n\t}", "function displayHelp($file){\n$xml = new XmlWriter();\n$xml->openMemory();\n//$xml->startDocument('1.0', 'UTF-8');\n$xml->startElement('doc');\n\n// CData output\n$xml->startElement('help');\n$xml->writeCData(\"$file\");\n$xml->endElement();\n\n// end the document and output\n$xml->endElement();\necho $xml->outputMemory(true);\n}", "protected function generate_instruction()\n {\n $this->xml->startElement(\"instruction\");\n $this->xml->writeAttribute(\"order\", $this->instrCount);\n $this->xml->writeAttribute(\"opcode\", $this->token);\n }", "public function dump()\n {\n $this->_domDocument->formatOutput = true;\n echo $this->_domDocument->saveXML();\n }", "public function setDocComment(Comment\\Doc $docComment);", "private function startAtomFeed()\n {\n $this->startElement('feed');\n $this->writeAttributes(array(\n 'xml:lang' => 'en',\n 'xmlns' => 'http://www.w3.org/2005/Atom',\n 'xmlns:time' => 'http://a9.com/-/opensearch/extensions/time/1.0/',\n 'xmlns:os' => 'http://a9.com/-/spec/opensearch/1.1/',\n 'xmlns:dc' => 'http://purl.org/dc/elements/1.1/',\n 'xmlns:georss' => 'http://www.georss.org/georss',\n 'xmlns:gml' => 'http://www.opengis.net/gml',\n 'xmlns:geo' => 'http://a9.com/-/opensearch/extensions/geo/1.0/',\n 'xmlns:eo' => 'http://a9.com/-/opensearch/extensions/eo/1.0/',\n 'xmlns:metalink' => 'urn:ietf:params:xml:ns:metalink',\n 'xmlns:xlink' => 'http://www.w3.org/1999/xlink',\n 'xmlns:media' => 'http://search.yahoo.com/mrss/',\n 'xmlns:resto' => 'http://snapplanet.io/resto'\n ));\n }", "public function xmlOutput()\n {\n return\n '<output>\n <answer>' . $this->answer . '</answer>\n <summary>' . htmlspecialchars($this->summary) . '</summary>\n </output>';\n }", "private function open_xml()\n {\n $xmlw = new XMLWriter();\n $xmlw->openMemory();\n\n if (isset($this->request['fs_curl_debug']) && $this->request['fs_curl_debug'] > 0) {\n $indent = true;\n } else {\n $indent = false;\n }\n $xmlw->setIndent($indent);\n $xmlw->setIndentString(' ');\n\n $xmlw->startDocument('1.0', 'UTF-8', 'no');\n $xmlw->startElement('document');\n $xmlw->writeAttribute('type', 'freeswitch/xml');\n\n return $xmlw;\n }", "protected function startDataSet(PHPUnit_Extensions_Database_DataSet_IDataSet $dataset)\n {\n $this->fh = fopen($this->filename, 'w');\n\n if ($this->fh === FALSE) {\n throw new PHPUnit_Framework_Exception(\n \"Could not open {$this->filename} for writing see \" . __CLASS__ . '::setFileName()'\n );\n }\n\n fwrite($this->fh, \"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" ?>\\n\");\n fwrite($this->fh, \"<dataset>\\n\");\n }", "public function register()\n {\n return [T_DOC_COMMENT_OPEN_TAG];\n\n }", "function post_process() {\n $this->_format_doc_comment();\n }", "public function convert(\\DOMElement $parent, DescriptorAbstract $element)\n {\n $child = new \\DOMElement('docblock');\n $parent->appendChild($child);\n\n $child->setAttribute('line', $element->getLine());\n $package = str_replace('&', '&amp;', ltrim($element->getPackage(), '\\\\'));\n $parent->setAttribute('package', $package ?: 'global');\n\n $this->addSummary($child, $element);\n $this->addDescription($child, $element);\n $this->addTags($child, $element);\n $this->addInheritedFromTag($child, $element);\n\n return $child;\n }", "public function generateXML()\n {\n $xml = new xmlWriter();\n $xml->openMemory();\n $xml->setIndent(true);\n\n $xml->startDocument('1.0', $this->charset);\n\n $xml->startElement('rdf:RDF');\n $xml->writeAttribute('xmlns:rdf', 'http://www.w3.org/1999/02/22-rdf-syntax-ns#');\n $xml->writeAttribute('xmlns', 'http://purl.org/rss/1.0/');\n\n $xml->startElement('channel');\n $xml->writeAttribute('rdf:about', $this->resource);\n\n $xml->writeElement('title', $this->title);\n $xml->writeElement('link', $this->link);\n $xml->writeElement('description', $this->description);\n\n if (!is_null($this->image)) {\n $xml->startElement('image');\n $xml->writeAttribute('rdf:resource', $this->image->url);\n $xml->endElement();\n }\n\n if (!is_null($this->textinput)) {\n $xml->startElement('textinput');\n $xml->writeAttribute('rdf:resource', $this->textinput->uri);\n $xml->endElement();\n }\n\n if (empty($this->items))\n throw new CException(Yii::t('EWebFeed', 'At least one item must exist'));\n $xml->startElement('items');\n $xml->startElement('rdf:Seq');\n foreach ($this->items as $item) {\n $xml->startElement('rdf:li');\n $xml->writeAttribute('resource', $item->uri);\n $xml->endElement();\n }\n $xml->endElement();\n $xml->endElement();\n\n $xml->endElement();\n\n if (!is_null($this->image)) {\n $xml->startElement('image');\n $xml->writeAttribute('rdf:about', $this->image->url);\n $xml->writeElement('title', $this->image->title);\n $xml->writeElement('link', $this->image->link);\n $xml->writeElement('url', $this->image->url);\n $xml->endElement();\n }\n\n if (!is_null($this->textinput)) {\n $xml->startElement('textinput');\n $xml->writeAttribute('rdf:about', $this->textinput->uri);\n $xml->writeElement('title', $this->textinput->title);\n $xml->writeElement('description', $this->textinput->description);\n $xml->writeElement('name', $this->textinput->name);\n $xml->writeElement('link', $this->textinput->link);\n $xml->endElement();\n }\n\n foreach ($this->items as $item) {\n $xml->startElement('item');\n $xml->writeAttribute('rdf:about', $item->uri);\n $xml->writeElement('title', $item->title);\n $xml->writeElement('link', $item->link);\n if ($item->description !== '') $xml->writeElement('description', $item->description);\n $xml->endElement();\n }\n \n $xml->endElement();\n $xml->endDocument();\n\n return $xml->flush();\n }", "public function toXML()\n {\n // TODO: Implement toXML() method.\n }", "public function visitEolCommentAstNode( ezcTemplateEolCommentAstNode $comment )\n {\n $marker = $comment->createMarkerText();\n if ( $comment->hasSeparator )\n {\n $marker .= ' ';\n }\n $this->write( $comment->text . \"\\n\", $marker );\n }", "function write_file_handle( $fh, $prepend_str='' )\n {\n $attrs = array();\n $attr_str = '';\n foreach( $this->attributes as $key => $val )\n {\n $attrs[] = strtoupper($key) . \"=\\\"$val\\\"\";\n }\n if ($attrs) {\n $attr_str = join( \" \", $attrs );\n }\n # Write out the start element\n $tagstr = \"$prepend_str<{$this->name}\";\n if ($attr_str) {\n $tagstr .= \" $attr_str\";\n }\n\n $keys = array_keys( $this->tags );\n $numtags = sizeof( $keys );\n # If there are subtags and no data (only whitespace), \n # then go ahead and add a carriage\n # return. Otherwise the tag should be of this form:\n # <tag>val</tag>\n # If there are no subtags and no data, then the tag should be\n # closed: <tag attrib=\"val\"/>\n $trimmeddata = trim( $this->cdata );\n if ($numtags && ($trimmeddata == \"\")) {\n $tagstr .= \">\\n\";\n }\n elseif (!$numtags && ($trimmeddata == \"\")) {\n $tagstr .= \"/>\\n\";\n }\n else {\n $tagstr .= \">\";\n }\n\n fwrite( $fh, $tagstr );\n\n # Write out the data if it is not purely whitespace\n if ($trimmeddata != \"\") {\n fwrite( $fh, $trimmeddata );\n }\n\n # Write out each subtag\n foreach( $keys as $k ) {\n $this->tags[$k]->write_file_handle( $fh, \"$prepend_str\\t\" );\n }\n\n # Write out the end element if necessary\n if ($numtags || ($trimmeddata != \"\")) {\n $tagstr = \"</{$this->name}>\\n\";\n if ($numtags) {\n $tagstr = \"$prepend_str$tagstr\";\n }\n fwrite( $fh, $tagstr );\n }\n }", "public function saveXml()\n\t{\n\t\t$doc = new DOMDocument($this->getVersion(), $this->getEncoding());\n\n\t\t$root = $doc->createElement('rss');\n\t\t$root->setAttribute('version', $this->getRssVersion());\n\t\t$doc->appendChild($root);\n\n\t\t$channel = $doc->createElement('channel');\n\t\t$root->appendChild($channel);\n\n\t\t$title = $doc->createElement('title', $this->getTitle());\n\t\t$channel->appendChild($title);\n\n\t\t$id = $doc->createElement('link', $this->getLink());\n\t\t$channel->appendChild($id);\n\n\t\t$id = $doc->createElement('description', htmlspecialchars($this->getDescription()));\n\t\t$channel->appendChild($id);\n\n\t\tforeach ($this->elements as $element)\n\t\t{\n\t\t\t$item = $doc->createElement('item');\n\t\t\t$channel->appendChild($item);\n\n\t\t\t$title = $doc->createElement('title', $element->getTitle());\n\t\t\t$item->appendChild($title);\n\n\t\t\t$pubDate = $doc->createElement('pubDate', date('Y-m-d H:i:s', $element->getPubDate()));\n\t\t\t$item->appendChild($pubDate);\n\t\t\t\n\t\t\t$link = $doc->createElement('link', $element->getLink());\n\t\t\t$item->appendChild($link);\t\t\t\n\n\t\t\tif ($element->getDescription())\n\t\t\t{\n\t\t\t\t$summary = $doc->createElement('description', htmlspecialchars($element->getDescription()));\n\t\t\t\t$item->appendChild($summary);\n\t\t\t}\n\t\t}\n\t\t\n\t\t$doc->formatOutput = true;\n\t\treturn $doc->saveXml();\n\t}", "public function build()\n {\n return $this->generateXml();\n }", "public function toXML();", "final protected function formatFileContentAsXML()\n {\n $XML = new \\DOMDocument('1.0');\n $XML->preserveWhiteSpace = false;\n $XML->loadXML( $this->FileContent );\n $XML->formatOutput = true;\n\n $this->FileContent = $XML->saveXML();\n }", "protected function writeHeader()\n {\n fwrite( $this->fd,\n \"<?php\\n\" );\n }", "public function generate() {\n\t\t\t$this->Wrapper->appendChild($this->Header);\n\t\t\t$this->Wrapper->appendChild($this->Contents);\n\t\t\t$this->Wrapper->appendChild($this->Footer);\n\n\t\t\t$this->Body->appendChild($this->Wrapper);\n\n\t\t\t$this->__appendBodyId();\n\t\t\t$this->__appendBodyClass($this->_context);\n\t\t\treturn parent::generate();\n\t\t}", "private function startDocumentSchema() {\n $this->xmlSchema = '<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n <?mso-application progid=\"Excel.Sheet\"?>\n <Workbook\n xmlns=\"urn:schemas-microsoft-com:office:spreadsheet\"\n xmlns:o=\"urn:schemas-microsoft-com:office:office\"\n xmlns:x=\"urn:schemas-microsoft-com:office:excel\"\n xmlns:ss=\"urn:schemas-microsoft-com:office:spreadsheet\"\n xmlns:html=\"http://www.w3.org/TR/REC-html40\">\n ';\n }", "public function visitBlockCommentAstNode( ezcTemplateBlockCommentAstNode $comment )\n {\n // Comment output.\n\n // if ( $comment->hasSeparator )\n // {\n // $startMarker = '/* ';\n // $endMarker = ' */';\n // }\n // else\n // {\n // $startMarker = '/*';\n // $endMarker = '*/';\n // }\n // $this->write( $startMarker . $comment->text . $endMarker . \"\\n\" );\n }", "public function createXML() {}", "public function writeXmlResourceList() {\n // Neues XMLWriter-Objekt\n $this->xmlwriter = new \\XMLWriter();\n\n // Dokumenteneigenschaften\n $this->xmlwriter->openMemory();\n $this->xmlwriter->setIndent(TRUE);\n $this->xmlwriter->startDocument('1.0');\n // Document Type Definition (DTD)\n $this->xmlwriter->startDtd('resourcelist');\n $this->xmlwriter->writeDtdElement('resourcelist', '(file)');\n $this->xmlwriter->writeDtdElement('file', '(uid,pid,tstamp,crdate,type,storage,identifier,extension,mime_type,name,title,sha1,size,creation_date,modification_date,width,height,uuid)');\n $this->xmlwriter->writeDtdElement('uid', '(#PCDATA)');\n $this->xmlwriter->writeDtdElement('pid', '(#PCDATA)');\n $this->xmlwriter->writeDtdElement('tstamp', '(#PCDATA)');\n $this->xmlwriter->writeDtdElement('crdate', '(#PCDATA)');\n $this->xmlwriter->writeDtdElement('type', '(#PCDATA)');\n $this->xmlwriter->writeDtdElement('storage', '(#PCDATA)');\n $this->xmlwriter->writeDtdElement('identifier', '(#PCDATA)');\n $this->xmlwriter->writeDtdElement('extension', '(#PCDATA)');\n $this->xmlwriter->writeDtdElement('mime_type', '(#PCDATA)');\n $this->xmlwriter->writeDtdElement('name', '(#PCDATA)');\n $this->xmlwriter->writeDtdElement('title', '(#PCDATA)');\n $this->xmlwriter->writeDtdElement('sha1', '(#PCDATA)');\n $this->xmlwriter->writeDtdElement('size', '(#PCDATA)');\n $this->xmlwriter->writeDtdElement('creation_date', '(#PCDATA)');\n $this->xmlwriter->writeDtdElement('modification_date', '(#PCDATA)');\n $this->xmlwriter->writeDtdElement('width', '(#PCDATA)');\n $this->xmlwriter->writeDtdElement('height', '(#PCDATA)');\n $this->xmlwriter->writeDtdElement('uuid', '(#PCDATA)');\n $this->xmlwriter->endDtd();\n\n // Daten schreiben\n $this->xmlwriter->startElement('resourcelist');\n\n foreach ($this->fileList as $file) {\n $this->xmlwriter->startElement('file');\n $this->xmlwriter->writeElement('uid', $file->getUid());\n $this->xmlwriter->writeElement('pid', $file->getPid());\n $this->xmlwriter->writeElement('tstamp', $file->getTstamp());\n $this->xmlwriter->writeElement('crdate', $file->getCrdate());\n $this->xmlwriter->writeElement('type', $file->getType());\n $this->xmlwriter->writeElement('storage', $file->getStorage());\n $this->xmlwriter->writeElement('identifier', $file->getIdentifier());\n $this->xmlwriter->writeElement('extension', $file->getExtension());\n $this->xmlwriter->writeElement('mime_type', $file->getMimeType());\n $this->xmlwriter->writeElement('name', $file->getName());\n $this->xmlwriter->writeElement('title', $file->getTitle());\n $this->xmlwriter->writeElement('sha1', $file->getSha1());\n $this->xmlwriter->writeElement('size', $file->getSize());\n $this->xmlwriter->writeElement('creation_date', $file->getCreationDate());\n $this->xmlwriter->writeElement('modification_date', $file->getModificationDate());\n $this->xmlwriter->writeElement('width', $file->getWidth());\n $this->xmlwriter->writeElement('height', $file->getHeight());\n $this->xmlwriter->writeElement('uuid', $this->getUuid($file->getUid(), 'sys_file'));\n $this->xmlwriter->endElement();\n }\n\n $this->xmlwriter->endElement();\n $this->xmlwriter->endElement();\n $this->xmlwriter->endDocument();\n $writeString = $this->xmlwriter->outputMemory();\n\n $file = GeneralUtility::tempnam('resource_');\n GeneralUtility::writeFile($file, $writeString);\n\n $folder = GeneralUtility::getIndpEnv('TYPO3_DOCUMENT_ROOT') . GeneralUtility::getIndpEnv('TYPO3_SITE_PATH') . 'fileadmin/deployment/media/' . date('Y_m_d', time());\n GeneralUtility::mkdir($folder);\n\n GeneralUtility::upload_copy_move($file, $folder . '/' . date('H-i-s', time()) . '_resource.xml');\n }", "public function generate_eof()\n {\n $this->xml->endDocument();\n $result = $this->xml->outputMemory();\n print $result;\n }", "private function _print_xml_close()\n\t{\n\t\techo \"</document>\";\n\t}", "public function StartOB() {\n ob_start();\n echo \"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?>\";\n echo \"<urlset xmlns=\\\"http://www.sitemaps.org/schemas/sitemap/0.9\\\">\";\n echo \"\\r\\n\";\n }", "public function toString()\n {\n /*\n * End feed element\n */\n $this->endElement();\n \n /*\n * Write result\n */\n return parent::toString();\n }", "function toXml() {\n $domtree = new DOMDocument('1.0', 'UTF-8');\n $this->addSelfToDocument($domtree, $domtree);\n return $domtree->saveXML();\n }", "protected function endDocument()\n {\n $this->writer->endElement();\n $this->writer->endElement();\n }", "public function writeXmlContents(\\XMLWriter $writer)\n {\n parent::writeXmlContents($writer);\n if ($this->originalLabel) {\n $writer->startElementNs('gx', 'originalLabel', null);\n $writer->text($this->originalLabel);\n $writer->endElement();\n }\n if ($this->description) {\n foreach ($this->description as $i => $x) {\n $writer->startElementNs('gx', 'description', null);\n $x->writeXmlContents($writer);\n $writer->endElement();\n }\n }\n if ($this->values) {\n foreach ($this->values as $i => $x) {\n $writer->startElementNs('gx', 'value', null);\n $x->writeXmlContents($writer);\n $writer->endElement();\n }\n }\n }", "private function comments2xml($xml_obj, $comments, $space_pad = 0)\n {\n $comment_count = count($comments);\n for ($i = 0; $i < $comment_count; $i++) {\n if (array_key_exists($i, $comments)) {\n if (!is_array($comments[$i])) {\n $xml_obj->writeComment(\" \" . $comments[$i] . \" \");\n } else {\n $this->comments2xml($xml_obj, $comments[$i], $space_pad + 2);\n }\n }\n }\n }", "private function createXmlComment($user, $comment = null){\n if($comment == null){\n $comment = new Comment;\n if(isset($user->text) && isset($user->date)){ //objekty user aj comment su zlucene do jedneho\n $comment->text = $user->text;\n $comment->date = $user->date;\n $comment->id = $user->id;\n }\n }\n $xml_part = '<comment>';\n $xml_part .= '<id>';\n $xml_part .= $comment->id;\n $xml_part .= '</id>';\n $xml_part .= '<fullname>';\n $xml_part .= $user->fullname;\n $xml_part .= '</fullname>';\n $xml_part .= '<link>';\n $xml_part .= Yii::app()->params->homePath.'/'.Yii::app()->language.'/user/view/'.$user->username;\n $xml_part .= '</link>';\n\n $xml_part .= '<picture>';\n if($user->profile_picture != '' && ($pic = $this->getPicture($user->profile_picture, 'profile-picture'))!= null){\n $xml_part .= $pic;\n }\n else{\n $xml_part .= Yii::app()->request->baseUrl.'/images/photo-default-'.$user->gender.'.png';\n }\n $xml_part .= '</picture>';\n\n $xml_part .= '<text>';\n $xml_part .= $comment->text;\n $xml_part .= '</text>';\n $xml_part .= '<date>';\n $xml_part .= date('G:i, d. m. Y',strtotime($comment->date));\n $xml_part .= '</date>';\n $xml_part .= '</comment>';\n \n return $xml_part;\n }", "function toScreen(){\n\t\t\tif($content = $this->process()){\n\t\t\t\techo \"<pre>\";\n\t\t\t\techo nl2br(htmlspecialchars($content));\n\t\t\t\techo \"</pre>\";\n\t\t\t\t\n\t\t\t\techo $content;\n\t\t\t}else{\n\t\t\t\ttrigger_error(\"An error occured during XML Data generation\",1);\n\t\t\t}\n\t\t}", "public function addComment($comment, $packageId = null)\n {\n if (null === $this->_htmlHeadEntrySet) {\n throw new Zap_Exception(\n sprintf(\n \"Child class '%s' did not \".\n 'instantiate a HTML head entry set. This should be done in '.\n 'the constructor either by calling parent::__construct() or '.\n 'by creating a new HTML head entry set.', get_class($this)\n )\n );\n }\n\n $this->_htmlHeadEntrySet->addEntry(\n new SwatCommentHtmlHeadEntry($comment, $packageId)\n );\n }", "public function getDocComment();", "function write_file($opt,$xml)\n {\n if ($opt->write_to_file) { //write to file\n if (($out_file = fopen($opt->out_filename, \"w\")) === false) {\n err(\"Could not open file $opt->out_filename\",3);\n }\n if ((fwrite($out_file,$xml->outputMemory(TRUE))) === false){\n err(\"Could not write to file\",3);\n }\n if (!fclose($out_file)) {\n err(\"Could not close the file\",3);\n }\n }\n else fwrite(STDOUT,$xml->outputMemory(TRUE)); //write to stdout\n\n }", "public function toXML()\n {\n $namespace = 'tns';\n $writer = new XMLWriter();\n $writer->openMemory();\n $writer->setIndent(true);\n $writer->setIndentString(' ');\n $writer->startElementNs($namespace, 'BrRac', null);\n $writer->writeElementNs($namespace, 'BrOznRac', null, $this->getInvoiceNumber());\n $writer->writeElementNs($namespace, 'OznPosPr', null, $this->getBusinessLocationCode());\n $writer->writeElementNs($namespace, 'OznNapUr', null, $this->getPaymentDeviceCode());\n $writer->endElement();\n\n return $writer->outputMemory();\n }", "public function write( ) : string\n {\n $doc = new \\DOMDocument( '1.0', 'UTF-8' );\n\n $index = $doc->createElement( 'sitemapindex' );\n $index->setAttribute(\n 'xmlns',\n 'http://www.sitemaps.org/schemas/sitemap/0.9'\n );\n\n $doc->appendChild( $index );\n\n foreach( $this->sitemaps as $sitemap ) {\n /** @var Sitemap $sitemap */\n $el = $doc->createElement( 'sitemap' );\n $el->appendChild( $doc->createElement( 'loc', $sitemap->getLocation( ) ) );\n if ( $sitemap->getLastModified( ) ) {\n $el->appendChild(\n $doc->createElement( 'lastmod',\n $sitemap->getLastModified( )->format( 'Y-m-d' ) )\n );\n }\n $index->appendChild( $el );\n }\n\n return $doc->saveXML( );\n }", "protected function renderAsXML() {}", "public function setComment(Comment $comment): void;", "function XML(){\n\t\t$this->__construct();\n\t\t$this->Set_Template( 'header', 'rss/header-xml.php' );\n\t\t$this->Set_Template( 'footer', 'rss/footer-xml.php' );\n\t}", "public static function exportXML()\n {\n $xml = new \\XMLWriter();\n $xml->openMemory();\n $xml->setIndent(true);\n $xml->setIndentString(\"\t\");\n $xml->startDocument(\"1.0\", \"UTF-8\");\n $xml->startElement(\"productos\");\n $productos = self::findAll();\n foreach ($productos as $producto) {\n $xml->startElement(\"producto\");\n $xml->writeAttribute(\"id\", $producto->getId());\n $xml->writeElement(\"nombre\", $producto->getNombre());\n $xml->writeElement(\"descripcion\", $producto->getDescripcion());\n $urlImagen = $producto->getImagen() ? BASE_URL.\"/productos/{$producto->getId()}?image=1\": \"\";\n $xml->writeElement(\"imagen\", $urlImagen);\n if($categoria = $producto->getCategoria()) {\n $xml->startElement(\"categoria\");\n $xml->writeAttribute(\"id\", $categoria->getId());\n $xml->writeElement(\"nombre\", $categoria->getNombre());\n $xml->writeElement(\"descripcion\", $categoria->getDescripcion());\n $xml->endElement();\n }\n $xml->endElement();\n }\n $xml->endElement();\n return $xml->outputMemory();\n }", "function XMLsetContent($data) {\n $this->contentBuffer = $data;\n $this->currentFile = '';\n }", "public function writeXmlContents($writer)\n {\n parent::writeXmlContents($writer);\n if ($this->father) {\n $writer->startElementNs('fs', 'father', null);\n $this->father->writeXmlContents($writer);\n $writer->endElement();\n }\n if ($this->mother) {\n $writer->startElementNs('fs', 'mother', null);\n $this->mother->writeXmlContents($writer);\n $writer->endElement();\n }\n if ($this->child) {\n $writer->startElementNs('fs', 'child', null);\n $this->child->writeXmlContents($writer);\n $writer->endElement();\n }\n if ($this->fatherFacts) {\n foreach ($this->fatherFacts as $i => $x) {\n $writer->startElementNs('fs', 'fatherFact', null);\n $x->writeXmlContents($writer);\n $writer->endElement();\n }\n }\n if ($this->motherFacts) {\n foreach ($this->motherFacts as $i => $x) {\n $writer->startElementNs('fs', 'motherFact', null);\n $x->writeXmlContents($writer);\n $writer->endElement();\n }\n }\n }", "public function __toString() {\n return $this->getDocument()->saveXml();\n }", "public final function startTag() : string\n {\n return $this->name ? '<' . $this->name . $this->attributes() . (static::$xhtml && $this->isEmpty ? ' />' : '>') : '';\n }", "public function generateDocblock();", "function write_referentiel() {\r\n \tglobal $CFG;\r\n // initial string;\r\n $expout = \"\";\r\n // add comment\r\n\t\t// $referentiel\r\n\t\tif ($this->referentiel){\r\n\t\t\t$id = $this->writeraw( $this->referentiel->id );\r\n $name = $this->writeraw( trim($this->referentiel->name) );\r\n $code_referentiel = $this->writeraw( trim($this->referentiel->code_referentiel));\r\n $description_referentiel = $this->writetext(trim($this->referentiel->description_referentiel));\r\n $url_referentiel = $this->writeraw( trim($this->referentiel->url_referentiel) );\r\n\t\t\t$seuil_certificat = $this->writeraw( $this->referentiel->seuil_certificat );\r\n\t\t\t$minima_certificat = $this->writeraw( $this->referentiel->minima_certificat );\r\n\r\n\t\t\t$timemodified = $this->writeraw( $this->referentiel->timemodified );\r\n\t\t\t$nb_domaines = $this->writeraw( $this->referentiel->nb_domaines );\r\n\t\t\t$liste_codes_competence = $this->writeraw( trim($this->referentiel->liste_codes_competence) );\r\n\t\t\t$liste_empreintes_competence = $this->writeraw( trim($this->referentiel->liste_empreintes_competence) );\r\n\t\t\t$local = $this->writeraw( $this->referentiel->local );\r\n\t\t\t$logo_referentiel = $this->writeraw( $this->referentiel->logo_referentiel );\r\n\r\n\t\t\t// $expout .= \"<id>$id</id>\\n\";\r\n\t\t\t$expout .= \" <name>$name</name>\\n\";\r\n\t\t\t$expout .= \" <code_referentiel>$code_referentiel</code_referentiel>\\n\";\r\n $expout .= \" <description_referentiel>\\n$description_referentiel</description_referentiel>\\n\";\r\n $expout .= \" <url_referentiel>$url_referentiel</url_referentiel>\\n\";\r\n\r\n $expout .= \" <seuil_certificat>$seuil_certificat</seuil_certificat>\\n\";\r\n\r\n $expout .= \" <minima_certificat>$minima_certificat</minima_certificat>\\n\";\r\n $expout .= \" <timemodified>$timemodified</timemodified>\\n\";\r\n $expout .= \" <nb_domaines>$nb_domaines</nb_domaines>\\n\";\r\n $expout .= \" <liste_codes_competence>$liste_codes_competence</liste_codes_competence>\\n\";\r\n $expout .= \" <liste_empreintes_competence>$liste_empreintes_competence</liste_empreintes_competence>\\n\";\r\n\t\t\t// $expout .= \" <local>$local</local>\\n\";\r\n\t\t\t// PAS DE LOGO ICI\r\n\t\t\t// $expout .= \" <logo_referentiel>$logo_referentiel</logo_referentiel>\\n\";\r\n\r\n\t\t\t// MODIF JF 2012/03/09\r\n\t\t\t// PROTOCOLE\r\n if (!empty($this->referentiel->id)){\r\n if ($record_protocol=referentiel_get_protocol($this->referentiel->id)){\r\n $expout .= $this->write_protocol( $record_protocol );\r\n }\r\n }\r\n\r\n\t\t\t// DOMAINES\r\n\t\t\tif (isset($this->referentiel->id) && ($this->referentiel->id>0)){\r\n\t\t\t\t// LISTE DES DOMAINES\r\n\t\t\t\t$compteur_domaine=0;\r\n\t\t\t\t$records_domaine = referentiel_get_domaines($this->referentiel->id);\r\n\t\t \tif ($records_domaine){\r\n \t\t\t\t// afficher\r\n\t\t\t\t\t// DEBUG\r\n\t\t\t\t\t// echo \"<br/>DEBUG ::<br />\\n\";\r\n\t\t\t\t\t// print_r($records_domaine);\r\n\t\t\t\t\tforeach ($records_domaine as $record_d){\r\n\t\t\t\t\t\t// DEBUG\r\n\t\t\t\t\t\t// echo \"<br/>DEBUG ::<br />\\n\";\r\n\t\t\t\t\t\t// print_r($records_domaine);\r\n\t\t\t\t\t\t$expout .= $this->write_domaine( $record_d );\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n }\r\n return $expout;\r\n }", "public function getCommentHTML() {\n return str_replace(\"\\n\", \"<br />\", trim(str_replace(array(\"/*\", \"*\"), array(\"\", \"\"), $this->getComment())));\n }", "function renderComments(Element $element)\n {\n return '';\n }", "public function StartOB() {\n ob_start();\n echo \"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?>\";\n echo \"\\r\\n\";\n echo \"<sitemapindex xmlns=\\\"http://www.sitemaps.org/schemas/sitemap/0.9\\\">\";\n echo \"\\r\\n\";\n }", "public function generate()\n {\n $this->document = new \\DOMDocument('1.0', 'utf-8');\n $this->document->formatOutput = true;\n\n $rootEl = $this->document->createElementNS($this->nsUrl, 'gupdate');\n $rootEl->setAttribute('protocol', '2.0');\n $this->document->appendChild($rootEl);\n\n $appId = $this->idGenerator->getAppId();\n $appEl = $this->document->createElementNS($this->nsUrl, 'app');\n $appEl->setAttribute('appid', $appId);\n $rootEl->appendChild($appEl);\n\n $updateCheckEl = $this->document->createElementNS($this->nsUrl, 'updatecheck');\n $updateCheckEl->setAttribute('codebase', $this->packageUrl);\n $updateCheckEl->setAttribute('version', $this->package->getPackageVersion());\n $appEl->appendChild($updateCheckEl);\n }", "public function configurationToXML( DOMElement $element )\n {\n $element->setAttribute( 'variable', $this->configuration['name'] );\n $element->setAttribute( 'operand', $this->configuration['operand'] );\n }", "public function generate() \r\n\t{\t\r\n\t\tparent::generate();\r\n\t\r\n\t\t$this->schemaXml = new SimpleXMLElement(file_get_contents( $this->_xmlFile ));\r\n\t\t\r\n\t\t//parse object types\r\n\t\tforeach ($this->schemaXml->children() as $reflectionType) \r\n\t\t{\r\n\t\t\tswitch($reflectionType->getName())\r\n\t\t\t{\r\n\t\t\t\tcase \"enums\":\r\n\t\t\t\t\t//create enum classes\r\n\t\t\t\t\tforeach($reflectionType->children() as $enums_node)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$this->writeEnum($enums_node);\r\n\t\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\t\tcase \"classes\":\r\n\t\t\t\t\t//create object classes\r\n\t\t\t\t\tforeach($reflectionType->children() as $classes_node)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$this->writeObjectClass($classes_node);\r\n\t\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\t\tcase \"services\":\r\n\t\t\t\t\t//implement services (api actions)\r\n\t\t\t\t\tforeach($reflectionType->children() as $services_node)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$this->writeService($services_node);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t//write main class (if needed, this can also be included in the static sources folder if not dynamic)\r\n\t\t\t\t\t$this->writeMainClass($reflectionType->children());\r\n\t\t\t\tbreak;\t\r\n\t\t\t}\r\n\t\t}\r\n\t\t$this->addFile('KalturaTypes.js', $this->enumTypes);\r\n\t\t$this->addFile('KalturaVO.js', $this->voClasses);\r\n\t\t$this->addFile('KalturaServices.js', $this->serviceClasses);\r\n\t\t$this->addFile('KalturaClient.js', $this->mainClass);\r\n\t\t//write project file (if needed, this can also be included in the static sources folder if not dynamic)\r\n\t\t$this->writeProjectFile();\r\n\t}", "protected function _emitComment($ast) {\n echo \"/{$ast['value']}/\\n\";\n }", "protected function _emitComment($ast) {\n echo \"/{$ast['value']}/\\n\";\n }", "function write_competence( $competence ) {\r\n global $CFG;\r\n // initial string;\r\n $expout = \"\";\r\n // add comment\r\n // $expout .= \"\\n\\n<!-- competence: $competence->id -->\\n\";\r\n\t\t//\r\n\t\tif ($competence){\r\n\t\t\t$id = $this->writeraw( $competence->id );\r\n $code = $this->writeraw( trim($competence->code_competence));\r\n $description_competence = $this->writetext(trim($competence->description_competence));\r\n $ref_domaine = $this->writeraw( $competence->ref_domaine);\r\n\t\t\t$num_competence = $this->writeraw( $competence->num_competence);\r\n\t\t\t$nb_item_competences = $this->writeraw( $competence->nb_item_competences);\r\n\r\n\t\t\t$type_competence = $this->writeraw( trim($competence->type_competence));\r\n\t\t\t$seuil_competence = $this->writeraw( trim($competence->seuil_competence));\r\n\r\n\t\t\t$minima_competence = $this->writeraw( trim($competence->minima_competence));\r\n\r\n $expout .= \" <competence>\\n\";\r\n\t\t\t// $expout .= \"<id>$id</id>\\n\";\r\n\t\t\t$expout .= \" <code_competence>$code</code_competence>\\n\";\r\n $expout .= \" <description_competence>\\n$description_competence</description_competence>\\n\";\r\n\r\n $expout .= \" <type_competence>$type_competence</type_competence>\\n\";\r\n $expout .= \" <seuil_competence>$seuil_competence</seuil_competence>\\n\";\r\n\r\n $expout .= \" <minima_competence>$minima_competence</minima_competence>\\n\";\r\n\r\n // $expout .= \" <ref_domaine>$ref_domaine</ref_domaine>\\n\";\r\n $expout .= \" <num_competence>$num_competence</num_competence>\\n\";\r\n $expout .= \" <nb_item_competences>$nb_item_competences</nb_item_competences>\\n\\n\";\r\n\r\n\t\t\t// ITEM\r\n\t\t\t$compteur_item=0;\r\n\t\t\t$records_items = referentiel_get_item_competences($competence->id);\r\n\r\n\t\t\tif ($records_items){\r\n\t\t\t\t// DEBUG\r\n\t\t\t\t// echo \"<br/>DEBUG :: ITEMS <br />\\n\";\r\n\t\t\t\t// print_r($records_items);\r\n\t\t\t\tforeach ($records_items as $record_i){\r\n\t\t\t\t\t// DEBUG\r\n\t\t\t\t\t// echo \"<br/>DEBUG :: ITEM <br />\\n\";\r\n\t\t\t\t\t// print_r($record_i);\r\n\t\t\t\t\t$expout .= $this->write_item( $record_i );\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t$expout .= \" </competence>\\n\\n\";\r\n }\r\n return $expout;\r\n }", "public function open_xml_writer() {\n\n if (is_null($this->get_xml_filename())) {\n throw new convert_exception('handler_not_expected_to_write_xml');\n }\n\n if (!$this->xmlwriter instanceof xml_writer) {\n $fullpath = $this->converter->get_workdir_path() . '/' . $this->get_xml_filename();\n $directory = pathinfo($fullpath, PATHINFO_DIRNAME);\n\n if (!check_dir_exists($directory)) {\n throw new convert_exception('unable_create_target_directory', $directory);\n }\n $this->xmlwriter = new xml_writer(new file_xml_output($fullpath));\n $this->xmlwriter->start();\n }\n }", "public function register()\n {\n return array(T_DOC_COMMENT_OPEN_TAG);\n }", "public function write(\\Iterator $input_iterator, string $filename)\n {\n $document = new \\DOMDocument('1.0', 'utf-8');\n\n // Start document\n $html = $document->appendChild(\n $document->createElement('html')\n );\n\n $head = $html->appendChild(\n $document->createElement('head')\n );\n\n // Set up document styles\n $style = $head->appendChild(\n $document->createElement('style')\n );\n\n $style_attr_type = $document->createAttribute('type');\n $style_attr_type->value = 'text/css';\n $style->appendChild($style_attr_type);\n\n $style_fragment = $document->createDocumentFragment();\n\n $style_fragment->appendXML(\n 'rt { font-size: 0.7em; }'\n );\n\n $style->appendChild($style_fragment);\n\n $body = $html->appendChild(\n $document->createElement('body')\n );\n\n $p = $document->createElement('p');\n $body->appendChild($p);\n\n foreach ($input_iterator as $input) {\n $tag = $input['type'];\n if ($tag == 'br') {\n $p = $document->createElement('p');\n $body->appendChild($p);\n } else if ($tag == 'wordgroup') {\n foreach ($input['content'] as $word) {\n if (isset($word['furigana'])) {\n // Create containing ruby element.\n $ruby = $document->createElement('ruby', $word['content']);\n // Add fallback parenthesis\n $ruby->appendChild(\n $document->createElement('rp', '(')\n );\n // Add ruby text.\n $ruby->appendChild(\n $document->createElement('rt', $word['furigana'])\n );\n // Add fallback parenthesis\n $ruby->appendChild(\n $document->createElement('rp', ')')\n );\n $p->appendChild($ruby);\n } else {\n $p->appendChild($document->createTextNode($word['content']));\n }\n }\n } else {\n $p->appendChild($document->createTextNode($input['content']));\n }\n }\n\n // Saving as XML file, instead of using SaveHTMLFile, so that the text is not converted\n // into entities.\n file_put_contents($filename, $document->saveXML());\n }", "public function getDocStructure()\n {\n\n $xml_string = '<?xml version=\"1.0\" encoding=\"UTF-8\"?><urlset xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\" xmlns:image=\"http://www.google.com/schemas/sitemap-image/1.1\">';\n $xml_string .= '</urlset>';\n\n return $xml_string;\n\n }", "protected function writeView()\n {\n $view = $this->getView();\n\n $path = $this->unitPath('Resources/views').'/'.str_replace('.', '/', 'components.'.$view);\n\n if (! $this->files->isDirectory(dirname($path))) {\n $this->files->makeDirectory(dirname($path), 0777, true, true);\n }\n\n file_put_contents(\n $path.'.blade.php',\n '<div>\n <!-- '.Inspiring::quote().' -->\n</div>'\n );\n }", "public function generate()\n {\n $this->xml = new DOMDocument( '1.0', 'utf-8' );\n $this->xml->formatOutput = 1;\n\n $rss = $this->xml->createElementNS( self::NAMESPACE_URI, 'feed' );\n $this->channel = $rss;\n $this->root = $this->xml->appendChild( $rss );\n\n $this->generateRequired();\n $this->generateAtLeastOne();\n $this->generateOptional();\n $this->generateFeedModules( $this->channel );\n $this->generateItems();\n\n return $this->xml->saveXML();\n }", "public function writeXml(\\XMLWriter $xmlWriter)\n {\n $xmlWriter->startElementNS(\n 'atom',\n Resources::LINK,\n Resources::ATOM_NAMESPACE\n );\n $this->writeInnerXml($xmlWriter);\n $xmlWriter->endElement();\n }", "public function write($content);", "public function openTag()\n {\n $this->writer->write('<?php' . PHP_EOL);\n return $this;\n }", "protected function createDocComment()\n {\n $comment = parent::getDocComment();\r\n if ($comment === false) {\r\n return false;\r\n }\n return new AspectPHP_Reflection_DocComment($comment);\n }", "public function createDocumentElement() {\n\t\t$this->node = $this->getDocument ()->createElement ( 'submitCartRequest' );\n\t\t$this->node->setAttribute ( 'xmlns', self::XMLNS_CHECKOUT );\n\t\t$this->node->setAttribute ( 'xmlns:common', self::XMLNS_COMMON );\n\t\t$this->node->setAttribute ( 'version', '1.0' );\n\t\t$this->getDocument ()->appendChild ( $this->node );\n\t}", "public function getDocument(){\n $this->endElement();\n $this->endDocument();\n return $this->outputMemory();\n }", "public function register()\n {\n return array(T_DOC_COMMENT_OPEN_TAG);\n\n }", "function Comment($content) {\n\n /* Variablen initialisieren */\n $this->content = $content;\n }", "public function setOutput()\n\t{\n\t\t$this->createBuilder();\n\t\t$this->builder->setOutput();\n\t}", "function toXML()\n {\n // Not implemented yet.\n }", "public function toXml() : string\n {\n return $this->toDomDocument()->saveXML();\n }", "public function outerXml() {\r\n return \"<![CDATA[\".$this->value().\"]]>\";\r\n }", "public function markHam(CommentInterface $comment);", "public function write (RESTfmDataAbstract $restfmData) {\n $xml = new XmlWriter();\n $xml->openMemory();\n if (RESTfmConfig::getVar('settings', 'formatNicely')) {\n $xml->setIndent(TRUE);\n }\n $xml->startDocument('1.0', 'UTF-8');\n\n $xml->startElement('resource');\n $xml->writeAttribute('xmlns', 'http://www.restfm.com');\n // Deprecated. We don't use xlink now as hrefs are now first class\n // meta entities.\n //$xml->writeAttribute('xmlns:xlink', 'http://www.w3.org/1999/xlink');\n\n foreach ($restfmData->getSectionNames() as $sectionName) {\n $xml->startElement($sectionName);\n $this->_writeSection($xml, $restfmData, $sectionName);\n $xml->endElement();\n }\n\n $xml->endElement();\n\n return $xml->outputMemory(TRUE);\n }", "public function actionAddcomment(){\n if(isset($_POST['text'])){\n $comment = new Comment();\n $comment->text = $_POST['text'];\n $comment->id_trainingentry = $_POST['id_trainingentry'];\n $comment->id_user = Yii::app()->user->id;\n $comment->id_visibility = $_POST['id_visibility'];\n $comment->date = date('Y-m-d G:i:s');\n $comment->seen = 0;\n \n $user = User::model()->findByPk(Yii::app()->user->id);\n \n header('Content-Type: text/xml');\n echo '<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>';\n echo '<response>';\n echo '<validation>';\n if($comment->save()){\n echo 'ok';\n echo '</validation>';\n echo $this->createXmlComment($user, $comment);\n }else{\n echo 'error';\n echo '</validation>';\n }\n echo '</response>';\n }\n }", "public function generateFeed() {\n\t\theader(\"Content-type: text/xml\");\n\t\techo $this->work();\n\t}", "public function write($contents);", "public function writeOutDefinitions()\n {\n $handle = fopen($this->filename, 'w');\n fwrite($handle, $this->__toString());\n fclose($handle);\n }", "public function printContent() {\n\t\t//$this->doc->addStyleSheet();\n\t\t$this->content .= $this->doc->endPage();\n\t\techo $this->doc->insertStylesAndJS($this->content);\n\t}", "public function getSitemapXml()\n {\n $this->addLine('<urlset xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\">');\n\n $this->generateLinks();\n $this->generateCollections();\n\n $this->addLine('</urlset>');\n\n $output = implode('', $this->lines);\n\n return $output;\n }" ]
[ "0.5807985", "0.5413003", "0.5081972", "0.50776887", "0.5058481", "0.49329522", "0.49310818", "0.48391822", "0.476353", "0.4755794", "0.47509232", "0.47179928", "0.46494755", "0.4527898", "0.452504", "0.4471753", "0.44525898", "0.44100818", "0.4405762", "0.43979308", "0.43678045", "0.4363183", "0.43588385", "0.4345217", "0.4343319", "0.43346292", "0.43298885", "0.43207306", "0.4312309", "0.4309039", "0.43083", "0.42748737", "0.42728987", "0.42527568", "0.42516014", "0.4215345", "0.42139325", "0.4209873", "0.41982734", "0.41980314", "0.41939542", "0.41798076", "0.4177944", "0.41720548", "0.41541722", "0.4152445", "0.4149201", "0.41305724", "0.41295642", "0.41169378", "0.41129044", "0.4111514", "0.41038945", "0.4099432", "0.40952098", "0.4094607", "0.4094354", "0.4089275", "0.4089232", "0.4077875", "0.4075576", "0.40718207", "0.4071609", "0.40707687", "0.4069681", "0.40608883", "0.405274", "0.40521675", "0.40507945", "0.40503344", "0.40320036", "0.40319866", "0.40319866", "0.40302822", "0.4029231", "0.4026342", "0.40224993", "0.40196988", "0.4019197", "0.40189233", "0.40166166", "0.40075728", "0.4003435", "0.4003392", "0.40014", "0.39994347", "0.39942393", "0.39901814", "0.3987186", "0.3986667", "0.39859244", "0.39805347", "0.39794967", "0.3979281", "0.3974421", "0.39740717", "0.39715624", "0.3964148", "0.39501527", "0.39456677" ]
0.44742173
15
Run the database seeds.
public function run() { // DB::table('news')->insert([ 'title' => 'Form Kerja Praktik', 'description' => 'Terlampir Form Kerja Praktik sebagai berikut: - Form Pengajuan KP - Form Penilaian Dosen - Form Penilaian Perusahaan', ]); DB::table('news')->insert([ 'title' => 'Silde Alur dan Prosedur KP', 'description' => 'Penjelasan tentang aturan dan alur Kerja Praktik', ]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function run()\n {\n // $this->call(UserTableSeeder::class);\n // $this->call(PostTableSeeder::class);\n // $this->call(TagTableSeeder::class);\n // $this->call(PostTagTableSeeder::class);\n\n /*AB - use faker to populate table see file ModelFactory.php */\n factory(App\\Editeur::class, 40) ->create();\n factory(App\\Auteur::class, 40) ->create();\n factory(App\\Livre::class, 80) ->create();\n\n for ($i = 1; $i < 41; $i++) {\n $number = rand(2, 8);\n for ($j = 1; $j <= $number; $j++) {\n DB::table('auteur_livre')->insert([\n 'livre_id' => rand(1, 40),\n 'auteur_id' => $i\n ]);\n }\n }\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n // Let's truncate our existing records to start from scratch.\n Assignation::truncate();\n\n $faker = \\Faker\\Factory::create();\n \n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 40; $i++) {\n Assignation::create([\n 'ad_id' => $faker->numberBetween(1,20),\n 'buyer_id' => $faker->numberBetween(1,6),\n 'seller_id' => $faker->numberBetween(6,11),\n 'state' => NULL,\n ]);\n }\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n \t$faker = Faker::create();\n\n \tfor($i=0; $i<20; $i++) {\n \t\t$post = new Post;\n \t\t$post->title = $faker->sentence();\n \t\t$post->body = $faker->paragraph();\n \t\t$post->category_id = rand(1, 5);\n \t\t$post->save();\n \t}\n\n \t$list = ['General', 'Technology', 'News', 'Internet', 'Mobile'];\n \tforeach($list as $name) {\n \t\t$category = new Category;\n \t\t$category->name = $name;\n \t\t$category->save();\n \t}\n\n \tfor($i=0; $i<20; $i++) {\n \t\t$comment = new Comment;\n \t\t$comment->comment = $faker->paragraph();\n \t\t$comment->post_id = rand(1,20);\n \t\t$comment->save();\n \t}\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n $this->call(RoleTableSeeder::class);\n $this->call(UserTableSeeder::class);\n \n factory('App\\Cat', 5)->create();\n $tags = factory('App\\Tag', 8)->create();\n\n factory(Post::class, 15)->create()->each(function($post) use ($tags){\n $post->comments()->save(factory(Comment::class)->make());\n $post->tags()->attach( $tags->random(mt_rand(1,4))->pluck('id')->toArray() );\n });\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::table('post')->insert(\n [\n 'title' => 'Test Post1',\n 'desc' => str_random(100).\" post1\",\n 'alias' => 'test1',\n 'keywords' => 'test1',\n ]\n );\n DB::table('post')->insert(\n [\n 'title' => 'Test Post2',\n 'desc' => str_random(100).\" post2\",\n 'alias' => 'test2',\n 'keywords' => 'test2',\n ]\n );\n DB::table('post')->insert(\n [\n 'title' => 'Test Post3',\n 'desc' => str_random(100).\" post3\",\n 'alias' => 'test3',\n 'keywords' => 'test3',\n ]\n );\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n \t$faker = Factory::create();\n \t\n \tforeach ($this->departments as $key => $department) {\n \t\tDepartment::create([\n \t\t\t'name' => $department\n \t\t]);\n \t}\n \tforeach ($this->collections as $key => $collection) {\n \t\tCollection::create([\n \t\t\t'name' => $collection\n \t\t]);\n \t}\n \t\n \t\n \tfor ($i=0; $i < 40; $i++) {\n \t\tUser::create([\n \t\t\t'name' \t=>\t$faker->name,\n \t\t\t'email' \t=>\t$faker->email,\n \t\t\t'password' \t=>\tbcrypt('123456'),\n \t\t]);\n \t} \n \t\n \t\n \tforeach ($this->departments as $key => $department) {\n \t\t//echo ($key + 1) . PHP_EOL;\n \t\t\n \t\tfor ($i=0; $i < 10; $i++) { \n \t\t\techo $faker->name . PHP_EOL;\n\n \t\t\tArt::create([\n \t\t\t\t'name'\t\t\t=> $faker->sentence(2),\n \t\t\t\t'img'\t\t\t=> $this->filenames[$i],\n \t\t\t\t'medium'\t\t=> 'canvas',\n \t\t\t\t'department_id'\t=> $key + 1,\n \t\t\t\t'user_id'\t\t=> $this->userIndex,\n \t\t\t\t'dimension'\t\t=> '18.0 x 24.0',\n\t\t\t\t]);\n \t\t\t\t\n \t\t\t\t$this->userIndex ++;\n \t\t}\n \t}\n \t\n \tdd(\"END\");\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // $this->dataCategory();\n factory(App\\Model\\Category::class, 70)->create();\n factory(App\\Model\\Producer::class, rand(5,10))->create();\n factory(App\\Model\\Provider::class, rand(5,10))->create();\n factory(App\\Model\\Product::class, 100)->create();\n factory(App\\Model\\Album::class, 300)->create();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n\n factory('App\\User', 10 )->create();\n\n $users= \\App\\User::all();\n $users->each(function($user){ factory('App\\Category', 1)->create(['user_id'=>$user->id]); });\n $users->each(function($user){ factory('App\\Tag', 3)->create(['user_id'=>$user->id]); });\n\n\n $users->each(function($user){\n factory('App\\Post', 10)->create([\n 'user_id'=>$user->id,\n 'category_id'=>rand(1,20)\n ]\n );\n });\n\n $posts= \\App\\Post::all();\n $posts->each(function ($post){\n\n $post->tags()->attach(array_unique([rand(1,20),rand(1,20),rand(1,20)]));\n });\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $types = factory(\\App\\Models\\Type::class, 5)->create();\n\n $cities = factory(\\App\\Models\\City::class, 10)->create();\n\n $cities->each(function ($city) {\n $districts = factory(\\App\\Models\\District::class, rand(2, 5))->create([\n 'city_id' => $city->id,\n ]);\n\n $districts->each(function ($district) {\n $properties = factory(\\App\\Models\\Property::class, rand(2, 5))->create([\n 'type_id' => rand(1, 5),\n 'district_id' => $district->id\n ]);\n\n $properties->each(function ($property) {\n $galleries = factory(\\App\\Models\\Gallery::class, rand(3, 10))->create([\n 'property_id' => $property->id\n ]);\n });\n });\n });\n }", "public function run()\n {\n $this->call(UsersTableSeeder::class);\n\n $categories = factory(App\\Models\\Category::class, 10)->create();\n\n $categories->each(function ($category) {\n $category\n ->posts()\n ->saveMany(\n factory(App\\Models\\Post::class, 3)->make()\n );\n });\n }", "public function run()\n {\n $this->call(CategoriesTableSeeder::class);\n\n $users = factory(App\\User::class, 5)->create();\n $recipes = factory(App\\Recipe::class, 30)->create();\n $preparations = factory(App\\Preparation::class, 70)->create();\n $photos = factory(App\\Photo::class, 90)->create();\n $comments = factory(App\\Comment::class, 200)->create();\n $flavours = factory(App\\Flavour::class, 25)->create();\n $flavour_recipe = factory(App\\FlavourRecipe::class, 50)->create();\n $tags = factory(App\\Tag::class, 25)->create();\n $recipe_tag = factory(App\\RecipeTag::class, 50)->create();\n $ingredients = factory(App\\Ingredient::class, 25)->create();\n $ingredient_preparation = factory(App\\IngredientPreparation::class, 300)->create();\n \n \n \n DB::table('users')->insert(['name' => 'SimpleUtilisateur', 'email' => 'simpleadressemail@mail.com', 'password' => bcrypt('SimpleMotDePasse')]);\n \n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n // Sample::truncate();\n // TestItem::truncate();\n // UOM::truncate();\n Role::truncate();\n User::truncate();\n\n // factory(Role::class, 4)->create();\n Role::create([\n 'name'=> 'Director',\n 'description'=> 'Director type'\n ]);\n\n Role::create([\n 'name'=> 'Admin',\n 'description'=> 'Admin type'\n ]);\n Role::create([\n 'name'=> 'Employee',\n 'description'=> 'Employee type'\n ]);\n Role::create([\n 'name'=> 'Technician',\n 'description'=> 'Technician type'\n ]);\n \n factory(User::class, 20)->create()->each(\n function ($user){\n $roles = \\App\\Role::all()->random(mt_rand(1, 2))->pluck('id');\n $user->roles()->attach($roles);\n }\n );\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n UsersLevel::create([\n 'name' => 'Administrator'\n ]);\n\n UsersLevel::create([\n 'name' => 'User'\n ]);\n\n User::create([\n 'username' => 'admin',\n 'password' => bcrypt('admin123'),\n 'level_id' => 1,\n 'fullname' => \"Super Admin\",\n 'email'=> \"admin@admin.com\"\n ]);\n\n\n \\App\\CategoryPosts::create([\n 'name' =>'Paket Trip'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' =>'Destinasi Kuliner'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' => 'Event'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' => 'Profil'\n ]);\n }", "public function run()\n {\n DB::table('users')->insert([\n 'name' => 'Admin',\n 'email' => 'admin@petstore.com',\n 'avatar' => \"avatar\",\n 'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi',\n ]);\n $this->call(CategorySeeder::class);\n // \\App\\Models\\Admin::factory(1)->create();\n \\App\\Models\\User::factory(10)->create();\n // \\App\\Models\\Category::factory(50)->create();\n \\App\\Models\\PetComment::factory(50)->create();\n $pets = \\App\\Models\\Pet::factory(50)->create();\n foreach ($pets as $pet) {\n \\App\\Models\\PetTag::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\PetPhotoUrl::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\Order::factory(1)->create(['pet_id' => $pet->id]);\n };\n }", "public function run()\n { \n\n $this->call(RoleSeeder::class);\n \n $this->call(UserSeeder::class);\n\n Storage::deleteDirectory('socials-icon');\n Storage::makeDirectory('socials-icon');\n $socials = Social::factory(7)->create();\n\n Storage::deleteDirectory('countries-flag');\n Storage::deleteDirectory('countries-firm');\n Storage::makeDirectory('countries-flag');\n Storage::makeDirectory('countries-firm');\n $countries = Country::factory(18)->create();\n\n // Se llenan datos de la tabla muchos a muchos - social_country\n foreach ($countries as $country) {\n foreach ($socials as $social) {\n\n $country->socials()->attach($social->id, [\n 'link' => 'https://www.facebook.com/ministeriopalabrayespiritu/'\n ]);\n }\n }\n\n Person::factory(50)->create();\n\n Category::factory(7)->create();\n\n Video::factory(25)->create(); \n\n $this->call(PostSeeder::class);\n\n Storage::deleteDirectory('documents');\n Storage::makeDirectory('documents');\n Document::factory(25)->create();\n\n }", "public function run()\n {\n $faker = Faker::create('id_ID');\n /**\n * Generate fake author data\n */\n for ($i=1; $i<=50; $i++) { \n DB::table('author')->insert([\n 'name' => $faker->name\n ]);\n }\n /**\n * Generate fake publisher data\n */\n for ($i=1; $i<=50; $i++) { \n DB::table('publisher')->insert([\n 'name' => $faker->name\n ]);\n }\n /**\n * Seeding payment method\n */\n DB::table('payment')->insert([\n ['name' => 'Mandiri'],\n ['name' => 'BCA'],\n ['name' => 'BRI'],\n ['name' => 'BNI'],\n ['name' => 'Pos Indonesia'],\n ['name' => 'BTN'],\n ['name' => 'Indomaret'],\n ['name' => 'Alfamart'],\n ['name' => 'OVO'],\n ['name' => 'Cash On Delivery']\n ]);\n }", "public function run()\n {\n DatabaseSeeder::seedLearningStylesProbs();\n DatabaseSeeder::seedCampusProbs();\n DatabaseSeeder::seedGenderProbs();\n DatabaseSeeder::seedTypeStudentProbs();\n DatabaseSeeder::seedTypeProfessorProbs();\n DatabaseSeeder::seedNetworkProbs();\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n // MyList::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 3; $i++) {\n MyList::create([\n 'title' => 'List-'.($i+1),\n 'color' => $faker->sentence,\n 'icon' => $faker->randomDigitNotNull,\n 'index' => $faker->randomDigitNotNull,\n 'user_id' => 1,\n ]);\n }\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n Products::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few products in our database:\n for ($i = 0; $i < 50; $i++) {\n Products::create([\n 'name' => $faker->word,\n 'sku' => $faker->randomNumber(7, false),\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n User::create([\n 'name' => 'Pablo Rosales',\n 'email' => 'prosales@researchmobile.co',\n 'password' => bcrypt('admin'),\n 'status' => 1,\n 'role_id' => 1,\n 'movil' => 0\n ]);\n\n User::create([\n 'name' => 'Usuario Movil',\n 'email' => 'movil@researchmobile.co',\n 'password' => bcrypt('secret'),\n 'status' => 1,\n 'role_id' => 3,\n 'movil' => 1\n ]);\n\n Roles::create([\n 'name' => 'Administrador'\n ]);\n Roles::create([\n 'name' => 'Operaciones'\n ]);\n Roles::create([\n 'name' => 'Comercial'\n ]);\n Roles::create([\n 'name' => 'Aseguramiento'\n ]);\n Roles::create([\n 'name' => 'Facturación'\n ]);\n Roles::create([\n 'name' => 'Creditos y Cobros'\n ]);\n\n factory(App\\Customers::class, 100)->create();\n }", "public function run()\n {\n // php artisan db:seed --class=StoreTableSeeder\n\n foreach(range(1,20) as $i){\n $faker = Faker::create();\n Store::create([\n 'name' => $faker->name,\n 'desc' => $faker->text,\n 'tags' => $faker->word,\n 'address' => $faker->address,\n 'longitude' => $faker->longitude($min = -180, $max = 180),\n 'latitude' => $faker->latitude($min = -90, $max = 90),\n 'created_by' => '1'\n ]);\n }\n\n }", "public function run()\n {\n DB::table('users')->insert([\n 'name'=>\"test\",\n 'password' => Hash::make('123'),\n 'email'=>'test@yandex.ru'\n ]);\n DB::table('tags')->insert(['name'=>'tags']);\n $this->call(UserSeed::class);\n $this->call(CategoriesSeed::class);\n $this->call(TopicsSeed::class);\n $this->call(CommentariesSeed::class);\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n echo 'seeding permission...', PHP_EOL;\n $permissions = [\n 'role-list',\n 'role-create',\n 'role-edit',\n 'role-delete',\n 'formation-list',\n 'formation-create',\n 'formation-edit',\n 'formation-delete',\n 'user-list',\n 'user-create',\n 'user-edit',\n 'user-delete'\n ];\n foreach ($permissions as $permission) {\n Permission::create(['name' => $permission]);\n }\n echo 'seeding users...', PHP_EOL;\n\n $user= User::create(\n [\n 'name' => 'Mr. admin',\n 'email' => 'admin@yahoo.com',\n 'password' => bcrypt('admin'),\n 'remember_token' => null,\n ]\n );\n echo 'Create Roles...', PHP_EOL;\n Role::create(['name' => 'former']);\n Role::create(['name' => 'learner']);\n Role::create(['name' => 'admin']);\n Role::create(['name' => 'manager']);\n Role::create(['name' => 'user']);\n\n echo 'seeding Role User...', PHP_EOL;\n $user->assignRole('admin');\n $role = $user->assignRole('admin');\n $role->givepermissionTo(Permission::all());\n\n \\DB::table('languages')->insert(['name' => 'English', 'code' => 'en']);\n \\DB::table('languages')->insert(['name' => 'Français', 'code' => 'fr']);\n }", "public function run()\n {\n $this->call(UsersTableSeeder::class);\n $this->call(PermissionsSeeder::class);\n $this->call(RolesSeeder::class);\n $this->call(ThemeSeeder::class);\n\n //\n\n DB::table('paypal_info')->insert([\n 'client_id' => '',\n 'client_secret' => '',\n 'currency' => '',\n ]);\n DB::table('contact_us')->insert([\n 'content' => '',\n ]);\n DB::table('setting')->insert([\n 'site_name' => ' ',\n ]);\n DB::table('terms_and_conditions')->insert(['terms_and_condition' => 'text']);\n }", "public function run()\n {\n $this->call([\n UserSeeder::class,\n ]);\n\n User::factory(20)->create();\n Author::factory(20)->create();\n Book::factory(60)->create();\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(UserSeeder::class);\n $this->call(RolePermissionSeeder::class);\n $this->call(AppmodeSeeder::class);\n\n // \\App\\Models\\Appmode::factory(3)->create();\n \\App\\Models\\Doctor::factory(100)->create();\n \\App\\Models\\Unit::factory(50)->create();\n \\App\\Models\\Broker::factory(100)->create();\n \\App\\Models\\Patient::factory(100)->create();\n \\App\\Models\\Expence::factory(100)->create();\n \\App\\Models\\Testcategory::factory(100)->create();\n \\App\\Models\\Test::factory(50)->create();\n \\App\\Models\\Parameter::factory(50)->create();\n \\App\\Models\\Sale::factory(50)->create();\n \\App\\Models\\SaleItem::factory(100)->create();\n \\App\\Models\\Goption::factory(1)->create();\n \\App\\Models\\Pararesult::factory(50)->create();\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // DB::table('roles')->insert(\n // [\n // ['name' => 'admin', 'description' => 'Administrator'],\n // ['name' => 'student', 'description' => 'Student'],\n // ['name' => 'lab_tech', 'description' => 'Lab Tech'],\n // ['name' => 'it_staff', 'description' => 'IT Staff Member'],\n // ['name' => 'it_manager', 'description' => 'IT Manager'],\n // ['name' => 'lab_manager', 'description' => 'Lab Manager'],\n // ]\n // );\n\n // DB::table('users')->insert(\n // [\n // 'username' => 'admin', \n // 'password' => Hash::make('password'), \n // 'active' => 1,\n // 'name' => 'Administrator',\n // 'email' => 'programmerlemar@gmail.com',\n // 'role_id' => \\App\\Role::where('name', 'admin')->first()->id\n // ]\n // );\n\n DB::table('status')->insert([\n // ['name' => 'Active'],\n // ['name' => 'Cancel'],\n // ['name' => 'Disable'],\n // ['name' => 'Open'],\n // ['name' => 'Closed'],\n // ['name' => 'Resolved'],\n ['name' => 'Used'],\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n factory(User::class)->create([\n 'name' => 'Qwerty',\n 'email' => 'qwerty@gmail.com',\n 'password' => bcrypt('secretpassw'),\n ]);\n\n factory(User::class, 59)->create([\n 'password' => bcrypt('secretpassw'),\n ]);\n\n for ($i = 1; $i < 11; $i++) {\n factory(Category::class)->create([\n 'name' => 'Category ' . $i,\n ]);\n }\n\n for ($i = 1; $i < 101; $i++) {\n factory(Product::class)->create([\n 'name' => 'Product ' . $i,\n ]);\n }\n }", "public function run()\n {\n\n \t// Making main admin role\n \tDB::table('roles')->insert([\n 'name' => 'Admin',\n ]);\n\n // Making main category\n \tDB::table('categories')->insert([\n 'name' => 'Other',\n ]);\n\n \t// Making main admin account for testing\n \tDB::table('users')->insert([\n 'name' \t\t=> 'Admin',\n 'email' \t=> 'admin@example.com',\n 'password' => bcrypt('12345'),\n 'role_id' => 1,\n 'created_at' => date('Y-m-d H:i:s' ,time()),\n 'updated_at' => date('Y-m-d H:i:s' ,time())\n ]);\n\n \t// Making random users and posts\n factory(App\\User::class, 10)->create();\n factory(App\\Post::class, 35)->create();\n }", "public function run()\n {\n $faker = Faker::create();\n\n \\DB::table('positions')->insert(array (\n 'codigo' => strtoupper($faker->randomLetter).$faker->postcode,\n 'nombre' => 'Chef',\n 'salario' => '15000.00'\n ));\n\n\t\t \\DB::table('positions')->insert(array (\n 'codigo' => strtoupper($faker->randomLetter).$faker->postcode,\n 'nombre' => 'Mesonero',\n 'salario' => '12000.00'\n ));\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker = \\Faker\\Factory::create();\n\n foreach (range(1,5) as $index) {\n Lista::create([\n 'name' => $faker->sentence(2),\n 'description' => $faker->sentence(10), \n ]);\n } \n\n foreach (range(1,20) as $index) {\n $n = $faker->sentence(2);\n \tTarea::create([\n \t\t'name' => $n,\n \t\t'description' => $faker->sentence(10),\n 'lista_id' => $faker->numberBetween(1,5),\n 'slug' => Str::slug($n),\n \t\t]);\n } \n }", "public function run()\n {\n $faker = Faker::create('lt_LT');\n\n DB::table('users')->insert([\n 'name' => 'user',\n 'email' => 'briedis@aa.bb',\n 'password' => Hash::make('123')\n ]);\n DB::table('users')->insert([\n 'name' => 'user2',\n 'email' => 'briedis2@aa.bb',\n 'password' => Hash::make('123')\n ]);\n\n foreach (range(1,100) as $val)\n DB::table('authors')->insert([\n 'name' => $faker->firstName(),\n 'surname' => $faker->lastName(),\n \n ]);\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(UsersTableSeeder::class);\n\n // DB::table('users')->insert([\n // 'name' => 'User1',\n // 'email' => 'admin@admin.com',\n // 'password' => bcrypt('password'),\n // ]);\n\n\n $faker = Faker::create();\n \n foreach (range(1,10) as $index){\n DB::table('companies')->insert([\n 'name' => $faker->company(),\n 'email' => $faker->email(10).'@gmail.com',\n 'logo' => $faker->image($dir = '/tmp', $width = 640, $height = 480),\n 'webiste' => $faker->domainName(),\n \n ]);\n }\n \n \n foreach (range(1,10) as $index){\n DB::table('employees')->insert([\n 'first_name' => $faker->firstName(),\n 'last_name' => $faker->lastName(),\n 'company' => $faker->company(),\n 'email' => $faker->str_random(10).'@gmail.com',\n 'phone' => $faker->e164PhoneNumber(),\n \n ]);\n }\n\n\n\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n Flight::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 100; $i++) {\n\n\n Flight::create([\n 'flightNumber' => $faker->randomNumber(5),\n 'depAirport' => $faker->city,\n 'destAirport' => $faker->city,\n 'reservedWeight' => $faker->numberBetween(1000 - 10000),\n 'deptTime' => $faker->dateTime('now'),\n 'arrivalTime' => $faker->dateTime('now'),\n 'reservedVolume' => $faker->numberBetween(1000 - 10000),\n 'airlineName' => $faker->colorName,\n ]);\n }\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->truncteTables([\n 'users',\n 'products'\n ]);\n\n $this->call(UsersSeeder::class);\n $this->call(ProductsSeeder::class);\n\n }", "public function run()\n {\n /**\n * Dummy seeds\n */\n DB::table('metas')->truncate();\n $faker = Faker::create();\n\n for ($i=0; $i < 10; $i++) { \n DB::table('metas')->insert([\n 'id_rel' => $faker->randomNumber(),\n 'titulo' => $faker->sentence,\n 'descricao' => $faker->paragraph,\n 'justificativa' => $faker->paragraph,\n 'valor_inicial' => $faker->numberBetween(0,100),\n 'valor_atual' => $faker->numberBetween(0,100),\n 'valor_final' => $faker->numberBetween(0,10),\n 'regras' => json_encode([$i => [\"values\" => $faker->words(3)]]),\n 'types' => json_encode([$i => [\"values\" => $faker->words(2)]]),\n 'categorias' => json_encode([$i => [\"values\" => $faker->words(4)]]),\n 'tags' => json_encode([$i => [\"values\" => $faker->words(5)]]),\n 'active' => true,\n ]);\n }\n\n\n }", "public function run()\n {\n $this->call(CategoriasTableSeeder::class);\n $this->call(UfsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n $this->call(UserTiposTableSeeder::class);\n factory(App\\User::class, 2)->create();\n/* factory(App\\Models\\Categoria::class, 20)->create();*/\n/* factory(App\\Models\\Anuncio::class, 50)->create();*/\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n Language::truncate();\n Reason::truncate();\n Report::truncate();\n Category::truncate();\n Position::truncate();\n\n $languageQuantity = 10;\n $reasonQuantity = 10;\n $reportQuantity = 10;\n $categoryQuantity = 10;\n $positionQuantity = 10;\n\n factory(Language::class,$languageQuantity)->create();\n factory(Reason::class,$reasonQuantity)->create();\n \n factory(Report::class,$reportQuantity)->create();\n \n factory(Category::class,$categoryQuantity)->create();\n \n factory(Position::class,$positionQuantity)->create();\n\n }", "public function run()\n {\n // $this->call(UserTableSeeder::class);\n\n $faker = Faker::create();\n\n $lessonIds = Lesson::lists('id')->all(); // An array of ID's in that table [1, 2, 3, 4, 5, 7]\n $tagIds = Tag::lists('id')->all();\n\n foreach(range(1, 30) as $index)\n {\n // a real lesson id\n // a real tag id\n DB::table('lesson_tag')->insert([\n 'lesson_id' => $faker->randomElement($lessonIds),\n 'tag_id' => $faker->randomElement($tagIds),\n ]);\n }\n }", "public function run()\n {\n // \\DB::statement('SET_FOREIGN_KEY_CHECKS=0');\n \\DB::table('users')->truncate();\n \\DB::table('posts')->truncate();\n // \\DB::table('category')->truncate();\n \\DB::table('photos')->truncate();\n \\DB::table('comments')->truncate();\n \\DB::table('comment_replies')->truncate();\n\n \\App\\Models\\User::factory()->times(10)->hasPosts(1)->create();\n \\App\\Models\\Role::factory()->times(10)->create();\n \\App\\Models\\Category::factory()->times(10)->create();\n \\App\\Models\\Comment::factory()->times(10)->hasReplies(1)->create();\n \\App\\Models\\Photo::factory()->times(10)->create();\n\n \n // \\App\\Models\\User::factory(10)->create([\n // 'role_id'=>2,\n // 'is_active'=>1\n // ]);\n\n // factory(App\\Models\\Post::class, 10)->create();\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n $this->call([\n ArticleSeeder::class, \n TagSeeder::class,\n Arttagrel::class\n ]);\n // \\App\\Models\\User::factory(10)->create();\n \\App\\Models\\Article::factory()->count(7)->create();\n \\App\\Models\\Tag::factory()->count(15)->create(); \n \\App\\Models\\Arttagrel::factory()->count(15)->create(); \n }", "public function run()\n {\n $this->call(ArticulosTableSeeder::class);\n /*DB::table('articulos')->insert([\n 'titulo' => str_random(50),\n 'cuerpo' => str_random(200),\n ]);*/\n }", "public function run()\n {\n $this->call(CategoryTableSeeder::class);\n $this->call(ProductTableSeeder::class);\n\n \t\t\n\t\t\tDB::table('users')->insert([\n 'first_name' => 'Ignacio',\n 'last_name' => 'Garcia',\n 'email' => 'ignacio@dh.com',\n 'password' => bcrypt('123456'),\n 'role' => '1',\n 'avatar' => 'CGnABxNYYn8N23RWlvTTP6C2nRjOLTf8IJcbLqRP.jpeg',\n ]);\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(RoleSeeder::class);\n $this->call(UserSeeder::class);\n\n Medicamento::factory(50)->create();\n Reporte::factory(5)->create();\n Cliente::factory(200)->create();\n Asigna_valor::factory(200)->create();\n Carga::factory(200)->create();\n }", "public function run()\n {\n $this->call([\n RoleSeeder::class,\n TicketSeeder::class\n ]);\n\n DB::table('departments')->insert([\n 'abbr' => 'IT',\n 'name' => 'Information Technologies',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ]);\n\n DB::table('users')->insert([\n 'name' => 'admin',\n 'email' => 'admin@gmail.com',\n 'email_verified_at' => Carbon::now(),\n 'password' => Hash::make('admin'),\n 'department_id' => 1,\n 'avatar' => 'default.png',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ]);\n\n DB::table('role_user')->insert([\n 'role_id' => 1,\n 'user_id' => 1\n ]);\n }", "public function run()\n {\n \\App\\Models\\Article::factory(20)->create();\n \\App\\Models\\Category::factory(5)->create();\n \\App\\Models\\Comment::factory(40)->create();\n\n \\App\\Models\\User::create([\n \"name\"=>\"Alice\",\n \"email\"=>'alice@gmail.com',\n 'password' => Hash::make('password'),\n ]);\n \\App\\Models\\User::create([\n \"name\"=>\"Bob\",\n \"email\"=>'bob@gmail.com',\n 'password' => Hash::make('password'),\n ]);\n }", "public function run()\n {\n /** \n * Note: You must add these lines to your .env file for this Seeder to work (replace the values, obviously):\n SEEDER_USER_FIRST_NAME = 'Firstname'\n SEEDER_USER_LAST_NAME = 'Lastname'\n\t\tSEEDER_USER_DISPLAY_NAME = 'Firstname Lastname'\n\t\tSEEDER_USER_EMAIL = your.email@domain.com\n SEEDER_USER_PASSWORD = yourpassword\n */\n\t\tDB::table('users')->insert([\n 'user_first_name' => env('SEEDER_USER_FIRST_NAME'),\n 'user_last_name' => env('SEEDER_USER_LAST_NAME'),\n 'user_name' => env('SEEDER_USER_DISPLAY_NAME'),\n\t\t\t'user_email' => env('SEEDER_USER_EMAIL'),\n 'user_status' => 1,\n \t'password' => Hash::make((env('SEEDER_USER_PASSWORD'))),\n 'permission_fk' => 1,\n 'created_at' => Carbon::now()->format('Y-m-d H:i:s'),\n 'updated_at' => Carbon::now()->format('Y-m-d H:i:s')\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class,3)->create()->each(\n \tfunction($user)\n \t{\n \t\t$user->questions()\n \t\t->saveMany(\n \t\t\tfactory(App\\Question::class, rand(2,6))->make()\n \t\t)\n ->each(function ($q) {\n $q->answers()->saveMany(factory(App\\Answer::class, rand(1,5))->make());\n })\n \t}\n );\n }\n}", "public function run()\n {\n $faker = Faker::create();\n\n // $this->call(UsersTableSeeder::class);\n\n DB::table('posts')->insert([\n 'id'=>str_random(1),\n 'user_id'=> str_random(1),\n 'title' => $faker->name,\n 'body' => $faker->safeEmail,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ]);\n }", "public function run()\n\t{\n\t\tDB::table(self::TABLE_NAME)->delete();\n\n\t\tforeach (seed(self::TABLE_NAME) as $row)\n\t\t\t$records[] = [\n\t\t\t\t'id'\t\t\t\t=> $row->id,\n\t\t\t\t'created_at'\t\t=> $row->created_at ?? Carbon::now(),\n\t\t\t\t'updated_at'\t\t=> $row->updated_at ?? Carbon::now(),\n\n\t\t\t\t'sport_id'\t\t\t=> $row->sport_id,\n\t\t\t\t'gender_id'\t\t\t=> $row->gender_id,\n\t\t\t\t'tournamenttype_id'\t=> $row->tournamenttype_id ?? null,\n\n\t\t\t\t'name'\t\t\t\t=> $row->name,\n\t\t\t\t'external_id'\t\t=> $row->external_id ?? null,\n\t\t\t\t'is_top'\t\t\t=> $row->is_top ?? null,\n\t\t\t\t'logo'\t\t\t\t=> $row->logo ?? null,\n\t\t\t\t'position'\t\t\t=> $row->position ?? null,\n\t\t\t];\n\n\t\tinsert(self::TABLE_NAME, $records ?? []);\n\t}", "public function run()\n\t{\n\t\tDB::table('libros')->truncate();\n\n\t\t$faker = Faker\\Factory::create();\n\n\t\tfor ($i=0; $i < 10; $i++) { \n\t\t\tLibro::create([\n\n\t\t\t\t'titulo'\t\t=> $faker->text(40),\n\t\t\t\t'isbn'\t\t\t=> $faker->numberBetween(100,999),\n\t\t\t\t'precio'\t\t=> $faker->randomFloat(2,3,150),\n\t\t\t\t'publicado'\t\t=> $faker->numberBetween(0,1),\n\t\t\t\t'descripcion'\t=> $faker->text(400),\n\t\t\t\t'autor_id'\t\t=> $faker->numberBetween(1,3),\n\t\t\t\t'categoria_id'\t=> $faker->numberBetween(1,3)\n\n\t\t\t]);\n\t\t}\n\n\t\t// Uncomment the below to run the seeder\n\t\t// DB::table('libros')->insert($libros);\n\t}", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class, 10)->create()->each(function ($user) {\n // Seed the relation with 5 purchases\n // $videos = factory(App\\Video::class, 5)->make();\n // $user->videos()->saveMany($videos);\n // $user->videos()->each(function ($video){\n // \t$video->videometa()->save(factory(App\\VideoMeta::class)->make());\n // \t// :( \n // });\n factory(App\\User::class, 10)->create()->each(function ($user) {\n\t\t\t factory(App\\Video::class, 5)->create(['user_id' => $user->id])->each(function ($video) {\n\t\t\t \tfactory(App\\VideoMeta::class, 1)->create(['video_id' => $video->id]);\n\t\t\t // $video->videometa()->save(factory(App\\VideoMeta::class)->create(['video_id' => $video->id]));\n\t\t\t });\n\t\t\t});\n\n });\n }", "public function run()\n {\n // for($i=1;$i<11;$i++){\n // DB::table('post')->insert(\n // ['title' => 'Title'.$i,\n // 'post' => 'Post'.$i,\n // 'slug' => 'Slug'.$i]\n // );\n // }\n $faker = Faker\\Factory::create();\n \n for($i=1;$i<20;$i++){\n $dname = $faker->name;\n DB::table('post')->insert(\n ['title' => $dname,\n 'post' => $faker->text($maxNbChars = 200),\n 'slug' => str_slug($dname)]\n );\n }\n }", "public function run()\n {\n $this->call([\n CountryTableSeeder::class,\n ProvinceTableSeeder::class,\n TagTableSeeder::class\n ]);\n\n User::factory()->count(10)->create();\n Category::factory()->count(5)->create();\n Product::factory()->count(20)->create();\n Section::factory()->count(5)->create();\n Bundle::factory()->count(20)->create();\n\n $bundles = Bundle::all();\n // populate bundle-product table (morph many-to-many)\n Product::all()->each(function ($product) use ($bundles) {\n $product->bundles()->attach(\n $bundles->random(2)->pluck('id')->toArray(),\n ['default_quantity' => rand(1, 10)]\n );\n });\n // populate bundle-tags table (morph many-to-many)\n Tag::all()->each(function ($tag) use ($bundles) {\n $tag->bundles()->attach(\n $bundles->random(2)->pluck('id')->toArray()\n );\n });\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n Contract::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 50; $i++) {\n Contract::create([\n 'serialnumbers' => $faker->numberBetween($min = 1000000, $max = 2000000),\n 'address' => $faker->address,\n 'landholder' => $faker->lastName,\n 'renter' => $faker->lastName,\n 'price' => $faker->numberBetween($min = 10000, $max = 50000),\n 'rent_start' => $faker->date($format = 'Y-m-d', $max = 'now'),\n 'rent_end' => $faker->date($format = 'Y-m-d', $max = 'now'),\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker=Faker\\Factory::create();\n\n for($i=0;$i<100;$i++){\n \tApp\\Blog::create([\n \t\t'title' => $faker->catchPhrase,\n 'description' => $faker->text,\n 'showns' =>true\n \t\t]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0'); // TO PREVENT CHECKS FOR foreien key in seeding\n\n User::truncate();\n Category::truncate();\n Product::truncate();\n Transaction::truncate();\n\n DB::table('category_product')->truncate();\n\n User::flushEventListeners();\n Category::flushEventListeners();\n Product::flushEventListeners();\n Transaction::flushEventListeners();\n\n $usersQuantities = 1000;\n $categoriesQuantities = 30;\n $productsQuantities = 1000;\n $transactionsQuantities = 1000;\n\n factory(User::class, $usersQuantities)->create();\n factory(Category::class, $categoriesQuantities)->create();\n\n factory(Product::class, $productsQuantities)->create()->each(\n function ($product) {\n $categories = Category::all()->random(mt_rand(1, 5))->pluck('id');\n $product->categories()->attach($categories);\n });\n\n factory(Transaction::class, $transactionsQuantities)->create();\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n $this->call(PermissionsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n\n $this->call(BusinessTableSeeder::class);\n $this->call(PrinterTableSeeder::class);\n factory(App\\Tag::class,10)->create();\n factory(App\\Category::class,10)->create();\n factory(App\\Subcategory::class,50)->create();\n factory(App\\Provider::class,10)->create();\n factory(App\\Product::class,24)->create()->each(function($product){\n\n $product->images()->saveMany(factory(App\\Image::class, 4)->make());\n\n });\n\n\n factory(App\\Client::class,10)->create();\n }", "public function run()\n {\n Article::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 50; $i++) {\n Article::create([\n 'name' => $faker->sentence,\n 'sku' => $faker->paragraph,\n 'price' => $faker->number,\n ]);\n }\n }", "public function run()\n {\n Storage::deleteDirectory('public/products');\n Storage::makeDirectory('public/products');\n\n $this->call(UserSeeder::class);\n Category::factory(4)->create();\n $this->call(ProductSeeder::class);\n Order::factory(4)->create();\n Order_Detail::factory(4)->create();\n Size::factory(100)->create();\n }", "public function run()\n {\n $this->call(RolSeeder::class);\n\n $this->call(UserSeeder::class);\n Category::factory(4)->create();\n Doctor::factory(25)->create();\n Patient::factory(50)->create();\n Status::factory(3)->create();\n Appointment::factory(100)->create();\n }", "public function run()\n\t{\n\t\t\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n\t\t$faker = \\Faker\\Factory::create();\n\n\t\tTodolist::truncate();\n\n\t\tforeach(range(1, 50) as $index)\n\t\t{\n\n\t\t\t$user = User::create([\n\t\t\t\t'name' => $faker->name,\n\t\t\t\t'email' => $faker->email,\n\t\t\t\t'password' => 'password',\n\t\t\t\t'confirmation_code' => mt_rand(0, 9),\n\t\t\t\t'confirmation' => rand(0,1) == 1\n\t\t\t]);\n\n\t\t\t$list = Todolist::create([\n\t\t\t\t'name' => $faker->sentence(2),\n\t\t\t\t'description' => $faker->sentence(4),\n\t\t\t]);\n\n\t\t\t// BUILD SOME TASKS FOR EACH LIST ITEM\n\t\t\tforeach(range(1, 10) as $index) \n\t\t\t{\n\t\t\t\t$task = new Task;\n\t\t\t\t$task->name = $faker->sentence(2);\n\t\t\t\t$task->description = $faker->sentence(4);\n\t\t\t\t$list->tasks()->save($task);\n\t\t\t}\n\n\t\t}\n\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS = 1'); \n\n\t}", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::table('users')->insert([\n 'name' => 'admin',\n 'email' => 'admin@gmail.com',\n 'password' => bcrypt('admin'),\n 'seq_q'=>'1',\n 'seq_a'=>'admin'\n ]);\n\n // DB::table('bloods')->insert([\n // ['name' => 'A+'],\n // ['name' => 'A-'],\n // ['name' => 'B+'],\n // ['name' => 'B-'],\n // ['name' => 'AB+'],\n // ['name' => 'AB-'],\n // ['name' => 'O+'],\n // ['name' => 'O-'],\n // ]);\n\n \n }", "public function run()\n {\n Campus::truncate();\n Canteen::truncate();\n Dorm::truncate();\n\n $faker = Faker\\Factory::create();\n $schools = School::all();\n foreach ($schools as $school) {\n \tforeach (range(1, 2) as $index) {\n\t \t$campus = Campus::create([\n\t \t\t'school_id' => $school->id,\n\t \t\t'name' => $faker->word . '校区',\n\t \t\t]);\n\n \t$campus->canteens()->saveMany(factory(Canteen::class, mt_rand(2,3))->make());\n $campus->dorms()->saveMany(factory(Dorm::class, mt_rand(2,3))->make());\n\n }\n }\n }", "public function run()\n {\n // $this->call(UserTableSeeder::class);\n \\App\\User::create([\n 'name'=>'PAPE SAMBA NDOUR',\n 'email'=>'papesambandour@hotmail.com',\n 'password'=>bcrypt('Admin1122'),\n ]);\n\n $faker = Faker::create();\n\n for ($i = 0; $i < 100 ; $i++)\n {\n $firstName = $faker->firstName;\n $lastName = $faker->lastName;\n $niveau = \\App\\Niveau::inRandomOrder()->first();\n \\App\\Etudiant::create([\n 'prenom'=>$firstName,\n 'nom'=>$lastName,\n 'niveau_id'=>$niveau->id\n ]);\n }\n\n\n }", "public function run()\n {\n //\n DB::table('foods')->delete();\n\n Foods::create(array(\n 'name' => 'Chicken Wing',\n 'author' => 'Bambang',\n 'overview' => 'a deep-fried chicken wing, not in spicy sauce'\n ));\n\n Foods::create(array(\n 'name' => 'Beef ribs',\n 'author' => 'Frank',\n 'overview' => 'Slow baked beef ribs rubbed in spices'\n ));\n\n Foods::create(array(\n 'name' => 'Ice cream',\n 'author' => 'Lou',\n 'overview' => ' A sweetened frozen food typically eaten as a snack or dessert.'\n ));\n\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n News::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 10; $i++) {\n News::create([\n 'title' => $faker->sentence,\n 'summary' => $faker->sentence,\n 'content' => $faker->paragraph,\n 'imagePath' => '/img/exclamation_mark.png'\n ]);\n }\n }", "public function run()\n {\n \\DB::table('employees')->delete();\n\n $faker = \\Faker\\Factory::create('ja_JP');\n\n $role_id = ['1','2','3'];\n\n for ($i = 0; $i < 10; $i++) {\n \\App\\Models\\Employee::create([\n 'last_name' =>$faker->lastName() ,\n 'first_name' => $faker->firstName(),\n 'mail' => $faker->email(),\n 'password' => Hash::make( \"password.$i\"),\n 'birthday' => $faker->date($format='Y-m-d',$max='now'),\n 'role_id' => $faker->randomElement($role_id)\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class, 3)->create();\n factory(App\\Models\\Category::class, 3)\n ->create()\n ->each(function ($u) {\n $u->courses()->saveMany(factory(App\\Models\\Course::class,3)->make())->each(function ($c){\n $c->exams()->saveMany(factory(\\App\\Models\\Exam::class,3)->make())->each(function ($e){\n $e->questions()->saveMany(factory(\\App\\Models\\Question::class,4)->make())->each(function ($q){\n $q->answers()->saveMany(factory(\\App\\Models\\Answer::class,4)->make())->each(function ($a){\n $a->correctAnswer()->save(factory(\\App\\Models\\Correct_answer::class)->make());\n });\n });\n });\n });\n\n });\n\n }", "public function run()\n {\n\n DB::table('clients')->delete();\n DB::table('trips')->delete();\n error_log('empty tables done.');\n\n $random_cities = City::inRandomOrder()->select('ar_name')->limit(5)->get();\n $GLOBALS[\"random_cities\"] = $random_cities->pluck('ar_name')->toArray();\n\n $random_airlines = Airline::inRandomOrder()->select('code')->limit(5)->get();\n $GLOBALS[\"random_airlines\"] = $random_airlines->pluck('code')->toArray();\n\n factory(App\\Client::class, 5)->create();\n error_log('Client seed done.');\n\n\n factory(App\\Trip::class, 50)->create();\n error_log('Trip seed done.');\n\n\n factory(App\\Quicksearch::class, 10)->create();\n error_log('Quicksearch seed done.');\n }", "public function run()\n {\n // Admins\n User::factory()->create([\n 'name' => 'Zaiman Noris',\n 'username' => 'rognales',\n 'email' => 'rognales@gmail.com',\n 'active' => true,\n ]);\n\n User::factory()->create([\n 'name' => 'Affiq Rashid',\n 'username' => 'affiqr',\n 'email' => 'sonic21danger@gmail.com',\n 'active' => true,\n ]);\n\n // Only seed test data in non-prod\n if (! app()->isProduction()) {\n Member::factory()->count(1000)->create();\n Staff::factory()->count(1000)->create();\n\n Participant::factory()\n ->addSpouse()\n ->addChildren()\n ->addInfant()\n ->addOthers()\n ->count(500)\n ->hasUploads(2)\n ->create();\n }\n }", "public function run()\n {\n $this->call([\n RoleSeeder::class,\n UserSeeder::class,\n ]);\n\n \\App\\Models\\Category::factory(4)->create();\n \\App\\Models\\View::factory(6)->create();\n \\App\\Models\\Room::factory(8)->create();\n \n $rooms = \\App\\Models\\Room::all();\n // \\App\\Models\\User::all()->each(function ($user) use ($rooms) { \n // $user->rooms()->attach(\n // $rooms->random(rand(1, \\App\\Models\\Room::max('id')))->pluck('id')->toArray()\n // ); \n // });\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n Employee::factory()->create(['email' => 'sovon.kucse@gmail.com']);\n Brand::factory()->count(3)->create();\n $this->call([\n TagSeeder::class,\n AttributeSeeder::class,\n AttributeValueSeeder::class,\n ProductSeeder::class,\n ]);\n }", "public function run()\n {\n $this->call(RolesTableSeeder::class); // crée les rôles\n $this->call(PermissionsTableSeeder::class); // crée les permissions\n\n factory(Employee::class,3)->create();\n factory(Provider::class,1)->create();\n\n $user = User::create([\n 'name'=>'Alioune Bada Ndoye',\n 'email'=>'abada@gmail.com',\n 'phone'=>'773012470',\n 'password'=>bcrypt('123'),\n ]);\n Employee::create([\n 'job'=>'Informaticien',\n 'user_id'=>User::where('email','abada@gmail.com')->first()->id,\n 'point_id'=>Point::find(1)->id,\n ]);\n $user->assignRole('admin');\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n factory(User::class, 1)\n \t->create(['email' => 'eddyjaair@gmail.com']);\n\n factory(Category::class, 5)->create();\n }", "public function run()\n {\n //$this->call(UsersTableSeeder::class);\n $this->call(rootSeed::class);\n factory(App\\Models\\Egresado::class,'hombre',15)->create();\n factory(App\\Models\\Egresado::class,'mujer',15)->create();\n factory(App\\Models\\Administrador::class,5)->create();\n factory(App\\Models\\Notificacion::class,'post',10)->create();\n factory(App\\Models\\Notificacion::class,'mensaje',5)->create();\n factory(App\\Models\\Egresado::class,'bajaM',5)->create();\n factory(App\\Models\\Egresado::class,'bajaF',5)->create();\n factory(App\\Models\\Egresado::class,'suscritam',5)->create();\n factory(App\\Models\\Egresado::class,'suscritaf',5)->create();\n }", "public function run()\n {\n \n User::factory(1)->create([\n 'rol'=>'EPS'\n ]);\n Person::factory(10)->create();\n $this->call(EPSSeeder::class);\n $this->call(OfficialSeeder::class);\n $this->call(VVCSeeder::class);\n $this->call(VaccineSeeder::class);\n }", "public function run()\n {\n // $faker=Faker::create();\n // foreach(range(1,100) as $index)\n // {\n // DB::table('products')->insert([\n // 'name' => $faker->name,\n // 'price' => rand(10,100000)/100\n // ]);\n // }\n }", "public function run()\n {\n $this->call([\n LanguagesTableSeeder::class,\n ListingAvailabilitiesTableSeeder::class,\n ListingTypesTableSeeder::class,\n RoomTypesTableSeeder::class,\n AmenitiesTableSeeder::class,\n UsersTableSeeder::class,\n UserLanguagesTableSeeder::class,\n ListingsTableSeeder::class,\n WishlistsTableSeeder::class,\n StaysTableSeeder::class,\n GuestsTableSeeder::class,\n TripsTableSeeder::class,\n ReviewsTableSeeder::class,\n RatingsTableSeeder::class,\n PopularDestinationsTableSeeder::class,\n ImagesTableSeeder::class,\n ]);\n\n // factory(App\\User::class, 5)->states('host')->create();\n // factory(App\\User::class, 10)->states('hostee')->create();\n\n // factory(App\\User::class, 10)->create();\n // factory(App\\Models\\Listing::class, 30)->create();\n }", "public function run()\n {\n Schema::disableForeignKeyConstraints();\n Grade::truncate();\n Schema::enableForeignKeyConstraints();\n\n $faker = \\Faker\\Factory::create();\n\n for ($i = 0; $i < 10; $i++) {\n Grade::create([\n 'letter' => $faker->randomElement(['а', 'б', 'в']),\n 'school_id' => $faker->unique()->numberBetween(1, School::count()),\n 'level' => 1\n ]);\n }\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n factory(App\\User::class,5)->create();//5 User created\n factory(App\\Model\\Genre::class,5)->create();//5 genres\n factory(App\\Model\\Film::class,6)->create();//6 films\n factory(App\\Model\\Comment::class, 20)->create();// 20 comments\n }", "public function run()\n {\n\n $this->call(UserSeeder::class);\n factory(Empresa::class,10)->create();\n factory(Empleado::class,50)->create();\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n User::create([\n 'name' => 'jose luis',\n 'email' => 'barbozagonzalesjose@gmail.com',\n 'password' => bcrypt('xxxxxx'),\n 'role' => 'admin',\n ]);\n\n Category::create([\n 'name' => 'inpods',\n 'description' => 'auriculares inalambricos que funcionan con blouthue genial'\n ]);\n\n Category::create([\n 'name' => 'other',\n 'description' => 'otra cosa diferente a un inpods'\n ]);\n\n\n /* Create 10 products */\n Product::factory(10)->create();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(User::class)->create([\n 'email' => 'russell@gmail.com',\n 'name' => 'Russell'\n ]);\n\n factory(User::class)->create([\n 'email' => 'bitfumes@gmail.com',\n 'name' => 'Bitfumes'\n ]);\n\n factory(User::class)->create([\n 'email' => 'paul@gmail.com',\n 'name' => 'Paul'\n ]);\n }", "public function run()\n {\n $user_ids = [1,2,3];\n $faker = app(\\Faker\\Generator::class);\n $posts = factory(\\App\\Post::class)->times(50)->make()->each(function($post) use ($user_ids,$faker){\n $post->user_id = $faker->randomElement($user_ids);\n });\n \\App\\Post::insert($posts->toArray());\n }", "public function run()\n {\n // Vaciar la tabla.\n Favorite::truncate();\n $faker = \\Faker\\Factory::create();\n // Crear artículos ficticios en la tabla\n\n // factory(App\\Models\\User::class, 2)->create()->each(function ($user) {\n // $user->users()->saveMany(factory(App\\Models\\User::class, 25)->make());\n //});\n }", "public function run()\n\t{\n\t\t$this->call(ProductsTableSeeder::class);\n\t\t$this->call(CategoriesTableSeeder::class);\n\t\t$this->call(BrandsTableSeeder::class);\n\t\t$this->call(ColorsTableSeeder::class);\n\n\t\t$products = \\App\\Product::all();\n \t$categories = \\App\\Category::all();\n \t$brands = \\App\\Brand::all();\n \t$colors = \\App\\Color::all();\n\n\t\tforeach ($products as $product) {\n\t\t\t$product->colors()->sync($colors->random(3));\n\n\t\t\t$product->category()->associate($categories->random(1)->first());\n\t\t\t$product->brand()->associate($brands->random(1)->first());\n\n\t\t\t$product->save();\n\t\t}\n\n\t\t// for ($i = 0; $i < count($products); $i++) {\n\t\t// \t$cat = $categories[rand(0,5)];\n\t\t// \t$bra = $brands[rand(0,7)];\n\t\t// \t$cat->products()->save($products[$i]);\n\t\t// \t$bra->products()->save($products[$i]);\n\t\t// }\n\n\t\t// $products = factory(App\\Product::class)->times(20)->create();\n\t\t// $categories = factory(App\\Category::class)->times(6)->create();\n\t\t// $brands = factory(App\\Brand::class)->times(8)->create();\n\t\t// $colors = factory(App\\Color::class)->times(15)->create();\n\t}", "public function run()\n {\n /*$this->call(UsersTableSeeder::class);\n $this->call(GroupsTableSeeder::class);\n $this->call(TopicsTableSeeder::class);\n $this->call(CommentsTableSeeder::class);*/\n DB::table('users')->insert([\n 'name' => 'pkw',\n 'email' => 'pkw@pkw.com',\n 'password' => bcrypt('secret'),\n 'type' => '1'\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker = Faker::create();\n foreach (range(1,200) as $index) {\n DB::table('users')->insert([\n 'name' => $faker->name,\n 'email' => $faker->email,\n 'phone' => $faker->randomDigitNotNull,\n 'address'=> $faker->streetAddress,\n 'password' => bcrypt('secret'),\n ]);\n }\n }", "public function run()\n {\n $this->call(UsersSeeder::class);\n User::factory(2)->create();\n Company::factory(2)->create();\n\n }", "public function run()\n {\n echo PHP_EOL , 'seeding roles...';\n\n Role::create(\n [\n 'name' => 'Admin',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Principal',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Teacher',\n 'deletable' => false,\n ]\n );\n\n Role::create(\n [\n 'name' => 'Student',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Parents',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Accountant',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Librarian',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Receptionist',\n 'deletable' => false,\n ]\n );\n\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // $this->call(QuestionTableSeed::class);\n\n $this->call([\n QuestionTableSeed::class,\n AlternativeTableSeed::class,\n ScheduleActionTableSeeder::class,\n UserTableSeeder::class,\n CompanyClassificationTableSeed::class,\n ]);\n // DB::table('clients')->insert([\n // 'name' => 'Empresa-02',\n // 'email' => 'empresa02@gmail.com',\n // 'password' => bcrypt('07.052.477/0001-60'),\n // ]);\n }", "public function run()\n {\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 5; $i++) {\n Runner::create([\n 'external_id' => $faker->uuid,\n 'name' => $faker->name,\n 'race_id' =>rand(1,5),\n 'age' => rand(30, 45),\n 'sex' => $faker->randomElement(['male', 'female']),\n 'color' => $faker->randomElement(['#ecbcb4', '#d1a3a4']),\n ]);\n }\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n\n User::factory()->create([\n 'name' => 'Carlos',\n 'email' => 'carlos@email.com',\n 'email_verified_at' => now(),\n 'password' => bcrypt('123456'), // password\n 'remember_token' => Str::random(10),\n ]);\n \n $this->call([PostsTableSeeder::class]);\n $this->call([TagTableSeeder::class]);\n\n }", "public function run()\n {\n $this->call(AlumnoSeeder::class);\n //Alumnos::factory()->count(30)->create();\n //DB::table('alumnos')->insert([\n // 'dni_al' => '13189079',\n // 'nom_al' => 'Jose',\n // 'ape_al' => 'Araujo',\n // 'rep_al' => 'Principal',\n // 'esp_al' => 'Tecnologia',\n // 'lnac_al' => 'Valencia'\n //]);\n }", "public function run()\n {\n Eloquent::unguard();\n\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n\n // $this->call([\n // CountriesTableSeeder::class,\n // ]);\n\n factory(App\\User::class, 100)->create();\n factory(App\\Type::class, 10)->create();\n factory(App\\Item::class, 100)->create();\n factory(App\\Order::class, 1000)->create();\n\n $items = App\\Item::all();\n\n App\\Order::all()->each(function($order) use ($items) {\n\n $n = rand(1, 10);\n\n $order->items()->attach(\n $items->random($n)->pluck('id')->toArray()\n , ['quantity' => $n]);\n\n $order->total = $order->items->sum(function($item) {\n return $item->price * $item->pivot->quantity;\n });\n\n $order->save();\n\n });\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n\n factory('App\\Models\\Pessoa', 60)->create();\n factory('App\\Models\\Profissional', 10)->create();\n factory('App\\Models\\Paciente', 50)->create();\n $this->call(UsersTableSeeder::class);\n $this->call(ProcedimentoTableSeeder::class);\n // $this->call(PessoaTableSeeder::class);\n // $this->call(ProfissionalTableSeeder::class);\n // $this->call(PacienteTableSeeder::class);\n // $this->call(AgendaProfissionalTableSeeder::class);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n factory(User::class)->create(\n [\n 'email'=>'izzanniroshlei@gmail.com',\n 'name'=>'izzanni',\n \n ]\n );\n factory(User::class)->create(\n [\n 'email'=>'aina@gmail.com',\n 'name'=>'aina',\n\n ]\n );\n factory(User::class)->create(\n [\n 'email'=>'sab@gmail.com',\n 'name'=>'sab',\n\n ]\n );\n }", "public function run()\n {\n //Acá se define lo que el seeder va a hacer.\n //insert() para insertar datos.\n //Array asociativo. La llave es el nombre de la columna.\n// DB::table('users')->insert([\n// //Para un solo usuario.\n// 'name' => 'Pedrito Perez',\n// 'email' => 'pedrito@juase.com',\n// 'password' => bcrypt('123456')\n// ]);//Se indica el nombre de la tabla.\n\n //Crea 50 usuarios (sin probar)\n// factory(App\\User::class, 50)->create()->each(function($u) {\n// $u->posts()->save(factory(App\\Post::class)->make());\n// });\n\n factory(App\\User::class, 10)->create(); //Así se ejecuta el model factory creado en ModelFactory.php\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n //nhập liệu mẫu cho bảng users\n DB::table('users')->insert([\n \t['id'=>'1001', 'name'=>'Phan Thị Hiền', 'email'=>'hienphan18112015@gmail.com', 'password'=>'123456', 'isadmin'=>1],\n \t['id'=>'1002', 'name'=>'Phan Thị Hà', 'email'=>'haphan@gmail.com', 'password'=>'111111', 'isadmin'=>0]\n ]);\n\n\n //nhập liệu mẫu cho bảng suppliers\n DB::table('suppliers')->insert([\n \t['name'=>'FPT', 'address'=>'151 Hùng Vương, TP. Đà Nẵng', 'phonenum'=>'0971455395'],\n \t['name'=>'Điện Máy Xanh', 'address'=>'169 Phan Châu Trinh, TP. Đà Nẵng', 'phonenum'=>'0379456011']\n ]);\n\n\n //Bảng phiếu bảo hành\n }", "public function run()\n {\n \t// DB::table('categories')->truncate();\n // factory(App\\Models\\Category::class, 10)->create();\n Schema::disableForeignKeyConstraints();\n Category::truncate();\n $faker = Faker\\Factory::create();\n\n $categories = ['SAMSUNG','NOKIA','APPLE','BLACK BERRY'];\n foreach ($categories as $key => $value) {\n Category::create([\n 'name'=>$value,\n 'description'=> 'This is '.$value,\n 'markup'=> rand(10,100),\n 'category_id'=> null,\n 'UUID' => $faker->uuid,\n ]);\n }\n }" ]
[ "0.80140394", "0.7980541", "0.79775697", "0.79547316", "0.79514134", "0.79500794", "0.79444957", "0.794259", "0.79382807", "0.7937482", "0.7934376", "0.7892533", "0.7881253", "0.78794724", "0.7879101", "0.7875628", "0.787215", "0.7870168", "0.78515327", "0.7850979", "0.7841958", "0.7834691", "0.78279406", "0.78198457", "0.78093415", "0.78030044", "0.7802443", "0.7801398", "0.7798975", "0.77957946", "0.77905124", "0.7789201", "0.77866685", "0.77786297", "0.7777914", "0.7764813", "0.7762958", "0.7762118", "0.77620417", "0.77614594", "0.7760672", "0.77599436", "0.77577287", "0.7753593", "0.7749794", "0.7749715", "0.77473587", "0.77301705", "0.77296484", "0.77280766", "0.77165425", "0.77143145", "0.7714117", "0.77136046", "0.7712814", "0.7712705", "0.7711485", "0.7711305", "0.77110684", "0.77102643", "0.7705902", "0.77048075", "0.77041686", "0.77038115", "0.7703085", "0.7702133", "0.77009964", "0.7698874", "0.769864", "0.76973957", "0.7696364", "0.7694127", "0.7692633", "0.76910555", "0.7690765", "0.7688756", "0.76879585", "0.76873547", "0.76871854", "0.7685407", "0.7683626", "0.76794547", "0.7678361", "0.7678022", "0.7676884", "0.7672536", "0.76717764", "0.7669418", "0.76692647", "0.76690245", "0.76667875", "0.76628584", "0.76624", "0.76618767", "0.7660002", "0.76567614", "0.76542175", "0.76541024", "0.7652618", "0.76524657", "0.7651689" ]
0.0
-1
Make this class a singleton. Use this instead of __construct().
public static function get_instance( $connection = null ) { if ( ! isset( static::$instance ) && ! ( self::$instance instanceof Queue ) ) { static::$instance = new Queue(); static::$instance->init( $connection ); } return static::$instance; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function __construct() { // singleton\n }", "public static function getInstance(): self;", "public static function instance()\n {\n }", "static public function getInstance() {\n return new static();\n }", "private static function singleton() \n\t{\n\t\tif (! isset ( self::$_instance )) {\n\t\t\tself::$_instance = new self();\n\t\t}\n\t\t\n\t\treturn self::$_instance;\n\t}", "public static function singleton(){\n\t\tif (!isset(self::$instance)) {\n\t\t\t$miclase = __CLASS__;\n\t\t\tself::$instance = new $miclase;\n\t\t}\n\t\treturn self::$instance;\n\t}", "public static function getInstance()\n\t {\n\t \tif (self::$initialized) return;\n\t \tself::$initialized = true;\n\t }", "protected static function __instance()\n {\n return DiPool::getinstance()->getSingleton(static::class);\n }", "public static function getInstance() {}", "public static function getInstance() {}", "public static function getInstance() {}", "public static function getInstance() {}", "public static function getInstance() {}", "public static function getInstance() {}", "public static function getInstance() {}", "public static function getInstance() {}", "public static function getInstance() {}", "public static function getInstance() {}", "public static function getInstance()\n {\n return new static;\n }", "public static function getInstance()\n /**/\n {\n if (is_null(self::$instance)) {\n self::$instance = new static();\n }\n\n return self::$instance;\n }", "public static function singleton() {\r\n\r\n\t\tif ( ! self::$instance ) {\r\n\t\t\tself::$instance = new self();\r\n\t\t}\r\n\r\n\t\treturn self::$instance;\r\n\t}", "public\n\tstatic function getInstance() {\n\t\tif ( null == self::$instance ) {\n\t\t\tself::$instance = new self;\n\t\t}\n\n\t\treturn self::$instance;\n\t}", "public static function getInstance(){\n\n if(!(self::$_instance instanceof self))\n self::$_instance=new self();\n return self::$_instance;\n\n }", "static function Singleton()\n {\n if (!self::$singleton)\n {\n self::$singleton = new self();\n }\n return self::$singleton;\n }", "static function getInstance () {\n\t\t\tif (self :: $_instance == null)\n\t\t\t\tself :: $_instance = new self ();\n\t\t\t\t\n\t\t\treturn self :: $_instance;\n\t\t}", "static function getInstance(){\r\n\r\n\t\tif(!isset(self::$instance)) self::$instance = new self();\r\n\t\treturn self::$instance;\r\n\t}", "public static function getInstance() {/*{{{*/\n if (is_null(self::$singleton)) self::$singleton = new self();\n return self::$singleton;\n }", "public static function instance()\n {\n return new static();\n }", "public static function instance()\n {\n return new static();\n }", "public static function getInstance(){\n\n if(!(self::$_instance instanceof self))\n self::$_instance=new self();\n return self::$_instance;\n\n }", "public static function getInstance() {\n if (!self::$instance instanceof self) {\n self::$instance = new self;\n }\n return self::$instance;\n }", "public static function instance()\n {\n return new static;\n }", "public static function instance()\n {\n return new static;\n }", "public static function getInstance()\n {\n return new self();\n }", "public static function getInstance() {\n return new self();\n }", "public static function getInstance()\n {\n if (!self::$__instance) {\n \n self::$__instance = new self;\n }\n \n return self::$__instance;\n }", "public static function getInstance() {\n\t\treturn parent::getInstance(__CLASS__);\n\t}", "public static function instance() {\n return new static();\n }", "public static function getInstance() {\n\t\treturn parent::getInstance(__CLASS__); \n\t}", "static public function getInstance() {\n\t\treturn\n\t\t\tself::$instance===null\n\t\t\t\t? self::$instance = new static()//new self()\n\t\t\t\t: self::$instance;\n\t}", "static function instance() {\r\n\t\tif ( !self::$instance ) {\r\n\t\t\tself::$instance = new self();\r\n\t\t}\r\n\t\treturn self::$instance;\r\n\t}", "static function get_instance() {\n\n\t\tif( null === self::$_instance )\n\t\t\tself::$_instance = new self();\n\n\t\treturn self::$_instance;\n\t}", "static function get_instance() {\n\n\t\tif( null === self::$_instance )\n\t\t\tself::$_instance = new self();\n\n\t\treturn self::$_instance;\n\t}", "public function __construct(){\n\t\tsession_start();\n\t\tif(!self::$_singleton instanceof self){\n\t\t\t$this->setInstance();\n\t\t}\n\t}", "public static function getInstance() {\n\n\t\tif ( ! self::$instance ) {\n\t\t\tself::$instance = new self;\n\t\t}\n\n\t\treturn self::$instance;\n\t}", "public static function getInstance() {\n if (static::$instance) {\n return static::$instance;\n }\n\n return static::$instance = new static();\n }", "public static function getInstance(){\n if(!self::$_instance){\n self::$_instance = new self();\n }\n \n return self::$_instance;\n }", "public static function getInstance ()\n {\n if ( is_null ( self::$instance) ) {\n self::$instance = new self();\n }\n return self::$instance;\n }", "private static function instance() {\n\t\tif (!isset(self::$instance)) {\n\t\t\tself::$instance = new self();\n\t\t}\n\n\t\treturn self::$instance;\n\t}", "static public function getInstance() {\r\n\t\tstatic $instance;\r\n\t\tif (!isset($instance))\r\n\t\t\t$instance = new self();\r\n\t\treturn $instance;\r\n\t}", "static public function getInstance() {\r\n\t\tstatic $instance;\r\n\t\tif (!isset($instance))\r\n\t\t\t$instance = new self();\r\n\t\treturn $instance;\r\n\t}", "public static function getInstance() {\n\t\tself::init();\n\t\treturn parent::getInstance();\n\t}", "public static function singleton() {\n\t\tif ( ! self::$instance ) {\n\t\t\tself::$instance = new self();\n\t\t}\n\n\t\treturn self::$instance;\n\t}", "public static function singleton() {\n\t\tif ( ! self::$instance ) {\n\t\t\tself::$instance = new self();\n\t\t}\n\n\t\treturn self::$instance;\n\t}", "public static function getInstance() {\n\n\t\t// check for self instance\n\t\tif ( ! self::$instance ) {\n\t\t\tself::$instance = new self;\n\t\t}\n\n\t\t// return the instance\n\t\treturn self::$instance;\n\t}", "static public function getInstance()\n\t{\n\t\treturn parent::getInstance();\n\t}", "public static function getInstance() {\n \n if (empty(self::$instance)) {\n \n self::$instance = new self();\n \n }\n \n return self::$instance;\n \n }", "public static function inst()\n {\n return new static();\n }", "public static function singleton() \n\t{\n\t\tif( !isset(self::$instance) ) {\n\t\t\t$c = __CLASS__;\n\t\t\tself::$instance = new $c;\n\t\t}\n\t\t\n\t\treturn self::$instance;\n\t}", "public static function getInstance()\n {\n return GeneralUtility::makeInstance(self::class);\n }", "public static function getInstance()\n {\n return GeneralUtility::makeInstance(self::class);\n }", "public static function instance () {\n\t\tif ( is_null( self::$_instance ) )\n\t\t\tself::$_instance = new self();\n\t\treturn self::$_instance;\n\t}", "public static function &singleton()\n {\n static $instance;\n\n // If the instance is not there, create one\n if (!isset($instance)) {\n $class = __CLASS__;\n $instance = new $class();\n }\n return $instance;\n }", "public static function init() {\n\t\treturn self::$instance = new self();\n\t}", "public static function getInstance(){\r\n if(!isset(self::$_instance)) {\r\n self::$_instance = new self();\r\n }\r\n\r\n return self::$_instance;\r\n }", "static public function getInstance()\n {\n if (self::$instance == null)\n {\n self::$instance = new self;\n }\n return self::$instance;\n }", "public static function getInstance(){\n if(!isset(self::$_instance)){\n self::$_instance = new self();\n }\n\n return self::$_instance;\n }", "static public function getInstance()\n {\n if (self::$_instance === null) {\n self::$_instance = new self();\n }\n return self::$_instance;\n }", "public static function getInstance() {\n\t\tif (static::$singleton === null) {\n\t\t\tstatic::$singleton = new static();\n\t\t}\n\n\t\treturn static::$singleton;\n\t}", "public static function getInstance()\n {\n if(null == self::$_inst){\n self::$_inst = new self();\n }\n return self::$_inst; \n }", "static public function getInstance()\n {\n if (self::$instance === null) {\n self::$instance = new self();\n }\n\n return self::$instance;\n }", "public static function getInstance()\n {\n if(!self::$_instance)\n {\n self::$_instance = new self();\n }\n return self::$_instance;\n }", "public static function getInstance() {\r\n if (!self::$instance instanceof self) {\r\n self::$instance = new self;\r\n }\r\n return self::$instance;\r\n }", "public static function getInstance() {\r\n if (!self::$instance instanceof self) {\r\n self::$instance = new self;\r\n }\r\n return self::$instance;\r\n }", "public static function getInstance(){\r\n\r\n\t\t// This method is overriden from the singleton one simply to get correct\r\n\t\t// autocomplete annotations when returning the instance\r\n\t\t$instance = parent::getInstance();\r\n\r\n\t\treturn $instance;\r\n\t}", "public static function getInstance(){\r\n if(!self::$_instance){\r\n self::$_instance = new self();\r\n }\r\n return self::$_instance;\r\n }", "public static function instance() {\n\t\tif ( is_null( self::$_instance ) )\n\t\t\tself::$_instance = new self();\n\t\treturn self::$_instance;\n\t}", "public static function singleton()\r\n\t{\r\n\t\tif( !isset( self::$instance ) )\r\n\t\t{\r\n\t\t\t$obj = __CLASS__;\r\n\t\t\tself::$instance = new $obj;\r\n\t\t}\r\n\t\t\r\n\t\treturn self::$instance;\r\n\t}", "public static function getInstance() {\n if (!self::$_instance) {\n self::$_instance = new self;\n }\n return self::$_instance;\n }", "public static function getInstance() {\n\t\tif (self::$instance === null) {\n\t\t\t$class = __CLASS__;\n\t\t\treturn self::$instance = new $class;\n\t\t}\n\t\treturn self::$instance;\n\t}", "public static function getInstance() {\n\t\tif (self::$instance === null) {\n\t\t\t$class = __CLASS__;\n\t\t\treturn self::$instance = new $class;\n\t\t}\n\t\treturn self::$instance;\n\t}", "public static function getInstance() {\n\t\tif (self::$instance === null) {\n\t\t\t$class = __CLASS__;\n\t\t\treturn self::$instance = new $class;\n\t\t}\n\t\treturn self::$instance;\n\t}", "public static function getInstance() {\n\t\tif (self::$instance === null) {\n\t\t\t$class = __CLASS__;\n\t\t\treturn self::$instance = new $class;\n\t\t}\n\t\treturn self::$instance;\n\t}", "public static function getInstance() {\n\t\tif (self::$instance === null) {\n\t\t\t$class = __CLASS__;\n\t\t\treturn self::$instance = new $class;\n\t\t}\n\t\treturn self::$instance;\n\t}", "public static function getInstance() {\n\t\tif (self::$instance === null) {\n\t\t\t$class = __CLASS__;\n\t\t\treturn self::$instance = new $class;\n\t\t}\n\t\treturn self::$instance;\n\t}", "public static function getInstance() {\n\t\tif (self::$instance === null) {\n\t\t\t$class = __CLASS__;\n\t\t\treturn self::$instance = new $class;\n\t\t}\n\t\treturn self::$instance;\n\t}", "public static function getInstance() {\n\t\tif (self::$instance === null) {\n\t\t\t$class = __CLASS__;\n\t\t\treturn self::$instance = new $class;\n\t\t}\n\t\treturn self::$instance;\n\t}", "public static function getInstance(){\n\t\tif(is_null(self::$instance)){\n\t\t\tself::$instance = new self;\n\t\t}\n\n\t\treturn self::$instance;\n\t}", "public static function getInstance() {\n if (!self::$instance instanceof self) {\n self::$instance = new self;\n }\n return self::$instance;\n }", "public static function getInstance() {\n if (!self::$instance instanceof self) {\n self::$instance = new self;\n }\n return self::$instance;\n }", "public static function getInstance() {\n if (!self::$instance instanceof self) {\n self::$instance = new self;\n }\n return self::$instance;\n }", "public static function getInstance() {\n if (!self::$instance instanceof self) {\n self::$instance = new self;\n }\n return self::$instance;\n }", "public static function getInstance(): self {\r\n\r\n if(null === static::$instance) {\r\n static::$instance = new self;\r\n }\r\n\r\n return static::$instance;\r\n }", "public static function getInstance(): self {\r\n\r\n if(null === static::$instance) {\r\n static::$instance = new self;\r\n }\r\n\r\n return static::$instance;\r\n }", "public static function getInstance()\n {\n if (isset(static::$instance)) {\n return static::$instance;\n }\n\n return static::$instance = new static();\n }", "public static function getInstance(){\n if (!self::$_instance){\n $class = __CLASS__;\n self::$_instance = new $class();\n }\n return self::$_instance;\n }", "public static function getInstance()\n {\n if (!isset(self::$instance))\n {\n self::$instance = new self; \n }\n\n return self::$instance;\n }", "public static function singleton() {\n if(!self::$singletonInstance) {\n $class = get_called_class();\n self::$singletonInstance = new $class();\n }\n return self::$singletonInstance;\n }", "public static function getInstance()\n {\n return GeneralUtility::makeInstance(__CLASS__);\n }", "public static function getInstance()\n {\n if (! self::$instance) {\n self::$instance = new self;\n }\n return self::$instance;\n }", "public static function getInstance() {\n if (self::$instance === null) {\n $class = __CLASS__;\n return self::$instance = new $class;\n }\n return self::$instance;\n }" ]
[ "0.80652976", "0.785836", "0.7841175", "0.7794719", "0.7771682", "0.7754331", "0.76484776", "0.76370275", "0.7599501", "0.7599501", "0.7599501", "0.7599501", "0.75991935", "0.75991935", "0.75991935", "0.7599005", "0.7599005", "0.7599005", "0.7554908", "0.75308365", "0.75048435", "0.74935716", "0.7487648", "0.74865454", "0.74822384", "0.7479876", "0.74750257", "0.7472991", "0.7472991", "0.74713194", "0.7469684", "0.74670017", "0.74670017", "0.7463506", "0.7431179", "0.7427848", "0.74216884", "0.7419722", "0.74183744", "0.74171734", "0.74151576", "0.7414956", "0.7414956", "0.7414345", "0.7404837", "0.7403705", "0.73934203", "0.7387822", "0.73862386", "0.7385541", "0.7385541", "0.73797864", "0.7378973", "0.7378973", "0.73788214", "0.737714", "0.73697186", "0.7368116", "0.7358952", "0.73584175", "0.73584175", "0.73583764", "0.73561984", "0.7355882", "0.7354847", "0.73507726", "0.73449683", "0.73449415", "0.7344632", "0.73430693", "0.73404545", "0.7340172", "0.733779", "0.733779", "0.7331638", "0.7328356", "0.7323853", "0.731606", "0.73097193", "0.73058033", "0.73058033", "0.73058033", "0.73058033", "0.73058033", "0.73058033", "0.73058033", "0.73058033", "0.7305727", "0.7304044", "0.7304044", "0.7304044", "0.7304044", "0.7303189", "0.7303189", "0.72997826", "0.7299595", "0.7295655", "0.729455", "0.7293611", "0.7293343", "0.72926444" ]
0.0
-1
Add WP CLI command.
public function add_cli_command() { if ( ! defined( 'WP_CLI' ) || ! WP_CLI ) { return; } WP_CLI::add_command( 'queue', '\WP_Queue\Command' ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function register_cli_commands() {\n\n\t\tif ( class_exists( 'WP_CLI' ) ) {\n\n\t\t\t\\WP_CLI::add_command(\n\t\t\t\tself::CMD_BUILD_ROOT_SITEMAP,\n\t\t\t\tarray( $this, 'cmd_build_root_sitemap' ),\n\t\t\t\tarray(\n\t\t\t\t\t'shortdesc' => 'Generate Yoast root sitemap.',\n\t\t\t\t\t'longdesc' => 'Generate Yoast root sitemap and save to cache file on disk.',\n\t\t\t\t)\n\t\t\t);\n\n\t\t}\n\n\t}", "public static function register() {\n\n if ( !defined( 'WP_CLI' ) || !WP_CLI ) {\n return;\n }\n \n $instance = new static;\n if(empty( $instance->namespace )) {\n throw new \\Exception(\"Command namespace not defined\", 1);\n \n }\n\t\t\\WP_CLI::add_command( $instance->namespace, $instance, $instance->args ?? null );\n\t}", "public function cli()\n {\n _APP_=='varimax' && $this->registerConsoleCommand();\n }", "public function addCommand($command);", "protected function addCommands()\n {\n $this->commands([\n MakeBlueprint::class,\n ]);\n }", "private function registerConsoleCommands()\n {\n $this->commands(BadasoSitemapSetup::class);\n $this->commands(BadasoSitemapTestSetup::class);\n }", "private function registerConsoleCommands()\n {\n // Console Commands\n }", "private function registerConsoleCommands()\n {\n // Console Commands\n }", "public function registerCommands(): void\n {\n if ($this->app->runningInConsole()) {\n $this->commands([GeneratePhaseRouter::class]);\n }\n }", "private function registerAppCommands()\n {\n }", "private function registerCommands() {\n\t\t$this->app->singleton('command.lemon.upload_migration', function ($app) {\n\t\t\treturn new MigrationCommand();\n\t\t});\n\t}", "public function add(Command $command);", "private function registerConsoleCommands()\n {\n $this->commands(Commands\\InstallCommand::class);\n $this->commands(Commands\\AdminCommand::class);\n }", "function init_thumbnail_command() {\n\trequire_once __DIR__ . '/src/ThumbnailCommand.php';\n\n\tadd_action( 'cli_init', function() {\n\t\ttry {\n\t\t\tWP_CLI::add_command( 'thumbnail', ThumbnailCommand::class );\n\t\t} catch ( Throwable $e ) {\n\t\t\t//\n\t\t}\n\t} );\n}", "protected function registerCrudCommand()\n {\n $this->app->singleton('command.core.crud', function () {\n return new \\Pw\\Core\\Console\\Commands\\CoreCrudCommand();\n });\n\n $this->commands('command.core.crud');\n }", "private function registerPluginMakeCommand()\n {\n $this->app->bindShared('command.make.plugin', function ($app)\n {\n return new PluginMakeCommand($app['files'], $app['plugins']);\n });\n\n $this->commands('command.make.plugin');\n }", "protected function registerMigrationCommand()\n {\n $this->app->singleton('command.core.migration', function () {\n return new \\Pw\\Core\\Console\\Commands\\CoreMigrationCommand();\n });\n\n $this->commands('command.core.migration');\n }", "public function registerArtisanCommand()\n\t{\n\t\t$this->app->bindShared('optimus-prime.transformer.make', function($app)\n\t\t{\n\t\t\treturn $app->make('Mosaiqo\\OptimusPrime\\Console\\TransformerGenerate');\n\t\t});\n\n\t\t$this->commands('optimus-prime.transformer.make');\n\t}", "protected function registerInstallCommand()\n {\n $this->app->singleton('command.core.install', function () {\n return new \\Pw\\Core\\Console\\Commands\\CoreInstallCommand();\n });\n\n $this->commands('command.core.install');\n }", "private function registerCommands()\n {\n $this->add(new RunCommand());\n }", "private function registerConsoleCommands()\n {\n $this->commands(DB2Reader\\Commands\\SyncStructures::class);\n }", "protected function registerCommands()\n {\n if ($this->app->runningInConsole()) {\n $this->commands([\n InstallCommand::class,\n MakeTileCommand::class,\n ]);\n }\n }", "public function cli()\n {\n global $redis_server;\n\n if (empty($redis_server)) {\n # Attempt to automatically load Pantheon's Redis config from the env.\n if (isset($_SERVER['CACHE_HOST'])) {\n $redis_server = [\n 'host' => $_SERVER['CACHE_HOST'],\n 'port' => $_SERVER['CACHE_PORT'],\n 'auth' => $_SERVER['CACHE_PASSWORD'],\n ];\n } else {\n $redis_server = [\n 'host' => '127.0.0.1',\n 'port' => 6379,\n ];\n }\n }\n\n if (!isset($redis_server['database'])) {\n $redis_server['database'] = 0;\n }\n\n $cmd = WP_CLI\\Utils\\esc_cmd('redis-cli -h \"%s\" -p \"%s\" -a \"%s\" -n \"%d\"', $redis_server['host'], $redis_server['port'], $redis_server['auth'], $redis_server['database']);\n WP_CLI::launch($cmd);\n\n }", "protected function registerCommands()\n {\n $this->add(new Command\\BuildCommand());\n }", "private function registerMigrationMakeCommand()\n {\n $this->app->bindShared('command.make.plugin.migration', function ($app)\n {\n return new MigrationMakeCommand($app['files'], $app['plugins']);\n });\n\n $this->commands('command.make.plugin.migration');\n }", "protected function loadCommand()\r {\r $this->addCommandLine( 'lsb_release -a');\r\r }", "public function command( $args, $assoc_args = array() ) {\n\n \\WP_CLI::run_command( $args, $assoc_args );\n }", "private function registerPolicyMakeCommand()\n {\n $this->app->bindShared('command.make.plugin.policy', function ($app)\n {\n return new PolicyMakeCommand($app['files'], $app['plugins']);\n });\n\n $this->commands('command.make.plugin.policy');\n }", "protected function registerCommands()\n {\n if ($this->app->runningInConsole()) {\n $this->commands([\n CreateService::class,\n CreateInterface::class,\n CreateProvider::class,\n ]);\n }\n }", "private function possiblyRewriteWpCliCommand($command)\n {\n if (!Strings::startsWith($command, \"wp \")) {\n return $command;\n }\n\n $command = substr($command, 3); // strip \"wp \" prefix\n $command = \"php \" . ProcessUtils::escapeshellarg($this->getWpCli()) . \" $command\";\n\n return $command;\n }", "protected function registerCommands()\n {\n if ($this->app->runningInConsole()) {\n $this->commands([\n InstallCommand::class,\n ]);\n }\n }", "protected function registerCommands()\n {\n $this->commands([\n // \"jwt:generate\" command (generates keys).\n KeyGenerateCommand::class,\n ]);\n }", "public static function help() {\n\t\tWP_CLI::line( <<<EOB\nusage: wp core update\n or: wp core version [--extra]\n or: wp core install --site_url=example.com --site_title=<site-title> [--admin_name=<username>] --admin_password=<password> --admin_email=<email-address>\nEOB\n\t);\n\t}", "protected function registerCommands()\n {\n if ($this->app->runningInConsole()) {\n $this->commands([\n Console\\AddLaratrustUserTraitUseCommand::class,\n Console\\MakePermissionCommand::class,\n Console\\MakeRoleCommand::class,\n Console\\MakeSeederCommand::class,\n Console\\MakeTeamCommand::class,\n Console\\MigrationCommand::class,\n Console\\SetupCommand::class,\n Console\\SetupTeamsCommand::class,\n Console\\UpgradeCommand::class,\n ]);\n }\n }", "protected function registerCommands(): void\n {\n $this->commands([\n\n ]);\n }", "function wpmdb_cli_loaded() {\n\tif ( defined( 'WP_CLI' ) && WP_CLI && ! class_exists( 'WPMDB_Command' ) ) {\n\t\trequire_once dirname( __FILE__ ) . '/class/wpmdb-command.php';\n\t}\n}", "private function createCli() {\n $this->cli = new Cli();\n $this->commands = $this->commandParser->getAllCommands();\n\n foreach ($this->commands as $command) {\n if ($command->isDefault()) {\n $this->cli->command(\"*\");\n foreach ($command->getOptions() as $option) {\n $this->cli->opt($option->getName(), $option->getDescription(), $option->isRequired(), $option->getType());\n }\n foreach ($command->getArguments() as $argument) {\n if (!$argument->isVariadic())\n $this->cli->arg($argument->getName(), $argument->getDescription(), $argument->isRequired());\n }\n }\n if ($command->getName() != \"\") {\n $this->cli->command($command->getName())->description($command->getDescription());\n foreach ($command->getOptions() as $option) {\n $this->cli->opt($option->getName(), $option->getDescription(), $option->isRequired(), $option->getType());\n }\n foreach ($command->getArguments() as $argument) {\n if (!$argument->isVariadic())\n $this->cli->arg($argument->getName(), $argument->getDescription(), $argument->isRequired());\n }\n }\n }\n\n\n }", "protected function registerPluginMigrateCommand()\n {\n $this->app->singleton('command.plugin.migrate', function ($app) {\n return new PluginMigrateCommand($app['migrator'], $app['plugins']);\n });\n\n $this->commands('command.plugin.migrate');\n }", "protected function registerApplicationCommands()\n {\n if (!is_dir($dir = __DIR__.'/../Command')) {\n return;\n }\n\n $finder = new Finder();\n $finder->files()->name('*Command.php')->in($dir);\n\n $prefix = 'Phlexget\\\\Command';\n foreach ($finder as $file) {\n $ns = $prefix;\n if ($relativePath = $file->getRelativePath()) {\n $ns .= '\\\\'.strtr($relativePath, '/', '\\\\');\n }\n $r = new \\ReflectionClass($ns.'\\\\'.$file->getBasename('.php'));\n if ($r->isSubclassOf('Symfony\\\\Component\\\\Console\\\\Command\\\\Command') && !$r->isAbstract()) {\n $this->add($r->newInstance());\n }\n }\n }", "private function registerCommand()\n {\n $this->app->singleton('command.shenma.push', function () {\n return new \\Larva\\Shenma\\Push\\Commands\\Push();\n });\n\n $this->app->singleton('command.shenma.push.retry', function () {\n return new \\Larva\\Shenma\\Push\\Commands\\PushRetry();\n });\n }", "public function __construct(){\n\n global $argv;\n\n if(!isset($argv[1])){\n echo 'You must supply a command!' . PHP_EOL;\n exit;\n }//if\n\n $args = $argv;\n\n $scriptName = array_shift($args);\n $method = array_shift($args);\n\n $method = explode('-',$method);\n foreach($method as $k => $v){\n if($k != 0){\n $method[$k] = ucwords($v);\n }//if\n }//foreach\n\n $method = implode('',$method);\n\n $resolved = false;\n\n if(method_exists($this,$method)){\n call_user_func(Array($this,$method), $args);\n $resolved = true;\n }//if\n else {\n foreach(static::$extendedCommands as $commandClass){\n if(method_exists($commandClass,$method)){\n call_user_func(Array($commandClass,$method), $args);\n $resolved = true;\n break;\n }//if\n }//foreach\n }//el\n\n if(!$resolved){\n echo \"`{$method}` is not a valid CLI command!\";\n }//if\n\n echo PHP_EOL;\n exit;\n\n }", "protected function registerCommands()\n\t{\n\t\t$this->addCommand(new Command\\Generate\\Generate);\n\t\t$this->addCommand(new Command\\Init\\Init);\n\t\t$this->addCommand(new Command\\Convert\\Convert);\n\t}", "protected function registerCommands()\n {\n if ($this->app->runningInConsole()) {\n $this->commands([\n KnetCommand::class,\n InstallCommand::class,\n PublishCommand::class,\n ]);\n }\n }", "private function registerMiddlewareMakeCommand()\n {\n $this->app->bindShared('command.make.plugin.middleware', function ($app)\n {\n return new MiddlewareMakeCommand($app['files'], $app['plugins']);\n });\n\n $this->commands('command.make.plugin.middleware');\n }", "private function setupCommands(): void\n {\n if ($this->app->runningInConsole()) {\n // $this->commands([\n // ]);\n }\n }", "public function registerCommands()\n\t{\n// Artisan::add(new InstallCommand);\n// Artisan::add(new UpdateCommand);\n \n\t\t$commands = array('SkinsInstall','SkinsUpdate');\n\n\t\tforeach ($commands as $command)\n\t\t{\n\t\t\t$this->{'register'.$command.'Command'}();\n\t\t}\n\n\t\t$this->commands(\n\t\t\t'command.skins.install','command.skins.update'\n\t\t);\n \n\t}", "protected function registerCommands()\n {\n $this->commands([\n ConvertCommand::class,\n ]);\n }", "protected function commands()\n {\n $this->load(__DIR__.'/Commands');\n \n require base_path('routes/console.php');\n }", "function wp_cli_app_basic_composer( $args, $assoc_args ) {\n\n\t//Check Composer is installed in System\n\tif ( CLI::command_exists( \"composer\" ) === false ) {\n\t\tCLI::error( \"Composer Package Manager is not active in your system, read more : https://getcomposer.org/doc/00-intro.md\" );\n\t\treturn;\n\t}\n\n\t//Check Active Workspace\n\tWorkSpace::is_active_workspace();\n\t$workspace = WorkSpace::get_workspace();\n\n\t//Create Custom Composer Cli\n\t$arg = array();\n\tfor ( $x = 0; $x <= 3; $x ++ ) {\n\t\tif ( isset( $args[ $x ] ) and ! empty( $args[ $x ] ) ) {\n\t\t\t$arg[] = $args[ $x ];\n\t\t}\n\t}\n\n\t//Run command\n\tCLI::run_composer( $workspace['path'], $arg );\n}", "protected function commands() {\n require base_path('routes/console.php');\n }", "private function registerUpdateGeoIpCommand()\n {\n $this->app->singleton('firewall.updategeoip.command', function () {\n return new UpdateGeoIpCommand();\n });\n\n $this->commands('firewall.updategeoip.command');\n }", "protected function commands()\n {\n require base_path('routes/console.php');\n }", "protected function commands()\n {\n require base_path('routes/console.php');\n }", "protected function commands()\n {\n require base_path('routes/console.php');\n }", "protected function commands()\n {\n require base_path('routes/console.php');\n }", "protected function commands()\n {\n require base_path('routes/console.php');\n }", "protected function commands()\n {\n require base_path('routes/console.php');\n }", "protected function commands()\n {\n require base_path('routes/console.php');\n }", "protected function commands()\n {\n require base_path('routes/console.php');\n }", "protected function commands()\n {\n require base_path('routes/console.php');\n }", "protected function commands()\n {\n require base_path('routes/console.php');\n }", "protected function commands()\n {\n require base_path('routes/console.php');\n }", "protected function commands()\n {\n require base_path('routes/console.php');\n }", "protected function commands()\n {\n require base_path('routes/console.php');\n }", "protected function commands()\n {\n require base_path('routes/console.php');\n }", "protected function commands()\n {\n require base_path('routes/console.php');\n }", "protected function commands()\n {\n require base_path('routes/console.php');\n }", "protected function commands()\n {\n require base_path('routes/console.php');\n }", "protected function commands()\n {\n require base_path('routes/console.php');\n }", "protected function commands()\n {\n require base_path('routes/console.php');\n }", "protected function commands()\n {\n require base_path('routes/console.php');\n }", "protected function commands()\n {\n require base_path('routes/console.php');\n }", "protected function commands()\n {\n require base_path('routes/console.php');\n }", "protected function commands()\n {\n require base_path('routes/console.php');\n }", "protected function commands()\n {\n require base_path('routes/console.php');\n }", "protected function commands()\n {\n require base_path('routes/console.php');\n }", "protected function commands()\n {\n require base_path('routes/console.php');\n }", "protected function commands()\n {\n require base_path('routes/console.php');\n }", "protected function commands()\n {\n require base_path('routes/console.php');\n }", "protected function commands()\n {\n require base_path('routes/console.php');\n }", "protected function commands()\n {\n require base_path('routes/console.php');\n }", "protected function commands()\n {\n require base_path('routes/console.php');\n }", "protected function commands()\n {\n require base_path('routes/console.php');\n }", "protected function commands()\n {\n require base_path('routes/console.php');\n }", "protected function commands()\n {\n require base_path('routes/console.php');\n }", "protected function commands()\n {\n require base_path('routes/console.php');\n }", "protected function commands()\n {\n require base_path('routes/console.php');\n }", "protected function commands()\n {\n require base_path('routes/console.php');\n }", "protected function commands()\n {\n require base_path('routes/console.php');\n }", "protected function commands ()\n {\n require( base_path( 'routes/console.php' ) );\n }", "public function addCommand(CommandInterface $command);", "public function register()\n {\n $this->commands(['Serbinario\\L5scaffold\\Console\\Commands\\CrudGeneratorCommand']);\n\n //\n }", "protected function commands()\n {\n $this->load(__DIR__.'/Commands');\n\n require base_path('routes/console.php');\n }", "protected function commands()\n {\n $this->load(__DIR__.'/Commands');\n\n require base_path('routes/console.php');\n }", "protected function commands()\n {\n $this->load(__DIR__.'/Commands');\n\n require base_path('routes/console.php');\n }", "protected function commands()\n {\n $this->load(__DIR__.'/Commands');\n\n require base_path('routes/console.php');\n }", "protected function commands()\n {\n $this->load(__DIR__.'/Commands');\n\n require base_path('routes/console.php');\n }", "protected function commands()\n {\n $this->load(__DIR__.'/Commands');\n\n require base_path('routes/console.php');\n }", "protected function commands()\n {\n $this->load(__DIR__.'/Commands');\n\n require base_path('routes/console.php');\n }", "protected function commands()\n {\n $this->load(__DIR__.'/Commands');\n\n require base_path('routes/console.php');\n }" ]
[ "0.72252625", "0.7049735", "0.66015345", "0.6450656", "0.63470525", "0.62052137", "0.6198959", "0.6198959", "0.6187183", "0.6162497", "0.6139383", "0.61131215", "0.60139847", "0.60010636", "0.59949106", "0.59924716", "0.5977211", "0.5945258", "0.59152514", "0.58994615", "0.5886761", "0.5884938", "0.5882533", "0.5858408", "0.5852901", "0.5851411", "0.5846177", "0.5845817", "0.5840411", "0.57989883", "0.57982993", "0.5731856", "0.572011", "0.5714154", "0.56747055", "0.5669589", "0.5661585", "0.56136256", "0.559368", "0.55892533", "0.5578979", "0.5556724", "0.554065", "0.552906", "0.54967266", "0.5478669", "0.5467714", "0.5467606", "0.5466933", "0.546182", "0.5436038", "0.54304916", "0.54304916", "0.54304916", "0.54304916", "0.54304916", "0.54304916", "0.54304916", "0.54304916", "0.54304916", "0.54304916", "0.54304916", "0.54304916", "0.54304916", "0.54304916", "0.54304916", "0.54304916", "0.54304916", "0.54304916", "0.54304916", "0.54304916", "0.54304916", "0.54304916", "0.54304916", "0.54304916", "0.54304916", "0.54304916", "0.54304916", "0.54304916", "0.54304916", "0.54304916", "0.54304916", "0.54304916", "0.54304916", "0.54304916", "0.54304916", "0.54304916", "0.54304916", "0.54304916", "0.5407047", "0.540066", "0.53857833", "0.5384171", "0.5384171", "0.5384171", "0.5384171", "0.5384171", "0.5384171", "0.5384171", "0.5384171" ]
0.8000306
0
Register the cron Worker.
public function register_cron_worker() { $attempts = add_filter( 'wp_queue_cron_attempts', 3 ); $cron = new Cron( $this->worker( $attempts ) ); $cron->init(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function addcron() {\r\n $os = php_uname('s');\r\n\r\n $file = APP_PATH . '/index.php?c=cron&a=apply';\r\n\r\n\r\n switch ($os) {\r\n case substr($os, 0, 7) == 'Windows':\r\n exec(\"schtasks /create /sc minute /mo 5 /tn 'update_quota' /tr . $file . /ru 'System'\");\r\n break;\r\n\r\n case substr($os, 0, 5) == 'Linux':\r\n switch ($_SERVER['SERVER_PORT']) {\r\n case 80:\r\n $url = 'http://' . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'];\r\n break;\r\n\r\n case 443:\r\n $url = 'https://' . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'];\r\n break;\r\n\r\n default:\r\n $url = 'http://' . $_SERVER['SERVER_NAME'] . ':' . $_SERVER['SERVER_PORT'] . $_SERVER['REQUEST_URI'];\r\n }\r\n\r\n $cmdline = '*/5 * * * * /usr/bin/curl' . $url;\r\n\r\n exec('crontab -e <' . $cmdline);\r\n break;\r\n }\r\n }", "public function registerWorker()\r\n {\r\n Resque::redis()->sadd('workers', $this);\r\n setlocale(LC_TIME, \"\");\r\n setlocale(LC_ALL, \"en\");\r\n Resque::redis()->set('worker:' . (string)$this . ':started', strftime('%a %b %d %H:%M:%S %Z %Y'));\r\n }", "public function registerWorker()\n\t{\n\t\tResque::redis()->sadd('workers', (string)$this);\n\t\tResque::redis()->set('worker:' . (string)$this . ':started', date('c'));\n\t}", "public function addCron() { // cron parameters passed via JSON query string\n\t\t$cron = json_decode(Flight::request()->query['cron'],true);\n\t\t$t = explode(\":\",$cron['t']); //time\n\t\t$i= 0;\n\t\t$str='';\n\t\tforeach ($cron['d'] as $d) { //compose day of Week\n\t\t\tif ($d) $str .= $i.',';\n\t\t\t$i++;\n\t\t};\n\t\t$str = rtrim($str,',');\n\t\t$cronLine = $t[1].' '.$t[0].' * * '.$str.' /usr/bin/curl localhost/radion >/dev/null 2>&1 #'.$cron['c'].PHP_EOL;\n\t\tfile_put_contents(Flight::get(\"pathCron\"), $cronLine, FILE_APPEND | LOCK_EX);\n\t\texec(\"cat \".Flight::get(\"pathCron\").\" | crontab -\");\n\t\tFlight::json(array('Status' => 'OK','Cron' => $t[1].' '.$t[0].' * * '.$str.' #'.$cron['c']));\n\t}", "function install_cron(){\n wp_schedule_event(\n time(),\n 'cuentadigital_interval',\n 'cuentadigital_cron_hook'\n );\n }", "public function run() {\n\t\t$this->cronStarts = time() - 1;\n\t\tif (!$this->isOtherCronRunning()) {\n\t\t\t$config = new UnzerCw_SettingApi();\n\t\t\tUnzerCw_MutableConstantApi::setConstant(self::CRON_MUTEX_NAME, 0);\n\t\t}\n\t\t$cronProcessor = new Customweb_Cron_Processor(UnzerCw_Util::getContainer());\n\t\t$cronProcessor->run();\n\t}", "public function schedule_cron() {\n\t\twp_schedule_event( time(), 'daily', 'download_iracing_members_files' );\n\t\twp_schedule_event( time(), 'daily', 'convert_iracing_members_file_to_json' );\n\t}", "static function cron() {\n\t\tself::starter();\n\t\tself::ender();\n\t}", "public function cron() {\n include('programming_cron.php');\n }", "public static function setup_sync_cronjob() {\n\t\tself::$timezone_string = get_option( 'timezone_string' );\n\t\tif ( ! wp_next_scheduled( self::SYNC_CRONJOB_NAME ) ) {\n\t\t\twp_schedule_event( Carbon::parse( '4am', self::$timezone_string )->getTimestamp(), 'daily', self::SYNC_CRONJOB_NAME );\n\t\t}\n\t}", "public function cron() {\n settings()->cron = json_decode(db()->where('`key`', 'cron')->getValue('settings', '`value`'));\n\n $this->process();\n }", "function add_custom_cron() {\n\tif ( ! wp_next_scheduled( 'custom_cron_action' ) ) {\n\t\twp_schedule_event( current_time( 'timestamp' ), 'hourly', 'custom_cron_action' );\n\t}\n}", "public function cron()\n {\n wp_schedule_event(time(), 'hourly', array($this, 'generate'));\n }", "public static function init()\n\t{\n\t\tCronJob::getInstance();\n\t}", "function install_cron_scheduler() {\n\tglobal $amp_conf;\n\tglobal $nt;\n\n\t// crontab appears to return an error when no entries, os only fail if error returned AND a list of entries.\n\t// Don't know if this will ever happen, but a failure and a list could indicate something wrong.\n\t//\n\t$outlines = array();\n\texec(\"/usr/bin/crontab -l\", $outlines, $ret);\n\tif ($ret && count($outlines)) {\n\t\t$nt->add_error('retrieve_conf', 'CRONMGR', _(\"Failed to check crontab for cron manager\"), sprintf(_(\"crontab returned %s error code when checking for crontab entries to start freepbx-cron-scheduler.php crontab manager\"),$ret));\n\t} else {\n\t\t$nt->delete('retrieve_conf', 'CRONMGR');\n\t\t$outlines2 = preg_grep(\"/freepbx-cron-scheduler.php/\",$outlines);\n\t\t$cnt = count($outlines2);\n\t\tswitch ($cnt) {\n\t\t\tcase 0:\n\t\t\t\t/** grab any other cronjobs that are running as asterisk and NOT associated with backups\n \t\t\t\t* this code was taken from the backup module for the most part. But seems to work...\n \t\t\t\t*/\n\t\t\t\t$outlines = array();\n\t\t\t\texec(\"/usr/bin/crontab -l | grep -v ^#\\ DO\\ NOT | grep -v ^#\\ \\( | grep -v freepbx-cron-scheduler.php\", $outlines, $ret);\n\t\t\t\t$crontab_entry = \"\";\n\t\t\t\tforeach ($outlines as $line) {\n\t\t\t\t\t$crontab_entry .= $line.\"\\n\";\n\t\t\t\t}\n\t\t\t\t// schedule to run hourly, at a random time. The random time is explicit to accomodate things like module_admin online update checking\n\t\t\t\t// since we will want a random access to the server. In the case of module_admin, that will also be scheduled randomly within the hour\n\t\t\t\t// that it is to run\n\t\t\t\t//\n\t\t\t\t$crontab_entry .= rand(0,59).\" * * * * \".$amp_conf['AMPBIN'].\"/freepbx-cron-scheduler.php\";\n\t\t\t\tsystem(\"/bin/echo '$crontab_entry' | /usr/bin/crontab -\");\n\t\t\t\tbreak;\n\t\t\tcase 1:\n\t\t\t\t// already running, nothing to do\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t// error, there should never be more than one running\n\t\t\t\techo \"TODO: deal with error here\\n\";\n\t\t\t\t$nt->add_error('retrieve_conf', 'CRONMGR', _(\"Multiple freepbx-cron-scheduler.php running\"), sprintf(_(\"There were %s freepbx-cron-scheduler.php instances running. There should be only 1.\"),$cnt));\n\t\t}\n\t}\n}", "function registry()\n\t{\n\t\tif ( !wp_next_scheduled( 'admin_action_delibera_cron_action' ) ) // if already been scheduled, will return a time \n\t\t{\n\t\t\twp_schedule_event(time(), 'hourly', 'admin_action_delibera_cron_action');\n\t\t}\n\t}", "public function init(): void\n {\n add_action(self::CRON_JOB_HOOK, [$this, 'runCronJob'], 10, 0);\n }", "function start()\n {\n\n // initialize crontab as user www-data\n $crontab = new Engine\\Crontab('www-data');\n\n // show exists tasks as array\n print_r($crontab->crontabs);\n // add cron task\n// $crontab->addCron(0, \"*\", \"*\", \"*\", \"*\", \"ls -al\");\n// $crontab->writeCrontab();\n // delete cron task\n// $crontab->delEntry(0);\n// $crontab->writeCrontab();\n\n $this->tpl->setBlock(\"breadcrumb\",'<a href=\"/crontab\">Crontab example</a>');\n $this->tpl->setBlock('content','');\n }", "static public function activate()\n {\n do_action( \"sc_wpfmp_enable_wp_cron\" ); // Go enable cron\n }", "function wp_doing_cron()\n {\n }", "static function schedule_cron() {\n\t\t$is_multisite = is_multisite();\n\t\tif ( $is_multisite ) {\n\t\t\t$primary_blog = get_current_site();\n\t\t\t$current_blog = get_current_blog_id();\n\t\t} else {\n\t\t\t$primary_blog = 1;\n\t\t\t$current_blog = 1;\n\t\t}\n\n\t\t/**\n\t\t * If we're on a multisite, only schedule the cron if we're on the primary blog\n\t\t */\n\t\tif (\n\t\t( ! $is_multisite || ( $is_multisite && $primary_blog->id === $current_blog ) )\n\t\t) {\n\t\t\t$cronsScheduled = false;\n\t\t\tif( ! wp_next_scheduled( 'wp_rest_cache_cron' ) ) {\n\t\t\t\twp_schedule_event( time(), '5_minutes', 'wp_rest_cache_cron' );\n\t\t\t\t$cronsScheduled = true;\n\t\t\t}\n\t\t\tif( ! wp_next_scheduled( 'wp_rest_cache_expired_cron' ) ) {\n\t\t\t\twp_schedule_event( time(), 'hourly', 'wp_rest_cache_expired_cron' );\n\t\t\t\t$cronsScheduled = true;\n\t\t\t}\n\t\t\tif( $cronsScheduled ) {\n\t\t\t\tdo_action( 'wrc_after_schedule_cron', $primary_blog, $current_blog );\n\t\t\t}\n\t\t}\n\t}", "private function __construct()\n\t{\n\t\tadd_filter('cron_schedules', array($this,'addCronSchedules'));\n\t\tadd_action('wp', array($this, 'cronStarterActivation'));\n\t}", "function _schedule_cron( $hook, $recurrence = null, $time = null ) {\n\t\tIMFORZA_Utils::schedule_cron( $hook, $recurrence, $time );\n\t}", "public function register()\n {\n parent::register();\n\n $this->configureQueue();\n\n $this->registerWorkCommand();\n }", "function addCronTask()\n{\n require_once __DIR__.\"/models/SchedulesModel.php\";\n require_once __DIR__.\"/models/LogModel.php\";\n\n // Emojione client\n $Emojione = new \\Emojione\\Client(new \\Emojione\\Ruleset());\n\n\n // Get auto repost schedules\n $Schedules = new SchedulesModel;\n $Schedules->where(\"is_active\", \"=\", 1)\n ->where(\"schedule_date\", \"<=\", date(\"Y-m-d H:i:s\"))\n ->where(\"end_date\", \">=\", date(\"Y-m-d H:i:s\"))\n ->orderBy(\"last_action_date\", \"ASC\")\n ->setPageSize(5) // required to prevent server overload\n ->setPage(1)\n ->fetchData();\n\n if ($Schedules->getTotalCount() < 1) {\n // There is not any active schedule\n return false;\n }\n\n // Settings\n $settings = namespace\\settings();\n\n // Random delays between actions\n $random_delay = 0;\n if ($settings->get(\"data.random_delay\")) {\n $random_delay = rand(0, 3600); // up to an hour\n }\n\n // Speeds (action count per day)\n $default_speeds = [\n \"very_slow\" => 1,\n \"slow\" => 2,\n \"medium\" => 3,\n \"fast\" => 4,\n \"very_fast\" => 5,\n ];\n $speeds = $settings->get(\"data.speeds\");\n if (empty($speeds)) {\n $speeds = [];\n } else {\n $speeds = json_decode(json_encode($speeds), true);\n }\n $speeds = array_merge($default_speeds, $speeds);\n\n\n $as = [__DIR__.\"/models/ScheduleModel.php\", __NAMESPACE__.\"\\ScheduleModel\"];\n foreach ($Schedules->getDataAs($as) as $sc) {\n $Log = new LogModel;\n $Account = \\Controller::model(\"Account\", $sc->get(\"account_id\"));\n $User = \\Controller::model(\"User\", $sc->get(\"user_id\"));\n\n // Set default values for the log (not save yet)...\n $Log->set(\"user_id\", $User->get(\"id\"))\n ->set(\"account_id\", $Account->get(\"id\"))\n ->set(\"status\", \"error\");\n\n // Check the account\n if (!$Account->isAvailable() || $Account->get(\"login_required\")) {\n // Account is either removed (unexected, external factors)\n // Or login reqiured for this account\n // Deactivate schedule\n $sc->set(\"is_active\", 0)->save();\n\n // Log data\n $Log->set(\"data.error.msg\", \"Activity has been stopped\")\n ->set(\"data.error.details\", \"Re-login is required for the account.\")\n ->save();\n continue;\n }\n\n // Check the user\n if (!$User->isAvailable() || !$User->get(\"is_active\") || $User->isExpired()) {\n // User is not valid\n // Deactivate schedule\n $sc->set(\"is_active\", 0)->save();\n\n // Log data\n $Log->set(\"data.error.msg\", \"Activity has been stopped\")\n ->set(\"data.error.details\", \"User account is either disabled or expired.\")\n ->save();\n continue;\n }\n\n if ($User->get(\"id\") != $Account->get(\"user_id\")) {\n // Unexpected, data modified by external factors\n // Deactivate schedule\n $sc->set(\"is_active\", 0)->save();\n continue;\n }\n\n // Check user access to the module\n $user_modules = $User->get(\"settings.modules\");\n if (!is_array($user_modules) || !in_array(IDNAME, $user_modules)) {\n // Module is not accessible to this user\n // Deactivate schedule\n $sc->set(\"is_active\", 0)->save();\n\n // Log data\n $Log->set(\"data.error.msg\", \"Activity has been stopped\")\n ->set(\"data.error.details\", \"Module is not accessible to your account.\")\n ->save();\n continue;\n }\n\n // Calculate next schedule datetime...\n if (isset($speeds[$sc->get(\"speed\")]) && (int)$speeds[$sc->get(\"speed\")] > 0) {\n $speed = (int)$speeds[$sc->get(\"speed\")];\n $delta = round(86400/$speed) + $random_delay;\n } else {\n $delta = rand(1200, 21600); // 20 min - 6 hours\n }\n\n $next_schedule = date(\"Y-m-d H:i:s\", time() + $delta);\n if ($sc->get(\"daily_pause\")) {\n $pause_from = date(\"Y-m-d\").\" \".$sc->get(\"daily_pause_from\");\n $pause_to = date(\"Y-m-d\").\" \".$sc->get(\"daily_pause_to\");\n if ($pause_to <= $pause_from) {\n // next day\n $pause_to = date(\"Y-m-d\", time() + 86400).\" \".$sc->get(\"daily_pause_to\");\n }\n\n if ($next_schedule > $pause_to) {\n // Today's pause interval is over\n $pause_from = date(\"Y-m-d H:i:s\", strtotime($pause_from) + 86400);\n $pause_to = date(\"Y-m-d H:i:s\", strtotime($pause_to) + 86400);\n }\n\n if ($next_schedule >= $pause_from && $next_schedule <= $pause_to) {\n $next_schedule = $pause_to;\n }\n }\n $sc->set(\"schedule_date\", $next_schedule)\n ->set(\"last_action_date\", date(\"Y-m-d H:i:s\"))\n ->save();\n\n\n // Parse targets\n $targets = @json_decode($sc->get(\"target\"));\n if (is_null($targets)) {\n // Unexpected, data modified by external factors or empty targets\n // Deactivate schedule\n $sc->set(\"is_active\", 0)->save();\n continue;\n }\n\n if (count($targets) < 1) {\n // Couldn't find any target for the feed\n // Log data\n $Log->set(\"data.error.msg\", \"Couldn't find any target to search for the feed.\")\n ->save();\n return false;\n }\n\n // Select random target from the defined target collection\n $i = rand(0, count($targets) - 1);\n $target = $targets[$i];\n\n if (empty($target->type) || empty($target->id) ||\n !in_array($target->type, [\"hashtag\", \"location\", \"people\"])) \n {\n // Unexpected invalid target, \n // data modified by external factors\n $sc->set(\"is_active\", 0)->save();\n continue; \n }\n\n $Log->set(\"data.trigger\", $target);\n\n\n // Login into the account\n try {\n $Instagram = \\InstagramController::login($Account);\n } catch (\\Exception $e) {\n // Couldn't login into the account\n $Account->refresh();\n\n // Log data\n if ($Account->get(\"login_required\")) {\n $sc->set(\"is_active\", 0)->save();\n $Log->set(\"data.error.msg\", \"Activity has been stopped\");\n } else {\n $Log->set(\"data.error.msg\", \"Action re-scheduled\");\n }\n $Log->set(\"data.error.details\", $e->getMessage())\n ->save();\n\n continue;\n }\n\n\n // Logged in successfully\n $permissions = $User->get(\"settings.post_types\");\n $video_processing = isVideoExtenstionsLoaded() ? true : false;\n\n $acceptable_media_types = [];\n if (!empty($permissions->timeline_photo)) {\n $acceptable_media_types[] = \"1\"; // Photo\n }\n\n if (!empty($permissions->timeline_video)) {\n $acceptable_media_types[] = \"2\"; // Video\n }\n\n if (!empty($permissions->album_photo) || !empty($permissions->album_video)) {\n $acceptable_media_types[] = \"8\"; // Album\n }\n\n\n // Generate a random rank token.\n $rank_token = \\InstagramAPI\\Signatures::generateUUID();\n\n if ($target->type == \"hashtag\") {\n $hashtag = str_replace(\"#\", \"\", trim($target->id));\n if (!$hashtag) {\n continue;\n }\n\n try {\n $feed = $Instagram->hashtag->getFeed(\n $hashtag,\n $rank_token);\n } catch (\\Exception $e) {\n // Couldn't get instagram feed related to the hashtag\n // Log data\n $msg = $e->getMessage();\n $msg = explode(\":\", $msg, 2);\n $msg = isset($msg[1]) ? $msg[1] : $msg[0];\n\n $Log->set(\"data.error.msg\", \"Couldn't get the feed\")\n ->set(\"data.error.details\", $msg)\n ->save();\n continue;\n }\n\n $items = array_merge($feed->getRankedItems(), $feed->getItems());\n } else if ($target->type == \"location\") {\n try {\n $feed = $Instagram->location->getFeed(\n $target->id, \n $rank_token);\n } catch (\\Exception $e) {\n // Couldn't get instagram feed related to the location id\n // Log data\n $msg = $e->getMessage();\n $msg = explode(\":\", $msg, 2);\n $msg = isset($msg[1]) ? $msg[1] : $msg[0];\n\n $Log->set(\"data.error.msg\", \"Couldn't get the feed\")\n ->set(\"data.error.details\", $msg)\n ->save();\n continue;\n }\n\n $items = $feed->getItems();\n } else if ($target->type == \"people\") {\n try {\n $feed = $Instagram->timeline->getUserFeed($target->id);\n } catch (\\Exception $e) {\n // Couldn't get instagram feed related to the user id\n // Log data\n $msg = $e->getMessage();\n $msg = explode(\":\", $msg, 2);\n $msg = isset($msg[1]) ? $msg[1] : $msg[0];\n\n $Log->set(\"data.error.msg\", \"Couldn't get the feed\")\n ->set(\"data.error.details\", $msg)\n ->save();\n continue;\n }\n\n $items = $feed->getItems();\n }\n\n\n // Found feed item to repost\n $feed_item = null;\n\n // Shuffe items\n shuffle($items);\n\n // Iterate through the items to find a proper item to repost\n foreach ($items as $item) {\n if (!$item->getId()) {\n // Item is not valid\n continue;\n }\n\n if (!in_array($item->getMediaType(), $acceptable_media_types)) {\n // User has not got a permission to post this kind of the item\n continue;\n }\n\n if ($item->getMediaType() == 2 && !$video_processing) {\n // Video processing is not possible now,\n // FFMPEG is not configured\n continue;\n }\n\n if ($item->getMediaType() == 8) {\n $medias = $item->getCarouselMedia();\n $is_valid = true;\n foreach ($medias as $media) {\n if ($media->getMediaType() == 1 && empty($permissions->album_photo)) {\n // User has not got a permission for photo albums\n $is_valid = false;\n break; \n }\n\n if ($media->getMediaType() == 2 && empty($permissions->album_video)) {\n // User has not got a permission for video albums\n $is_valid = false;\n break; \n }\n\n if ($media->getMediaType() == 2 && !$video_processing) {\n // Video processing is not possible now,\n // FFMPEG is not configured\n $is_valid = false;\n break; \n }\n }\n\n if (!$is_valid) {\n // User can not re-post this album post because of the permission \n // (or absence of the ffmpeg video processing)\n continue;\n }\n }\n\n\n $_log = new LogModel([\n \"user_id\" => $User->get(\"id\"),\n \"account_id\" => $Account->get(\"id\"),\n \"original_media_code\" => $item->getCode(),\n \"status\" => \"success\"\n ]);\n\n if ($_log->isAvailable()) {\n // Already reposted this feed\n continue;\n }\n\n // Found the feed item to repost\n $feed_item = $item;\n break;\n }\n\n\n if (empty($feed_item)) {\n $Log->set(\"data.error.msg\", \"Couldn't find the new feed item to repost\")\n ->save();\n continue;\n }\n\n\n // Download the media\n $media = [];\n if ($feed_item->getMediaType() == 1 && $feed_item->getImageVersions2()->getCandidates()[0]->getUrl()) {\n $media[] = $feed_item->getImageVersions2()->getCandidates()[0]->getUrl();\n } else if ($feed_item->getMediaType() == 2 && $feed_item->getVideoVersions()[0]->getUrl()) {\n $media[] = $feed_item->getVideoVersions()[0]->getUrl();\n } else if ($feed_item->getMediaType() == 8) {\n foreach ($feed_item->getCarouselMedia() as $m) {\n if ($m->getMediaType() == 1 && $m->getImageVersions2()->getCandidates()[0]->getUrl()) {\n $media[] = $m->getImageVersions2()->getCandidates()[0]->getUrl();\n\n } else if ($m->getMediaType() == 2 && $m->getVideoVersions()[0]->getUrl()) {\n $media[] = $m->getVideoVersions()[0]->getUrl();\n }\n }\n }\n\n\n $downloaded_media = [];\n foreach ($media as $m) {\n $url_parts = parse_url($m);\n if (empty($url_parts['path'])) {\n continue;\n }\n\n $ext = strtolower(pathinfo($url_parts['path'], PATHINFO_EXTENSION));\n $filename = uniqid(readableRandomString(8).\"-\").\".\".$ext;\n $downres = file_put_contents(TEMP_PATH . \"/\". $filename, file_get_contents($m));\n if ($downres) {\n $downloaded_media[] = $filename;\n }\n }\n\n if (empty($downloaded_media)) {\n $Log->set(\"data.error.msg\", \"Couldn't download the media of the selected post\")\n ->save();\n continue;\n }\n\n $original_caption = \"\";\n if ($feed_item->getCaption()->getText()) {\n $original_caption = $feed_item->getCaption()->getText();\n }\n\n $caption = $sc->get(\"caption\");\n $variables = [\n \"{{caption}}\" => $original_caption,\n \"{{username}}\" => \"@\".$feed_item->getUser()->getUsername(),\n \"{{full_name}}\" => $feed_item->getUser()->getFullName() ?\n $feed_item->getUser()->getFullName() :\n \"@\".$feed_item->getUser()->getUsername()\n ];\n $caption = str_replace(\n array_keys($variables), \n array_values($variables), \n $caption);\n\n $caption = $Emojione->shortnameToUnicode($caption);\n if ($User->get(\"settings.spintax\")) {\n $caption = \\Spintax::process($caption);\n }\n\n $caption = mb_substr($caption, 0, 2200);\n\n\n\n // Try to repost\n try {\n if (count($downloaded_media) > 1) {\n $album_media = [];\n\n foreach ($downloaded_media as $m) {\n $ext = strtolower(pathinfo($m, PATHINFO_EXTENSION));\n\n $album_media[] = [\n \"type\" => in_array($ext, [\"mp4\"]) ? \"video\" : \"photo\",\n \"file\" => TEMP_PATH.\"/\".$m\n ];\n }\n\n $res = $Instagram->timeline->uploadAlbum($album_media, ['caption' => $caption]);\n } else {\n $m = $downloaded_media[0];\n $ext = strtolower(pathinfo($m, PATHINFO_EXTENSION));\n if (in_array($ext, [\"mp4\"])) {\n $res = $Instagram->timeline->uploadVideo(TEMP_PATH.\"/\".$m, [\"caption\" => $caption]);\n } else {\n $res = $Instagram->timeline->uploadPhoto(TEMP_PATH.\"/\".$m, [\"caption\" => $caption]);\n }\n }\n } catch (\\Exception $e) {\n $msg = $e->getMessage();\n $msg = explode(\":\", $msg, 2);\n $msg = isset($msg[1]) ? $msg[1] : $msg[0];\n\n $Log->set(\"data.error.msg\", __(\"An error occured during reposting the media.\"))\n ->set(\"data.error.details\", $msg)\n ->save();\n continue;\n }\n\n if (!$res->isOk()) {\n $Log->set(\"data.error.msg\", __(\"An error occured during reposting the media.\"))\n ->set(\"data.error.details\", __(\"Instagram didn't return the expected result.\"))\n ->save();\n continue;\n }\n\n\n // Reposted media succesfully\n // Save log\n $thumb = null;\n if (null !== $feed_item->getImageVersions2()) {\n $thumb = $feed_item->getImageVersions2()->getCandidates()[0]->getUrl();\n } else if (null !== $feed_item->getCarouselMedia()) {\n $thumb = $feed_item->getCarouselMedia()[0]->getImageVersions2()->getCandidates()[0]->getUrl();\n }\n\n\n $Log->set(\"data.grabbed\", [\n \"media_id\" => $feed_item->getId(),\n \"media_code\" => $feed_item->getCode(),\n \"media_type\" => $feed_item->getMediaType(),\n \"media_thumb\" => $thumb,\n \"user\" => [\n \"pk\" => $feed_item->getUser()->getPk(),\n \"username\" => $feed_item->getUser()->getUsername(),\n \"full_name\" => $feed_item->getUser()->getFullName()\n ]\n ]);\n\n $Log->set(\"data.reposted\", [\n \"upload_id\" => $res->getUploadId(),\n \"media_pk\" => $res->getMedia()->getPk(),\n \"media_id\" => $res->getMedia()->getId(),\n \"media_code\" => $res->getMedia()->getCode()\n ]);\n \n $Log->set(\"status\", \"success\")\n ->set(\"original_media_code\", $feed_item->getCode());\n \n\n if ($sc->get(\"remove_delay\") > 0) {\n $Log->set(\"is_removable\", 1)\n ->set(\"remove_scheduled\", date(\"Y-m-d H:i:s\", time() + $sc->get(\"remove_delay\")));\n }\n\n $Log->save();\n\n // Remove downloaded media files\n foreach ($downloaded_media as $m) {\n @unlink(TEMP_PATH.\"/\".$m);\n }\n }\n}", "public function add(Cron $cron)\n {\n $this->lines[] = $cron;\n\n $this->write();\n }", "function do_cron() {\n global $config;\n ct_log(\"Cron-Job started.\", 2, -1, 'cron');\n \n $btns = churchcore_getModulesSorted(false, false);\n foreach ($btns as $key) {\n include_once (constant(strtoupper($key)) . \"/$key.php\");\n if (function_exists($key . \"_cron\") && getConf($key . \"_name\")) {\n $arr = call_user_func($key . \"_cron\");\n }\n }\n ct_sendPendingNotifications();\n ct_log(\"Cron-Job finished.\", 2, -1, 'cron');\n}", "function register(&$controller) {\n $controller->register_hook('INDEXER_TASKS_RUN', 'BEFORE', $this, 'qccron', array());\n }", "public function cron(Reminder $reminder);", "public function importer_cron()\n\t{\n\t\tDBTP_Utils::log('Importer started');\n\n\t\t$importManager = new DBTP_Import_Manager();\n\t\t$schedule = $importManager->schedule_imports();\n\n\t\tif (is_wp_error($schedule)) {\n\t\t\tDBTP_Utils::log('Importer error: '. $schedule->get_error_message());\n\t\t} else {\n\t\t\tDBTP_Utils::log('Imported has been scheduled');\n\t\t}\n\t}", "public function register()\n {\n\n $this->mergeConfigs();\n $this->registerCommands();\n\n // 单例绑定服务\n $this->app->singleton('crontab', function ($app) {\n\n return new Crontab($app['session'], $app['config']);\n });\n\n }", "protected function getCron_ManagerService()\n {\n return $this->services['cron.manager'] = new \\phpbb\\cron\\manager(${($_ = isset($this->services['cron.task_collection']) ? $this->services['cron.task_collection'] : $this->getCron_TaskCollectionService()) && false ?: '_'}, ${($_ = isset($this->services['routing.helper']) ? $this->services['routing.helper'] : $this->getRouting_HelperService()) && false ?: '_'}, './../', 'php');\n }", "public function install()\r\n\t{\r\n\t\ttry {\r\n\t\t\t$this->_alreadyInstalled();\r\n\t\t} catch (Exception $e) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\t\r\n\t\t$data = array(\r\n\t\t\t'name'\t\t\t=> $this->_name,\r\n\t\t\t'shortName'\t\t=> $this->_shortName,\r\n\t\t\t'scheduleStart'\t=> $this->_scheduleStart,\r\n\t\t\t'scheduleStop'\t=> $this->_scheduleStop,\r\n\t\t\t'interval'\t\t=> $this->_interval,\r\n\t\t\t'active'\t\t=> 1,\r\n\t\t);\r\n\t\t\r\n\t\t$this->_db->insert('Cron_Jobs', $data);\r\n\t}", "public function registerSchedule($schedule)\n {\n }", "public function run()\n {\n DB::table('cron_master_lists')->insert([\n \t\t 'description' => 'Advertising Performance',\n \t\t 'route' => 'UpdateCampaignAdvertising',\n \t\t 'sequence' => 10\n \t\t]);\n }", "public function initialteRedmineCronJob()\r\n { \r\n \r\n //GET All projects \r\n $allProjects = $this->client->api('project')->all(array('limit' => 100,'offset' => 0));\r\n foreach ($allProjects['projects'] as $project)\r\n { \r\n \t$this->addProject($project);\r\n }\r\n //GET All issues \r\n $allIssue=$this->client->api('issue')->all();\r\n if($allIssue['total_count'] >= 0)\r\n {\r\n for ($offset=0; $offset <=$allIssue['total_count'] ; $offset+=$allIssue['limit']) \r\n { \r\n \r\n $issueList=$this->client->api('issue')->all(array(\r\n 'limit' => $allIssue['limit'],\r\n 'offset' =>$offset)); \r\n foreach ($issueList['issues'] as $singleIssue)\r\n {\r\n $this->addIssue($singleIssue);\r\n }\r\n }\r\n }\r\n \r\n \r\n // //Get All Timelog Entries \r\n $allTimeEntry=$this->client->api('time_entry')->all();\r\n if($allTimeEntry['total_count'] >= 0)\r\n {\r\n for ($offset=0; $offset <=$allTimeEntry['total_count'] ; $offset+=$allTimeEntry['limit']) \r\n { \r\n \r\n $timeEntryList=$this->client->api('time_entry')->all(array('limit' => $allTimeEntry['limit'],'offset' =>$offset)); \r\n foreach ($timeEntryList['time_entries'] as $singleTimeLog)\r\n {\r\n $this->addTimeEntry($singleTimeLog);\r\n }\r\n }\r\n }\r\n\r\n \r\n }", "function asmcron_init_cronjob()\n{\n // check that it hasn't been scheduled yet using our own custom hook\n if( !wp_next_scheduled( 'asmcron_sendmail_hook' ) )\n {\n // if it hasn't, schedule it\n // https://codex.wordpress.org/Function_Reference/wp_schedule_event\n // \"$timestamp\" is for the first time you want the event to occur\n // \"$recurrence\" is for how often the event should reoccur\n // \"$hook\" is for the action hook to execute\n wp_schedule_event( time(), 'hourly', 'asmcron_sendmail_hook' );\n }\n}", "public function schedule_cron($rate = 'md5_hash_weekly') {\n if ( !wp_next_scheduled( 'md5_hasher_check_dir' ) ) {\n wp_schedule_event( time(), $rate, 'md5_hasher_check_dir');\n }\n }", "function build_cron() {\n $inc_job = new \\Cron\\Job\\ShellJob();\n $inc_job->setCommand('php inc.php');\n $inc_job->setSchedule(new \\Cron\\Schedule\\CrontabSchedule('*/2 * * * *'));\n\n $resolver = new \\Cron\\Resolver\\ArrayResolver();\n $resolver->addJob($inc_job);\n\n $cron = new \\Cron\\Cron();\n $cron->setExecutor(new \\Cron\\Executor\\Executor());\n $cron->setResolver($resolver);\n return $cron;\n }", "public function getCronCmd() {}", "public function registerSchedulerWorker($pid)\n {\n return $this->redis->set(self::$schedulerWorkerKey, $pid);\n }", "private function cronAdd($item) {\n $postController = new PostController();\n $postController->createFromCron($item, $this->current_feed);\n }", "function cron_add_weekly( $schedules ) {\n $schedules['weekly'] = array(\n 'interval' => 604800,\n 'display' => __( 'Once Weekly' )\n );\n return $schedules;\n}", "public function getNextCronExecution() {}", "function activate_zanders_cron(){\n\t$timestamp = wp_next_scheduled( 'zanders_ftp_download_inventory' );\n\t$status = false;\n\t//If $timestamp == false schedule daily backups since it hasn't been done previously\n\tif( $timestamp == false ){\n\t$status = wp_schedule_event( time(), 'quarterhour', 'zanders_ftp_download_inventory' );\n\t}\n\n\twp_die(); \n}", "public static function cron($name, $args = array())\n {\n // Wrapper\n self::class($name, 'controllers/'.f::info()['config']['cron'], $args, false);\n }", "static function jobs() {\n\t\tif(self::doCron()):\n\t\t\n\t\twhile(!Db::lock());\n\n\t\tReminder::cron();\n\t\t\n\t\t$ctrl = new Cronjob();\n\t\t$ctrl->checkBookings();\n\t\t$ctrl->cancelPending();\n\t\t$ctrl->unattended();\n\t\t\n\t\twhile(!Db::unlock());\n\t\t\n\t\tPreferences::set('lastCron', date(\"H:i:s\"));\n\t\t_debug(\"CRON JOBS DONE!\");\n\t\tendif;\n\t}", "public function cron($key) {\n\t\t// Todo a task \n\t}", "public function cron($key) {\n\t\t// Todo a task \n\t}", "function loadCrons(&$manager, $specialOnly = FALSE, $token = \"\", $server = \"\") {\n\tif (!$token) { global $token; }\n\tif (!$server) { global $server; }\n\n\tif ($specialOnly) {\n\t\t$manager->addCron(\"drivers/2m_updateExPORTER.php\", \"updateExPORTER\", date(\"Y-m-d\"));\n\t\t$manager->addCron(\"drivers/2n_updateReporters.php\", \"updateReporter\", date(\"Y-m-d\"));\n\t\t$manager->addCron(\"drivers/2o_updateCoeus.php\", \"processCoeus\", date(\"Y-m-d\"));\n\t\t$manager->addCron(\"publications/getAllPubs_func.php\", \"getPubs\", date(\"Y-m-d\"));\n\t\t$manager->addCron(\"drivers/6d_makeSummary.php\", \"makeSummary\", date(\"Y-m-d\"));\n\t} else if ($token && $server) {\n\t\t$has = checkMetadataForFields($token, $server);\n\n\t\t$manager->addCron(\"drivers/2m_updateExPORTER.php\", \"updateExPORTER\", \"Monday\");\n\t\t$manager->addCron(\"drivers/2m_updateExPORTER.php\", \"updateExPORTER\", \"2020-03-05\");\n\t\t$manager->addCron(\"drivers/2n_updateReporters.php\", \"updateReporter\", \"Tuesday\");\n\t\tif ($has['coeus']) {\n\t\t\t$manager->addCron(\"drivers/2o_updateCoeus.php\", \"processCoeus\", \"Thursday\");\n\t\t}\n\t\tif ($has['news']) {\n\t\t\t$manager->addCron(\"news/getNewsItems_func.php\", \"getNewsItems\", \"Friday\");\n\t\t}\n $manager->addCron(\"drivers/13_pullOrcid.php\", \"pullORCIDs\", \"Friday\");\n\t\t$manager->addCron(\"publications/getAllPubs_func.php\", \"getPubs\", \"Saturday\");\n\n\t\t$manager->addCron(\"drivers/6d_makeSummary.php\", \"makeSummary\", \"Monday\");\n\t\t$manager->addCron(\"drivers/6d_makeSummary.php\", \"makeSummary\", \"Tuesday\");\n\t\t$manager->addCron(\"drivers/6d_makeSummary.php\", \"makeSummary\", \"Wednesday\");\n\t\t$manager->addCron(\"drivers/6d_makeSummary.php\", \"makeSummary\", \"Thursday\");\n\t\t$manager->addCron(\"drivers/6d_makeSummary.php\", \"makeSummary\", \"Friday\");\n\t\t$manager->addCron(\"drivers/6d_makeSummary.php\", \"makeSummary\", \"Saturday\");\n\t\t$manager->addCron(\"drivers/12_reportStats.php\", \"reportStats\", \"Saturday\");\n\t\tif ($has['vfrs']) {\n\t\t\t$manager->addCron(\"drivers/11_vfrs.php\", \"updateVFRS\", \"Thursday\");\n\t\t}\n\t}\n\techo $manager->getNumberOfCrons().\" crons loaded\\n\";\n}", "function openzwave_install() {\n\tif (config::byKey('jeeNetwork::mode') != 'slave') {\n\t\t$cron = cron::byClassAndFunction('openzwave', 'pull');\n\t\tif (!is_object($cron)) {\n\t\t\t$cron = new cron();\n\t\t\t$cron->setClass('openzwave');\n\t\t\t$cron->setFunction('pull');\n\t\t\t$cron->setEnable(1);\n\t\t\t$cron->setDeamon(1);\n\t\t\t$cron->setDeamonSleepTime(0.5);\n\t\t\t$cron->setTimeout(1440);\n\t\t\t$cron->setSchedule('* * * * *');\n\t\t\t$cron->save();\n\t\t}\n\t}\n}", "private function register_tasks( \\Jobby\\Jobby $runner, $task_list ) {\n foreach( $task_list as $task ) {\n $task_class = $this->crony_job_namespace . '\\\\' . $task;\n\n // Per the interface...\n $task_config = call_user_func( $task_class . '::config' );\n\n // If there's no command registered in the configuration, we'll bind an anonymous function to\n // run our specified task.\n if ( !isset( $task_config['command'] ) ) {\n $task_config['command'] = function() use ($task_class) { return call_user_func( $task_class . '::run' ); };\n }\n \n $runner->add( $task, $task_config );\n }\n }", "private function addCronTasks(array $tasks) {\n\t\t// TODO\n\t}", "private function addCronTasks(array $tasks) {\n\t\t// TODO\n\t}", "function registerTest1($job, $worker) {}", "public function write()\n {\n $file = \\tempnam(\\sys_get_temp_dir(), 'cron');\n\n \\file_put_contents($file, $this->getRaw().PHP_EOL);\n\n $process = new Process('crontab '.$file);\n $process->run();\n\n $this->error = $process->getErrorOutput();\n $this->output = $process->getOutput();\n }", "public function masterRedmineCronJob()\r\n {\r\n //GET All trackers \r\n $allTracker = $this->client->api('tracker')->all(array('limit'=>1000));\r\n foreach ($allTracker['trackers'] as $key=>$tracker)\r\n {\t\r\n $this->addTracker($tracker);\r\n }\r\n //GET All user roles \r\n $allRole = $this->client->api('role')->all(array('limit' => 1000)); \r\n foreach ($allRole['roles'] as $key=>$role)\r\n {\r\n $this->addUserRole($role);\r\n }\r\n //GET All issue status \r\n $allStatus = $this->client->api('issue_status')->all(array('limit' => 1000));\r\n foreach($allStatus['issue_statuses'] as $key=>$status)\r\n {\r\n $this->addStatus($status);\r\n }\r\n }", "function run() {\n\t$scheduler = new CSL_Feed_Import_Scheduler;\n\t$scheduler->setup();\n}", "private function scheduleStarmapJobs(): void\n {\n $this->schedule\n ->command(DownloadStarmap::class, ['--import'])\n ->monthly();\n }", "protected function registerAndScheduleCommands(): void\n {\n // Only register and schedule commands if we are running in CLI mode\n if ( ! $this->app->runningInConsole()) {\n return;\n }\n\n // Add all commands to Artisan\n $this->commands([\n Commands\\RequestInsuranceService::class,\n Commands\\UnlockBlockedRequestInsurances::class,\n Commands\\CleanUpRequestInsurances::class,\n Commands\\FailOrReadyProcessingRequestInsurances::class,\n ]);\n\n // Add specific commands to the schedule\n $this->callAfterResolving(Schedule::class, function (Schedule $schedule) {\n $schedule->command('unlock:request-insurances')->everyFiveMinutes();\n $schedule->command('clean:request-insurances')->everyTenMinutes();\n $schedule->command('request-insurance:unstuck-processing')->everyTenMinutes();\n });\n }", "public function register()\n {\n register_shutdown_function([$this, 'schedulerShutdownHandler']);\n return parent::register();\n }", "public function cronRun() {\n @ignore_user_abort(TRUE);\n\n // Try to allocate enough time to run all the hook_cron implementations.\n drupal_set_time_limit(240);\n return $this->processQueues();\n }", "public static function init_sync_cron_jobs() {\n\t\t_deprecated_function( __METHOD__, 'jetpack-7.5', 'Automattic\\Jetpack\\Sync\\Actions' );\n\n\t\treturn Actions::init_sync_cron_jobs();\n\t}", "public function run()\n {\n $workers = Worker::factory()->count(7)->create();\n }", "public function registerSchedule($schedule)\n {\n\n $schedule->call(function () {\n\n $settings = Settings::instance();\n\n if ($settings->active) {\n\n $userScores = FinalScore::with('exam')\n ->where('created_at', '>', Carbon::now()->subMinutes('10'))\n ->where('created_at', '<', Carbon::now())\n ->where('complete_status', 0)\n ->get();\n\n $count = 0;\n\n foreach ($userScores as $score) {\n $count++;\n if (Carbon::now()->greaterThan(Carbon::parse($score->completed_at))) {\n FinalScore::where('id', $score['id'])->update([\n 'complete_status' => 1\n ]);\n }\n }\n\n if ($settings->active_trace) {\n trace_log(\"[exam_scores_cron] Query updated count:\" . $count);\n }\n }\n\n })->everyMinute()\n ->name('final_scores')\n ->withoutOverlapping();\n }", "function goodrds_schedule_cron() {\n\t if ( !wp_next_scheduled( 'goodrds_cronjob' ) )\n\t wp_schedule_event(time(), 'daily', 'goodrds_cronjob');\n\t}", "public function run()\n {\n Job::create(['url'=> 'https://proxify.io']);\n\n Job::create(['url'=> 'https://reddit.com']);\n\n Job::factory(1000)->create();\n }", "public function Add_Task(ECash_Nightly_Event $task)\n\t{\n\t\t$task->setServer($this->server);\n\t\t$task->setCompanyShort($this->server->company);\n\t\t$task->setCompanyId($this->server->company_id);\n\n\t\t$this->tasks[] = new CronScheduler_Task($task);\n\t\treturn $task;\n\t}", "public function registerScheduledCommands($app)\n {\n $app->make(Schedule::class)\n ->call($app->make(CheckQueues::class))\n ->everyMinute()\n ->name('check-queue-alert')\n ->onOneServer();\n }", "public function getCron() {\n\t\t$cron = [\"raw\" => \"\", \"active\" => false, \"mm\" => \"\", \"hh\" => \"\", \"dd\" => \"\", \"name\" => \"\"];\n\t\t$output = shell_exec('crontab -l');\n\t\t$lines = explode(\"\\n\", trim($output));\n\t\tif (count($lines) > 3) { // check cron is not empty - First 3 lines are not cron entry but used to reload crontrab at reboot\n\t\t\t$return['Status'] = \"OK\";\n\t\t\twhile ($lines[0] != \"#BEGIN\") { array_shift($lines); } //Remove non cron lines\n\t\t\tarray_shift($lines);\n\t\t\tforeach ($lines as $entry) {\n\t\t\t\t$str = explode(\"/usr\", $entry);\n\t\t\t\t$cron[\"raw\"] = rtrim($str[0]);\n\t\t\t\tif ($cron[\"raw\"][0] == \"#\") {\n\t\t\t\t\t$cron[\"active\"] = false;\n\t\t\t\t\t$sched = substr($cron[\"raw\"],1);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$cron[\"active\"] = true;\n\t\t\t\t\t$sched = $cron[\"raw\"];\n\t\t\t\t}\n\t\t\t\t$sched = explode(\" \",$sched);\n\t\t\t\t$cron[\"mm\"] = $sched[0];\n\t\t\t\t$cron[\"hh\"] = $sched[1];\n\t\t\t\t$cron[\"dd\"] = $sched[4];\n\t\t\t\t$cron[\"name\"] = explode(\"#\",$str[count($str)-1]);\n\t\t\t\t$cron[\"name\"] = $cron[\"name\"][1];\n\t\t\t\t$return['cron'][]=$cron;\n\t\t\t}\n\t\t}\n\t\telse $return['Status'] = \"KO\";\n\t\tif (debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS,2)[1]['function'] == 'invokeMethod') Flight::json($return);\n\t\telse return $return;\n\t}", "function add_cron_interval( $schedules ) {\n\t$schedules['ten_seconds'] = array(\n\t\t'interval' => 60,\n\t\t'display' => esc_html__( 'Every Ten Seconds' ),\n\t);\n\n\treturn $schedules;\n}", "public function set_cron_check() {\n\n\t\t/* Nonce check */\n\t\tcheck_ajax_referer( 'wpcd-admin', 'nonce' );\n\n\t\t/* Permision check - unsure that this is needed since the action is not destructive and might cause issues if the user sees the message and can't dismiss it because they're not an admin. */\n\t\tif ( ! wpcd_is_admin() ) {\n\t\t\twp_send_json_error( array( 'msg' => __( 'You are not authorized to perform this action - dismiss cron check.', 'wpcd' ) ) );\n\t\t}\n\n\t\t/* Permissions passed - set transient. */\n\t\tset_transient( 'wpcd_cron_check', 1, 12 * HOUR_IN_SECONDS );\n\t\twp_die();\n\n\t}", "function ds_add_email_cron_schedules( $param ) {\n\n $param['fifteen_minute'] = array(\n 'interval' => 900, // seconds* 900/60 = 15 mins\n 'display' => __( 'Every Fifteen Minutes' )\n );\n\n return $param;\n\n }", "public function createCronEntry($cron_comment, $cron_datetime, $cron_cmd)\r\n {\r\n exec('crontab -l', $cron_contents_raw);\r\n $cron_contents = implode(PHP_EOL, $cron_contents_raw);\r\n\r\n if (!empty($cron_contents))\r\n {\r\n file_put_contents('/tmp/crontab', $cron_contents.PHP_EOL.$cron_comment.PHP_EOL.$cron_datetime.\" \".$cron_cmd.PHP_EOL);\r\n exec('crontab /tmp/crontab', $o, $exit_code);\r\n\r\n return $exit_code;\r\n }\r\n else\r\n {\r\n file_put_contents('/tmp/crontab', $cron_comment.PHP_EOL.$cron_datetime.\" \".$cron_cmd.PHP_EOL);\r\n exec('crontab /tmp/crontab', $o, $exit_code);\r\n\r\n return $exit_code;\r\n }\r\n return $exit_code;\r\n }", "public function run()\n {\n $credentials = [\n 'username' => 'superadmin',\n 'first_name' => 'Super',\n 'last_name' => 'Admin',\n 'email' => 'pemksmsuperadmin@mailinator.com',\n 'password' => 'pemksmsuperadmin',\n 'role' => 'superadmin'\n ];\n\n Sentinel::register($credentials);\n }", "public function getCronDefinition()\n {\n return $this->cron_script; \n }", "function wwt_register_cron() {\r\n wp_clear_scheduled_hook('wwt_send_email_with_log');\r\n $firstDayNextMonth = date('Y-m-d 03:00:00', strtotime('first day of next month'));\r\n wp_schedule_event(strtotime($firstDayNextMonth), 'monthly', 'wwt_send_email_with_log');\r\n\r\n return $firstDayNextMonth;\r\n}", "function questionnaire_cron () {\n global $CFG;\n require_once($CFG->dirroot . '/mod/questionnaire/locallib.php');\n\n return questionnaire_cleanup();\n}", "protected function schedule(Schedule $schedule)\n {\n // $schedule->command('inspire')\n // ->hourly();\n // Da ka Event\n $schedule->call(function(){\n $url = 'http://jira.multiverseinc.com/PunchEvent';\n $client = new \\GuzzleHttp\\Client();\n $res = $client->request('GET',$url);\n if ($res->voiceUrl==''){\n $res = $client->request('GET',$url);\n }\n })->timezone('Asia/Shanghai')->dailyAt('9:13');\n // Check sprint progress.\n $schedule->call(function(){\n $url = 'http://jira.multiverseinc.com/amChecked';\n $client = new \\GuzzleHttp\\Client();\n $res = $client->request('GET',$url);\n if ($res->voiceUrl==''){\n $res = $client->request('GET',$url);\n }\n })->timezone('Asia/Shanghai')->dailyAt('10:00');\n // Verify completed tasks\n $schedule->call(function(){\n $url = 'http://jira.multiverseinc.com/doneIssueChecked';\n $client = new \\GuzzleHttp\\Client();\n $res = $client->request('GET',$url);\n if ($res->voiceUrl==''){\n $res = $client->request('GET',$url);\n }\n })->timezone('Asia/Shanghai')->dailyAt('17:30');\n // volunteer for unassigned task.\n $schedule->call(function(){\n $url = 'http://jira.multiverseinc.com/todoChecked';\n $client = new \\GuzzleHttp\\Client();\n $res = $client->request('GET',$url);\n })->weekdays()\n ->everyFiveMinutes()\n ->timezone('Asia/Shanghai')\n ->between('9:50', '22:00');\n }", "public function run()\n\t{\n\t\t\\DB::table('cronograma')->delete();\n \n\t\t\\DB::table('cronograma')->insert(array (\n\t\t\t0 => \n\t\t\tarray (\n\t\t\t\t'id' => 4,\n\t\t\t\t'nome' => 'BLUEFOOT | SITE | PADRÃO INSTITUCIONAL',\n\t\t\t\t'created_at' => '2016-04-26 15:02:29',\n\t\t\t\t'updated_at' => '2016-04-26 15:02:58',\n\t\t\t),\n\t\t\t1 => \n\t\t\tarray (\n\t\t\t\t'id' => 5,\n\t\t\t\t'nome' => 'BLUEFOOT | SITE | MOBILE FIRST',\n\t\t\t\t'created_at' => '2016-04-26 15:29:17',\n\t\t\t\t'updated_at' => '2016-04-26 15:29:17',\n\t\t\t),\n\t\t\t2 => \n\t\t\tarray (\n\t\t\t\t'id' => 6,\n\t\t\t\t'nome' => 'BLUEFOOT | SITE | REDESIGN',\n\t\t\t\t'created_at' => '2016-04-26 19:02:12',\n\t\t\t\t'updated_at' => '2016-04-26 19:02:12',\n\t\t\t),\n\t\t\t3 => \n\t\t\tarray (\n\t\t\t\t'id' => 7,\n\t\t\t\t'nome' => 'PN | Pesquisa de Mercado',\n\t\t\t\t'created_at' => '2016-04-27 18:14:01',\n\t\t\t\t'updated_at' => '2016-04-27 18:14:01',\n\t\t\t),\n\t\t\t4 => \n\t\t\tarray (\n\t\t\t\t'id' => 8,\n\t\t\t\t'nome' => 'PN | Análise Financeira',\n\t\t\t\t'created_at' => '2016-04-27 18:46:35',\n\t\t\t\t'updated_at' => '2016-04-27 18:46:35',\n\t\t\t),\n\t\t));\n\t}", "private function cronMinute()\n {\n $timedRecords = $this->app['storage.event_processor.timed'];\n if ($timedRecords->isDuePublish()) {\n $this->notify('Publishing timed records');\n $timedRecords->publishTimedRecords();\n }\n if ($timedRecords->isDueHold()) {\n $this->notify('De-publishing timed records');\n $timedRecords->holdExpiredRecords();\n }\n }", "public function startListeningForEvents()\n\t\t{\n\n\t\t\t// Initialize the crontab manager if this has not been done before\n\t\t\tif(is_null($this->CronManager)) $this->CronManager = new ssh2_crontab_manager();\n\n\t\t\t// Check if the cron job has already been added\n\t\t\t$this->readConfig();\n\n\t\t\tif(\n\t\t\t\t$this->data['config']['mod_time__checkTimeEventExecutionNeedsCron'] === \"enabled\" &&\n\t\t\t\tisSizedString($this->CronManager->cronjob_exists(\"checkTimeEventExecutionNeeds\"))\n\t\t\t)\n\t\t\t{\n\n\t\t\t\t// Cancel the execution of the function\n\t\t\t\treturn false;\n\n\t\t\t}\n\n\t\t\t// Restart the cronjob in case he is already issued\n\t\t\tif(isSizedArray($this->CronManager->cronjob_exists(\"checkTimeEventExecutionNeeds\")))\n\t\t\t\t$this->stopListeningForEvents();\n\n\t\t\t// Add the cron job\n\t\t\t$this->CronManager->append_cronjob(\n\t\t\t// Running every minute\n\t\t\t\t\"* * * * * sudo php -c /etc/php/7.3/fpm/php.ini \".ABSPATH.'/mods/'.static::ACTIVE_MOD.'/cronActions/checkTimeEventExecutionNeeds.php'\n\t\t\t);\n\n\t\t\t// Write status to the config\n\t\t\t$this->data['config']['mod_time__checkTimeEventExecutionNeedsCron'] = \"enabled\";\n\t\t\t$this->writeConfFile($this->data['config'], true);\n\n\t\t}", "public function startCron()\n {\n // mysql call\n $resultToNum = $this->getFailedDndNumbers();\n if(empty($resultToNum)){\n echo \"empty to number from db\\n\";\n return;\n }\n echo \"to number from mysql\\n\".print_r($resultToNum,true);\n $file = fopen(\"to_numbers.csv\",\"a\");\n $resultToNum = json_decode(json_encode($resultToNum), true);\n $temp = array();\n foreach ($resultToNum as $key => $value) {\n foreach ($value as $key => $to) {\n fwrite($file,substr($to,-10).\"\\n\");\n $temp[] = $to;\n break;\n }\n break;\n }\n fclose($file);\n $resultToNum = $temp;\n // redis call\n $redisNum = $this->connectToRedis();\n foreach ($resultToNum as $index => $number) {\n $this->addNumberToJfk($redisNum,$number,0);\n }\n }", "function vizadplug_cron_activation() {\n\tif( !wp_next_scheduled( 'mytrius-sync' ) ) { \n\t wp_schedule_event( time(), 'mytriuscooldown', 'mytrius-sync' ); \n\t}\n}", "public function registerWorker (WorkerAbstract $worker)\n {\n $this->_logger->info('Registering ' . $worker->getRegisterFunction());\n \n $this->_spawnWorker($worker);\n }", "protected function schedule(Schedule $schedule)\n {\n// $schedule->command('inspire')\n// ->sendOutputTo('/Users/gumoon/Desktop/testcommand.txt', true)\n// ->everyMinute();\n $logFile = env('CRONTAB_LOG_DIR') . 'zoglo.txt';\n $schedule->command('news:fetch 10')->sendOutputTo($logFile, true)->everyMinute();\n// $schedule->exec('date')->everyMinute()->sendOutputTo('/Users/gumoon/Desktop/testcommand.txt', true);\n }", "protected function schedule(Schedule $schedule)\n\t{\n\t\t//Runs daily, every 5 minutes from 03:00\n\t\t$schedule->command(TranslationsBackup::class)->dailyAt('03:00'); // Dispatching a Job that will create a CSV File with the translations\n\t\t$schedule->command(RemoveCsvFiles::class, ['1', '--queue'])->dailyAt('03:05'); // Remove CSV Files older than x months (default 1) from /var/www/public/admin/reports/csv\n\t\t$schedule->command(DeleteOldTokens::class, ['1'])->dailyAt('03:10'); // Deletes the tokens that are older than x (default 1) days\n\t\t$schedule->command(DeleteUselessTransactions::class, ['3', '1000'])->dailyAt('03:15'); //Delete a number of created transactions older than 3 months\n\t\t//$schedule->command(DeleteExpiredClients::class, ['1000'])->dailyAt('03:20'); // TODO: This comes from V1, why do we do it? Clear expired maestro clients\n\n\t\t//Runs every hour\n\t\t$schedule->command(ActivateVouchers::class)->hourly(); // Activate vouchers that are inactive and startDate < now()\n\t\t$schedule->command(DeactivateVouchers::class)->hourly(); // Deactivate vouchers that are active and stopDate < now()\n\t\t//$schedule->command(ClearPasswordAttempts::class, ['3'])->hourly(); // Update reminder table where there are more than 2 attempts and updated < last x (default 3) hours\n\t\t//$schedule->command(ClearHheClients::class)->hourly(); // TODO: This comes from V1, why do we do it? Clear expired hhe clients\n\n\t\t//Runs every 10 minutes\n\t\t//$schedule->command(MerakiCheck::class)->everyTenMinutes(); // Update airhealth.hardware based on a xml taken from a URL from site_attribute having \"meraki_network\"\n\t\t//$schedule->command(DestroyGhostSessions::class, ['10'])->everyTenMinutes(); // 1. Cleaning up NULL Connectinfo_Start records; 2. Cleaning up NULL Connectinfo_Stop records and acctstoptime; 3. Removing records stale for x (default 10) minutes\n\t\t//$schedule->command(ShutdownIdle::class, ['20'])->everyTenMinutes(); // Shuts down sessions older than x (default 20) minutes where IP is 192.168.1.2 by adding a acctstoptime | Might be CC only\n\t\t//$schedule->command(UpdateGender::class)->everyTenMinutes(); // Checks the name with the names that we have in our DB to return the gender\n\t\t$schedule->command(UpdatePmsDynamicIp::class)->everyTenMinutes(); // Updates the IP of site attributes that have dynamic_ip enabled (for UPMS and Captive PMS)\n\n\t\t//Runs every minute\n\t\t$schedule->command(DeleteTransactionReceipts::class, ['2', '10000'])->everyMinute(); // Delete a number of transaction receipts older than x (default 2) months\n\n\t\t// These are the SSID scheduling and was never implemented (unless it was)\n//\t\t$schedule->command(RevertScheduledSsids::class, ['2'])->everyMinute(); //THIS MUST BE CHECKED AS I THINK IT'S NOT CORRECT\n//\t\t$schedule->command(ChangeScheduledSsids::class, ['2'])->everyMinute(); //THIS MUST BE CHECKED AS I THINK IT'S NOT CORRECT\n\t}", "function register_hourly_fwp_indexer() {\n\t// Make sure this event hasn't been scheduled\n\tif( !wp_next_scheduled( 'fwp_indexer' ) ) {\n\t\t// Schedule the event\n\t\twp_schedule_event( time(), 'hourly', 'fwp_indexer' );\n\t}\n}", "protected function getCron_ControllerService()\n {\n return $this->services['cron.controller'] = new \\phpbb\\cron\\controller\\cron();\n }", "function cron() {\n\t\t//look at the clock.\n\t\t$now = strtotime('now');\n\t\t\n\t\t//check for the hack\n\t\tif(Configure::read('debug') != 0 && isset($this->params['named']['time_machine'])){\n\t\t\t$now = strtotime($this->params['named']['time_machine']);\n\t\t}\n\t\t\n\t\t$this->Project->upgradeProjects($now);\n\t}", "protected function schedule(Schedule $schedule)\n {\n $schedule->command('make:rss')->hourly();\n\n }", "public function __construct()\n {\n parent::__construct();\n $this->worker = new \\GearmanWorker();\n $this->worker->addServer();\n $this->worker->addFunction(env('QUEUE_SEMANTIC'), sprintf('\\\\%s::%s', __CLASS__, 'start'));\n }", "public function __construct()\n {\n $this->_cronHelper = Mage::helper(self::XML_PATH_HELPER_CRON);\n }", "function createCrontab()\n\t{\n\t\t$crontabFilePath = '/tmp/crontab.txt';\n\t\t$file = fopen($crontabFilePath, \"w\") or die(\"Unable to open file!\");\n\t\tglobal $mongo,$python_script_path;\n\t\t$db = $mongo->logsearch;\n\t\t$collection = $db->service_config;\n\t\t$cursor = $collection->find();\n\t\tforeach ($cursor as $doc) {\n\t\t\tif( $doc['state'] == 'Running' && $doc['path'] != '' && $doc['crontab'] != ''){\n\t\t\t\t$txt = '# Index, service:\"'.$doc['service'].'\" system:\"'.$doc['system']\n\t\t\t\t\t\t.'\" node:\"'.$doc['node'].'\" process:\"'.$doc['process'].'\" path:\"'.$doc['path'].'\"'.PHP_EOL;\n\t\t\t\tfwrite($file, $txt); \n\t\t\t\t$txt = $doc['crontab'].' sudo -u logsearch python '\n\t\t\t\t\t\t\t.$python_script_path.'indexScript.py index '.$doc['_id'].PHP_EOL;\n\t\t\t\tfwrite($file, $txt); \n\t\t\t}\n\t\t}\n\t\t//purge data here\n\t\t$keepDataMonth = 3;\n\t\t$txt = '# Purge data at 04:00 everyday, keep data '.$keepDataMonth.' months'.PHP_EOL;\n\t\tfwrite($file, $txt);\n\t\t$txt = '0 4 * * *'.' sudo -u logsearch python '.$python_script_path.'purgeData.py '.$keepDataMonth.' '.PHP_EOL;\n\t\tfwrite($file, $txt); \n\t\tfclose($file);\n\t\t$cmd = \"sudo -u logsearch crontab \".$crontabFilePath;\n\t\texec($cmd);\n\t}", "public function it_can_create_cron()\n {\n $data = [\n 'expression' => $this->faker->text(15),\n 'description' => $this->faker->text(35)\n ];\n\n $cron = Cron::create($data);\n $this->assertInstanceOf(Cron::class, $cron);\n $this->assertEquals($data['expression'], $cron->expression);\n $this->assertEquals($data['description'], $cron->description);\n\n }", "function nhymxu_weekly_cron_job() {\n\tif ( ! wp_next_scheduled( '' ) ) {\n\t\twp_schedule_event( time(), 'weekly', '' );\n\t}\n}", "function spawn_cron($gmt_time = 0)\n {\n }", "public function runInCron(): void\n {\n $result = $this->run();\n\n if ($result->getStatus() !== true) {\n do_action(Hooks::ADVANCED_CHECK_ALERT, $this, $result);\n }\n }", "protected function schedule(Schedule $schedule)\n {\n // $schedule->command('inspire')\n // ->hourly();\n\n //It will excute the class SocialWorkerController at midnight and retrieve the user tags from facebook\n $schedule->call(\"SmartCity\\Http\\Controllers\\SocialWorkerController@index\")\n ->daily();\n // ->name(\"facebooktags\")\n // ->withoutOverlapping();\n\n //It will excute the class FacebookPagesController every saturday and cities' Facebook pages posts\n $schedule->call(\"SmartCity\\Http\\Controllers\\FacebookPagesController@index\")\n ->saturdays();\n\n }", "public function boot()\n {\n parent::boot();\n\n ///Переобернули события старого типа в более удобный тип\n\n Event::listen('cron.collectJobs', function () {\n Event::fire(new CronCollectJobs());\n });\n Event::listen('cron.beforeRun', function ($RunDate) {\n Event::fire(new CronBeforeRun($RunDate));\n });\n Event::listen('cron.jobError', function ($name, $return, $runtime, $rundate) {\n Event::fire(new CronJobError($name, $return, $runtime, $rundate));\n });\n Event::listen('cron.jobSuccess', function ($name, $runtime, $rundate) {\n Event::fire(new CronJobSuccess($name, $runtime, $rundate));\n });\n Event::listen('cron.afterRun', function ($name, $return, $runtime, $rundate) {\n Event::fire(new CronAfterRun($name, $return, $runtime, $rundate));\n });\n Event::listen('cron.locked', function ($lockfile) {\n Event::fire(new CronLocked($lockfile));\n });\n }" ]
[ "0.67821795", "0.67362833", "0.6676482", "0.6645996", "0.63996893", "0.62281346", "0.6216177", "0.606701", "0.6058777", "0.6032864", "0.6009926", "0.59538597", "0.59148735", "0.5911722", "0.590797", "0.5852104", "0.5686853", "0.5674972", "0.56626976", "0.5649708", "0.56415975", "0.562815", "0.561297", "0.5592577", "0.55884147", "0.5581393", "0.5576813", "0.5570715", "0.555576", "0.5537175", "0.55163187", "0.54754245", "0.5469487", "0.54407525", "0.54230267", "0.5381398", "0.53778374", "0.53601915", "0.5354098", "0.53502715", "0.5347326", "0.5339981", "0.53109145", "0.5298645", "0.5294626", "0.52916116", "0.5277907", "0.52771354", "0.52771354", "0.52737004", "0.52694416", "0.525958", "0.52482486", "0.52482486", "0.52432126", "0.5240521", "0.52361894", "0.5236182", "0.5227325", "0.5226178", "0.5209584", "0.51923305", "0.51854527", "0.51610756", "0.5152968", "0.5142868", "0.5139543", "0.51355183", "0.5121237", "0.5115952", "0.5115574", "0.51147556", "0.5110434", "0.5099623", "0.5095542", "0.5093668", "0.50878006", "0.5079159", "0.5074654", "0.5067613", "0.50628024", "0.5034325", "0.5029982", "0.5025697", "0.50181663", "0.5012018", "0.4996329", "0.49935946", "0.49836442", "0.49811083", "0.49774042", "0.49772406", "0.4972308", "0.49637794", "0.49533156", "0.4953238", "0.49508515", "0.4950529", "0.49399695", "0.49364173" ]
0.8312717
0
Create a new worker.
public function worker( $attempts ) { return new Worker( $this->connection, $attempts ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getWorker();", "public function getWorker();", "public function create()\n {\n\t\treturn view('worker.create');\n }", "public function store()\n\t{\n\t\tWorker::create(Request::all());\n\t}", "public function create()\n\t{\n\t\ttry {\n\t\t\t$types = Worker::lists('worker_type', 'id');\n\t\t\treturn View::make('workerTask.create', compact('types'))->with('title', 'Say your Problem to the building Worker: ');\n\t\t}catch(Exception $e){\n\t\t\t return \"No Worker Available now\" ;\n\t\t}\n\t}", "public function setWorker($var)\n {\n GPBUtil::checkString($var, True);\n $this->worker = $var;\n\n return $this;\n }", "public function store(WorkerStoreRequest $request)\n {\n $worker = Worker::create(\n $request->only(['name', 'employee_number'])\n );\n\n return $worker;\n }", "public function run()\n {\n $workers = Worker::factory()->count(7)->create();\n }", "public function registerWorker()\n\t{\n\t\tResque::redis()->sadd('workers', (string)$this);\n\t\tResque::redis()->set('worker:' . (string)$this . ':started', date('c'));\n\t}", "public static function create() {}", "public static function create() {}", "public static function create() {}", "public function __construct()\n {\n parent::__construct();\n $this->worker = new \\GearmanWorker();\n $this->worker->addServer();\n $this->worker->addFunction(env('QUEUE_SEMANTIC'), sprintf('\\\\%s::%s', __CLASS__, 'start'));\n }", "private function fork()\n\t{\n\t\t$pid = pcntl_fork();\n\n\t\tswitch ( $pid ) {\n\t\t\tcase -1:\n\t\t\t\t// exception\n\t\t\t\texit;\n\t\t\t\tbreak;\n\n\t\t\tcase 0:\n\t\t\t\ttry {\n\t\t\t\t\t// init worker instance\n\t\t\t\t\t$worker = new Worker( [\n\t\t\t\t\t\t'type' => 'worker',\n\t\t\t\t\t\t'pipe_dir' => $this->pipeDir,\n\t\t\t\t\t\t'tmp_dir' => $this->tmpDir,\n\t\t\t\t\t\t'app_name' => $this->appName,\n\t\t\t\t\t] );\n\t\t\t\t\t$worker->setProcessName();\n\t\t\t\t\t$worker->pipeMake();\n\t\t\t\t\t$worker->hangup( $this->workBusinessClosure );\n\t\t\t\t} catch ( Exception $e ) {\n\t\t\t\t\tProcessException::error( [\n\t\t\t\t\t\t'msg' => [\n\t\t\t\t\t\t\t'msg' => $e->getMessage(),\n\t\t\t\t\t\t\t'file' => $e->getFile(),\n\t\t\t\t\t\t\t'line' => $e->getLine(),\n\t\t\t\t\t\t],\n\t\t\t\t\t] );\n\t\t\t\t}\n\n\t\t\t\t// worker exit\n\t\t\t\texit;\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\ttry {\n\t\t\t\t\t$worker = new Worker( [\n\t\t\t\t\t\t'type' => 'worker',\n\t\t\t\t\t\t'pid' => $pid,\n\t\t\t\t\t\t'pipe_dir' => $this->pipeDir,\n\t\t\t\t\t\t'tmp_dir' => $this->tmpDir,\n\t\t\t\t\t\t'app_name' => $this->appName,\n\t\t\t\t\t] );\n\t\t\t\t\t$this->workers[ $pid ] = $worker;\n\t\t\t\t} catch ( Exception $e ) {\n\t\t\t\t\tProcessException::error( [\n\t\t\t\t\t\t'msg' => [\n\t\t\t\t\t\t\t'msg' => $e->getMessage(),\n\t\t\t\t\t\t\t'file' => $e->getFile(),\n\t\t\t\t\t\t\t'line' => $e->getLine(),\n\t\t\t\t\t\t],\n\t\t\t\t\t] );\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t}\n\t}", "public function create()\n {\n return \\Process::create('weights');\n }", "public function create() {}", "public function create()\n {\n return view('workers.create');\n }", "public function create() {\n\t \n }", "public function create()\n {\n // handled by client\n }", "public function create()\n {\n return view('workers/create');\n }", "protected function getWorker()\n {\n return $this->worker;\n }", "public function createWorker($type = 'errand', $options = [])\n {\n $allowed = ['errand', 'message'];\n\n if (!in_array($type, $allowed)) {\n return false;\n }\n\n //create some defaults based on Settings\n $workerLifeExpectancy = Configure::read(\"Settings.{$type}_worker_life_expectancy\");\n $workerGracePeriod = Configure::read(\"Settings.{$type}_worker_grace_period\");\n\n $timeObjCurrent = new FrozenTime('now');\n\n $timeObjRetirement = new FrozenTime('now');\n $timeObjRetirement = $timeObjRetirement->addMinutes($workerLifeExpectancy);\n\n $timeObjTermination = new FrozenTime('now');\n $timeObjTermination = $timeObjTermination->addMinutes($workerLifeExpectancy + $workerGracePeriod);\n\n //create the Worker\n $worker = $this->newEntity();\n $worker->name = $this->makeRandomName();\n $worker->type = $type;\n $worker->errand_link = null;\n $worker->errand_name = null;\n $worker->appointment_date = $timeObjCurrent;\n $worker->retirement_date = $timeObjRetirement;\n $worker->termination_date = $timeObjTermination;\n $worker->force_retirement = false;\n $worker->force_shutdown = false;\n $worker->pid = getmypid();\n $worker->background_services_link = '';\n $worker->server = gethostname();\n $worker->domain = parse_url(Router::url(\"/\", true), PHP_URL_HOST);\n\n $this->patchEntity($worker, $options);\n\n $worker = $this->save($worker);\n\n return $worker;\n }", "public function create()\n {}", "public function create()\n {\n return $this->work->srvCreate();\n }", "public function create(){}", "protected function create_worker_config() {\n return $this->config;\n }", "public function getWorker()\n {\n return $this->worker;\n }", "public function getWorker()\n {\n return $this->worker;\n }", "public function run()\n {\n Job::create(['url'=> 'https://proxify.io']);\n\n Job::create(['url'=> 'https://reddit.com']);\n\n Job::factory(1000)->create();\n }", "public function createQueue() {\n // Drupal is first installed) so there is nothing we need to do to create\n // a new queue.\n }", "public function create() {\n\t\t\t//\n\t\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function createQueue();", "public function register_cron_worker() {\n\t\t$attempts = add_filter( 'wp_queue_cron_attempts', 3 );\n\t\t$cron = new Cron( $this->worker( $attempts ) );\n\n\t\t$cron->init();\n\t}", "public function create() {\n\n\t\t\n\t}", "public function httpWeb(){\n // 创建一个Worker监听2345端口,使用http协议通讯\n $http_worker = new Worker(\"http://0.0.0.0:2345\");\n\n /***********param name***********/\n //设置当前Worker实例的名称,方便运行status命令时识别进程。不设置时默认为none\n //$this->name = 'MyWebsocketWorker';\n\n /***********param count***********/\n //设置当前Worker实例启动多少个进程,不设置时默认为1。\n // 启动4个进程对外提供服务\n $http_worker->count = 4;\n\n /***********param id***********/\n //当前worker进程的id编号,范围为0到$worker->count-1。\n /*\n //windows系统由于不支持进程数count的设置,只有id只有一个0号。windows系统下不支持同一个文件初始化两个Worker监听,所以windows系统这个示例无法运行\n // worker实例1有4个进程,进程id编号将分别为0、1、2、3\n $worker1 = new Worker('tcp://0.0.0.0:8585');\n // 设置启动4个进程\n $worker1->count = 4;\n // 每个进程启动后打印当前进程id编号即 $worker1->id\n $worker1->onWorkerStart = function($worker1)\n {\n echo \"worker1->id={$worker1->id}\\n\";\n };\n\n // worker实例2有两个进程,进程id编号将分别为0、1\n $worker2 = new Worker('tcp://0.0.0.0:8686');\n\n // 设置启动2个进程\n $worker2->count = 2;\n // 每个进程启动后打印当前进程id编号即 $worker2->id\n $worker2->onWorkerStart = function($worker2)\n {\n echo \"worker2->id={$worker2->id}\\n\";\n };\n */\n\n /***********param protocol***********/\n //设置当前Worker实例的协议类\n //$worker->protocol = 'Workerman\\\\Protocols\\\\Http';\n\n /***********param transport***********/\n //设置当前Worker实例所使用的传输层协议,目前只支持3种(tcp、udp、ssl)。不设置默认为tcp。\n //$worker->transport = 'udp';\n\n /***********param reusePort***********/\n //设置当前worker是否开启监听端口复用(socket的SO_REUSEPORT选项),默认为false,不开启。\n //如果你的 Linux 内核版本是 3.9 及以上的话,那么在使用 Workerman 时,可以将 reusePort 设置为 true 提升程序运行效率\n //$worker->reusePort = true;\n\n /***********param connections***********/\n //格式为array(id=>connection, id=>connection, ...),此属性中存储了当前进程的所有的客户端连接对象,其中id为connection的id编号,详情见手册TcpConnection的id属性。\n\n /***********param stdoutFile***********/\n //此属性为全局静态属性,如果以守护进程方式(-d启动)运行,则所有向终端的输出(echo var_dump等)都会被重定向到stdoutFile指定的文件中。\n //如果不设置,并且是以守护进程方式运行,则所有终端输出全部重定向到/dev/null。注意:此属性必须在Worker::runAll();运行前设置才有效。windows系统不支持此特性。\n //Worker::$stdoutFile = '/tmp/stdout.log';\n\n /***********param logFile***********/\n //用来指定workerman日志文件位置。此文件记录了workerman自身相关的日志,包括启动、停止等。如果没有设置,文件名默认为workerman.log,文件位置位于Workerman的上一级目录中。\n //Worker::$logFile = '/tmp/workerman.log';\n\n /***********param user***********/\n //设置当前Worker实例以哪个用户运行。此属性只有当前用户为root时才能生效。不设置时默认以当前用户运行。建议$user设置权限较低的用户,例如www-data、apache、nobody等。注意:此属性必须在Worker::runAll();运行前设置才有效。windows系统不支持此特性。\n // 设置实例的运行用户\n //$worker->user = 'www-data';\n\n /***********param reloadable***********/\n //设置当前Worker实例是否可以reload,即收到reload信号后是否退出重启。不设置默认为true,收到reload信号后自动重启进程。\n //有些进程维持着客户端连接,例如Gateway/Worker模型中的gateway进程,当运行reload重新载入业务代码时,却又不想客户端连接断开,则设置gateway进程的reloadable属性为false\n // 设置此实例收到reload信号后是否reload重启\n //$worker->reloadable = false;\n\n /***********param daemonize***********/\n //此属性为全局静态属性,表示是否以daemon(守护进程)方式运行。如果启动命令使用了 -d参数,则该属性会自动设置为true。也可以代码中手动设置。\n //注意:此属性必须在Worker::runAll();运行前设置才有效。windows系统不支持此特性。\n //Worker::$daemonize = true;\n\n /***********param globalEvent***********/\n //此属性为全局静态属性,为全局的eventloop实例,可以向其注册文件描述符的读写事件或者信号事件。\n // 当进程收到SIGALRM信号时,打印输出一些信息\n /*Worker::$globalEvent->add(SIGALRM, EventInterface::EV_SIGNAL, function()\n {\n echo \"Get signal SIGALRM\\n\";\n });*/\n\n /***********param onWorkerStart***********/\n //设置Worker子进程启动时的回调函数,每个子进程启动时都会执行。\n /*$worker->onWorkerStart = function($worker)\n {\n echo \"Worker starting...\\n\";\n };*/\n\n /***********param onWorkerReload***********/\n //设置Worker收到reload信号后执行的回调。可以利用onWorkerReload回调做很多事情,例如在不需要重启进程的情况下重新加载业务配置文件。\n\n /***********param onConnect***********/\n //当客户端与Workerman建立连接时(TCP三次握手完成后)触发的回调函数。每个连接只会触发一次onConnect回调。\n //注意:onConnect事件仅仅代表客户端与Workerman完成了TCP三次握手,这时客户端还没有发来任何数据,此时除了通过$connection->getRemoteIp()获得对方ip,没有其他可以鉴别客户端的数据或者信息,所以在onConnect事件里无法确认对方是谁。要想知道对方是谁,需要客户端发送鉴权数据,例如某个token或者用户名密码之类,在onMessage回调里做鉴权。\n /*$worker->onConnect = function($connection)\n {\n echo \"new connection from ip \" . $connection->getRemoteIp() . \"\\n\";\n };*/\n\n /***********param onMessage***********/\n //当客户端通过连接发来数据时(Workerman收到数据时)触发的回调函数\n /*$worker->onMessage = function($connection, $data)\n {\n var_dump($data);\n $connection->send('receive success');\n };*/\n\n /***********param onClose***********/\n //当客户端连接与Workerman断开时触发的回调函数。不管连接是如何断开的,只要断开就会触发onClose。每个连接只会触发一次onClose。\n //注意:如果对端是由于断网或者断电等极端情况断开的连接,这时由于无法及时发送tcp的fin包给workerman,workerman就无法得知连接已经断开,也就无法及时触发onClose。这种情况需要通过应用层心跳来解决。workerman中连接的心跳实现参见这里。如果使用的是GatewayWorker框架,则直接使用GatewayWorker框架的心跳机制即可,参见这里。\n /*$worker->onClose = function($connection)\n {\n echo \"connection closed\\n\";\n };*/\n\n /***********param onBufferFull***********/\n /*$worker->onBufferFull = function($connection)\n {\n echo \"bufferFull and do not send again\\n\";\n };*/\n\n /***********param onBufferDrain***********/\n //每个连接都有一个单独的应用层发送缓冲区,缓冲区大小由TcpConnection::$maxSendBufferSize决定,默认值为1MB,可以手动设置更改大小,更改后会对所有连接生效。\n //该回调在应用层发送缓冲区数据全部发送完毕后触发。一般与onBufferFull配合使用,例如在onBufferFull时停止向对端继续send数据,在onBufferDrain恢复写入数据。\n /*$worker->onBufferDrain = function($connection)\n {\n echo \"buffer drain and continue send\\n\";\n };*/\n\n /***********param onError***********/\n //当客户端的连接上发生错误时触发。\n //目前错误类型有\n //1、调用Connection::send由于客户端连接断开导致的失败(紧接着会触发onClose回调) (code:WORKERMAN_SEND_FAIL msg:client closed)\n //2、在触发onBufferFull后(发送缓冲区已满),仍然调用Connection::send,并且发送缓冲区仍然是满的状态导致发送失败(不会触发onClose回调)(code:WORKERMAN_SEND_FAIL msg:send buffer full and drop package)\n //3、使用AsyncTcpConnection异步连接失败时(紧接着会触发onClose回调) (code:WORKERMAN_CONNECT_FAIL msg:stream_socket_client返回的错误消息)\n /*$worker->onError = function($connection, $code, $msg)\n {\n echo \"error $code $msg\\n\";\n };*/\n\n /***********param runAll***********/\n //运行所有Worker实例。\n //Worker::runAll()执行后将永久阻塞,也就是说位于Worker::runAll()后面的代码将不会被执行。所有Worker实例化应该都在Worker::runAll()前进行。\n //注意:windows版本的workerman不支持在同一个文件中实例化多个Worker。 上面的例子无法在windows版本的workerman下运行。windows版本的workerman需要将多个Worker实例初始化放在不同的文件中\n\n /***********param stopAll***********/\n //停止当前进程(子进程)的所有Worker实例并退出。此方法用于安全退出当前子进程,作用相当于调用exit/die退出当前子进程。与直接调用exit/die区别是,直接调用exit或者die无法触发onWorkerStop回调,并且会导致一条WORKER EXIT UNEXPECTED错误日志。\n\n /***********param param_name***********/\n /***********param param_name***********/\n\n // 接收到浏览器发送的数据时回复hello world给浏览器\n $http_worker->onMessage = function($connection, $data)\n {\n // 向浏览器发送hello world\n $connection->send('hello world');\n };\n\n\n // 运行worker\n Worker::runAll();\n }", "public static function create(): self\n {\n return new self();\n }", "public static function create(): self\n {\n return new self();\n }", "protected function create() {\n\t}", "static function create(): self;", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "protected function _spawnWorker (WorkerAbstract $worker)\n {\n $pid = pcntl_fork();\n \n if ($pid === - 1) {\n $this->_logger->info('pcntl_fork failed');\n exit(0);\n } elseif ($pid === 0) {\n $worker->registerSigHandlers();\n $worker->prepare();\n $worker->getLogger()->setWriters($this->_logger->getWriters());\n \n $worker->_start_time = time();\n $gearmanWorker = new \\GearmanWorker();\n \n foreach ($this->_options['servers'] as $server) {\n $gearmanWorker->addServer($server['host'], $server['port']);\n }\n \n $gearmanWorker->addOptions(GEARMAN_WORKER_NON_BLOCKING);\n \n $gearmanWorker->addFunction($worker->getRegisterFunction(), \n array(\n $worker,\n 'execute'\n ));\n \n while (true) {\n if ($worker->_shutdown) {\n break;\n }\n \n if ($worker->runtime() > $this->_max_worker_run_time) {\n $worker->shutdown();\n }\n \n pcntl_signal_dispatch();\n $gearmanWorker->work();\n \n usleep(50000);\n }\n } else {\n $this->_logger->info(\n 'Worker ' . $worker->getRegisterFunction() . ' to ' . $pid);\n $worker->setPid($pid);\n $this->_workers[] = $worker;\n $this->_registerSigHandlers();\n }\n }", "public function create() {\n //not implemented\n }", "public function registerWorker()\r\n {\r\n Resque::redis()->sadd('workers', $this);\r\n setlocale(LC_TIME, \"\");\r\n setlocale(LC_ALL, \"en\");\r\n Resque::redis()->set('worker:' . (string)$this . ':started', strftime('%a %b %d %H:%M:%S %Z %Y'));\r\n }", "public function create()\n\t {\n\t //\n\t }", "public function create() {\n\n\t}", "public function create() {\n \n }", "public function create() {\n \n }", "public static abstract function createInstance();", "public function create() {\r\n }", "public function create()\n {\n //TODO\n }", "public static function find($workerId)\n\t{\n\t\tif (!self::exists($workerId) || false === strpos($workerId, \":\")) {\n\t\t\treturn false;\n\t\t}\n\n\t\tlist($hostname, $pid, $queues) = explode(':', $workerId, 3);\n\t\t$queues = explode(',', $queues);\n\t\t$worker = new self($queues);\n\t\t$worker->setId($workerId);\n\t\treturn $worker;\n\t}", "public function create()\r\n\t{\r\n\t\t//\r\n\t}", "public function create()\n\t\t{\n\t\t\t//\n\t\t}", "public function create()\n\t\t{\n\t\t\t//\n\t\t}", "public function create() {\n }", "public function create() {\n }", "public function create()\n\t{\n\t\t\n\t\t//\n\t}", "abstract function &create();", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}", "public function create()\n\t{\n\t\t//\n\t}" ]
[ "0.65604544", "0.65604544", "0.64603305", "0.6272869", "0.61639535", "0.61333823", "0.6004028", "0.59658515", "0.58936906", "0.5870221", "0.5870221", "0.5870221", "0.5860953", "0.58575594", "0.57701916", "0.5765715", "0.5756974", "0.57542366", "0.56452686", "0.56293625", "0.560749", "0.56039655", "0.559163", "0.55831015", "0.55828315", "0.55619514", "0.55599666", "0.55599666", "0.55453587", "0.5542701", "0.55383676", "0.5537732", "0.5537732", "0.5537732", "0.5537732", "0.5537732", "0.5537732", "0.5537732", "0.5537732", "0.5537732", "0.5537732", "0.5537732", "0.5537732", "0.55260247", "0.55177236", "0.55066395", "0.55063486", "0.5505499", "0.5505499", "0.55026394", "0.54983336", "0.54977053", "0.54977053", "0.54977053", "0.54977053", "0.54977053", "0.54977053", "0.54977053", "0.54977053", "0.54977053", "0.54977053", "0.54977053", "0.54941106", "0.5493777", "0.5492397", "0.54890496", "0.54853857", "0.54752475", "0.54752475", "0.54509336", "0.5443231", "0.542815", "0.54276776", "0.542475", "0.5402514", "0.5402514", "0.5399878", "0.5399878", "0.5399058", "0.53776544", "0.5376509", "0.5376509", "0.5376509", "0.5376509", "0.5376509", "0.5376509", "0.5376509", "0.5376509", "0.5376509", "0.5376509", "0.5376509", "0.5376509", "0.5376509", "0.5376509", "0.5376509", "0.5376509", "0.5376509", "0.5376509", "0.5376509", "0.5376509" ]
0.55908847
23
Protected constructor to prevent creating a new instance of the class via the `new` operator from outside of this class.
protected function __construct() {}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function __construct()\r\n {\r\n // Prevent direct instantiation\r\n }", "private function __construct()\t// Private to prevent object being instantiated outside class\r\n {\r\n // Do nothing\r\n }", "final private function __construct() {}", "final private function __construct() {}", "final private function __construct() { }", "final private function __construct() { }", "final private function __construct() { }", "protected final function __construct() {}", "private function __construct() { /* Do nothing here */ }", "private function __construct() { /* Do nothing here */ }", "private final function __construct() {}", "final private function __construct()\n\t{\n\t}", "final private function __construct() {\n\t\t\t}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "final private function __construct()\n {\n }", "final private function __construct()\n {\n }", "final private function __construct()\n {\n }", "private function __construct()\r\n\t\t{\r\n\r\n\t\t\t/* Do Nothing */\r\n\r\n\t\t}", "public function __construct()\n {\n throw new Exception('This class is not intended to be instantiated.');\n }", "final private function __construct(){\r\r\n\t}", "private function __construct () {}", "private function __construct()\n {\n // Do nothing\n }", "private function __construct()\r\n {}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "protected function __construct() {\n // Do nothing.\n }", "function __constructor(){}", "protected abstract function __construct();" ]
[ "0.8369179", "0.8046037", "0.779981", "0.779981", "0.7677693", "0.7677693", "0.7677693", "0.76684767", "0.75454473", "0.75454473", "0.7526266", "0.74428475", "0.74393713", "0.7406332", "0.7406332", "0.7404963", "0.7404963", "0.7404963", "0.7404963", "0.7404963", "0.7404963", "0.7404963", "0.7404963", "0.7404963", "0.7404963", "0.7404963", "0.7404963", "0.7404963", "0.7404963", "0.7404963", "0.7404963", "0.7404963", "0.7404963", "0.7404963", "0.7404963", "0.7404963", "0.7404963", "0.7404963", "0.7404963", "0.7404963", "0.7404963", "0.7404963", "0.7404963", "0.7404963", "0.7404963", "0.7404963", "0.7404963", "0.7404963", "0.7404963", "0.7404963", "0.7404963", "0.7404963", "0.7404963", "0.7404963", "0.7404963", "0.7404963", "0.7404963", "0.7404963", "0.7404963", "0.7404963", "0.7404963", "0.7404963", "0.7404963", "0.7404963", "0.7404963", "0.7404963", "0.7404963", "0.7404963", "0.7404963", "0.7404963", "0.7404963", "0.7403644", "0.7389102", "0.7389102", "0.735715", "0.7330742", "0.73183703", "0.7250201", "0.7243415", "0.7238516", "0.7201674", "0.7183468", "0.7183468", "0.7183468", "0.7183468", "0.7183468", "0.7183468", "0.7183468", "0.7183468", "0.7183468", "0.7183468", "0.7183468", "0.7183468", "0.7183468", "0.7183468", "0.7183468", "0.7183468", "0.7183468", "0.7175934", "0.71625787", "0.7160835" ]
0.0
-1
As this class is a singleton it should not be cloneable.
protected function __clone() {}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function __clone() { /* ... @return Singleton */ }", "protected function __clone()\n {\n //no possibility for cloning of singleton class\n }", "public final function __clone() {\n \n trigger_error('Clone is not allowed for '.get_class($this).' (Singleton)', E_USER_ERROR);\n \n }", "public final function __clone() {\n \n trigger_error('Clone is not allowed for '.get_class($this).' (Singleton)', E_USER_ERROR);\n \n }", "protected function __clone() {\n trigger_error('Cannot clone instance of Singleton pattern ...', E_USER_ERROR);\n }", "public function __clone()\n\t{\n\t\tthrow new Exception(\"You are not permitted to clone this singleton object.\");\n\t}", "public function __clone()\n\t{\n\t\tthrow new DomainException(\"Can't clone singleton\");\n\t}", "final public function __clone() {}", "public function __clone()\n {\n throw new LogicException('This Singleton cannot be cloned');\n }", "public function __clone() {}", "public function __clone() {}", "public function __clone() {}", "public function __clone() {}", "private function __clone() {\n \n }", "private function __clone() {\n \n }", "final private function __clone(){}", "protected function __clone() { }", "final public function __clone()\n {\n }", "final public function __clone()\n {\n }", "final public function __clone()\n {\n }", "private function __clone() {}", "private function __clone() {}", "private function __clone() {}", "private function __clone() {}", "private function __clone() {}", "private function __clone() {}", "private function __clone() {}", "private function __clone() {}", "private function __clone() {}", "private function __clone() {}", "private function __clone() {}", "private function __clone() {}", "private function __clone() {}", "private function __clone() {}", "private function __clone() {}", "private function __clone() {}", "private function __clone() {}", "private function __clone() {}", "private function __clone() {}", "private function __clone() {}", "private function __clone() {}", "private function __clone() {}", "private function __clone() {}", "private function __clone() {}", "private function __clone() {}", "protected function __clone(){}", "private function __clone () {}", "protected function __clone() {\n \n }", "final private function __clone() {}", "final private function __clone() {}", "final private function __clone() {}", "final private function __clone() {}", "final public function __clone()\n {\n return;\n }", "private function __clone(){ }", "private function __clone(){}", "private function __clone(){}", "private function __clone(){}", "private function __clone(){}", "private function __clone(){}", "private function __clone(){}", "private function __clone(){}", "private function __clone(){}", "private function __clone(){}", "private function __clone(){}", "private function __clone(){}", "final private function __clone()\r\n {\r\n // TODO: Implement __clone() method.\r\n }", "private function __clone() { }", "private function __clone() { }", "private function __clone() { }", "private function __clone() { }", "private function __clone() { }", "private function __clone() { }", "private function __clone() { }", "private function __clone() { }", "private function __clone() { }", "private function __clone() { }", "public function __clone()\n {\n }", "public function __clone()\n {\n }", "public function __clone()\n {\n }", "public function __clone()\n {\n }", "public function __clone()\n {\n }", "public function __clone()\n {\n }", "public function __clone()\n {\n }", "public function __clone()\n {\n }", "public function __clone()\n {\n }", "public function __clone(){\n throw new Zend_Exception('Cloning singleton objects is forbidden');\n }", "private function __clone()\n {\n \n }", "private function __clone()\n {\n \n }", "private function __clone() {\r\n\r\n }", "private function __clone()\r\n {\r\n }", "final private function __clone() { }", "final private function __clone() { }", "protected function __clone()\n {\n \n }", "private function __clone() {\r\n }" ]
[ "0.84407103", "0.83904964", "0.81722206", "0.81722206", "0.774605", "0.76623845", "0.76105654", "0.7568068", "0.7544309", "0.7515654", "0.7515654", "0.7515654", "0.7515654", "0.75155556", "0.75155556", "0.7511271", "0.7501534", "0.7499111", "0.7499111", "0.7499111", "0.74880296", "0.74880296", "0.74880296", "0.74880296", "0.74880296", "0.74880296", "0.74880296", "0.74880296", "0.74880296", "0.74880296", "0.74880296", "0.74880296", "0.74880296", "0.74880296", "0.74880296", "0.74880296", "0.74880296", "0.74880296", "0.74880296", "0.74880296", "0.74880296", "0.74880296", "0.74880296", "0.74880296", "0.74880296", "0.7482212", "0.74784344", "0.7469696", "0.7465191", "0.7465191", "0.7465191", "0.7465191", "0.7460952", "0.74512225", "0.74495274", "0.74495274", "0.74495274", "0.74495274", "0.74495274", "0.74495274", "0.74495274", "0.74495274", "0.74495274", "0.74495274", "0.74495274", "0.7438639", "0.74380815", "0.74380815", "0.74380815", "0.74380815", "0.74380815", "0.74380815", "0.74380815", "0.74380815", "0.74380815", "0.74380815", "0.74221164", "0.74221164", "0.74221164", "0.74221164", "0.74221164", "0.74221164", "0.74221164", "0.74221164", "0.74221164", "0.74209976", "0.7420263", "0.7420263", "0.7419747", "0.74118423", "0.7411523", "0.7411523", "0.7404779", "0.740346" ]
0.760672
13
As this class is a singleton it should not be able to be unserialized.
protected function __wakeup() {}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function __wakeup() {\n trigger_error('Cannot deserialize instance of Singleton pattern ...', E_USER_ERROR);\n }", "public function __wakeup()\r\n {\r\n throw new \\Exception(\"Cannot unserialize a singleton.\");\r\n }", "public function __wakeup()\n {\n throw new \\Exception(\"Cannot unserialize singleton\");\n }", "public function __wakeup()\n {\n throw new Exception(\"Cannot unserialize singleton\");\n }", "public function __wakeup()\n {\n throw new \\Exception(\"Cannot unserialize a singleton.\");\n }", "public function __wakeup() {\n\t\tthrow new \\Exception( 'Cannot serialize singleton' );\n\t}", "public function __construct() {\n\n // If we unserialize an object, prevent the magic wakeup from happening.\n ini_set('unserialize_callback_func', '');\n\n }", "public function __wakeup()\n\t{\n\t\tthrow new DomainException(\"Can't unserialize singleton\");\n\t}", "public function __wakeup()\n {\n throw new LogicException('This Singleton cannot be serialised');\n }", "public function _loadRealInstance() {}", "public function __wakeup() {\r\n\t\t_doing_it_wrong( __FUNCTION__, esc_html__( 'Unserializing instances of this class is forbidden.', 'wc_name_your_price' ), '3.0.0' );\r\n\t}", "private function __wakeup() { /* ... @return Singleton */ }", "public function __wakeup() {\n _doing_it_wrong( __FUNCTION__, __( \"Unserializing instances is forbidden!\", \"wcwspay\" ), \"4.7\" );\n }", "public function __wakeup() {\n //Unserializing instances of the class is forbidden\n _doing_it_wrong(__FUNCTION__, __('Word? That aint allowed son!', 'i4'), '0.0.1');\n }", "private function __construct()\r\n {\r\n // Prevent direct instantiation\r\n }", "public function __construct()\r\n {\r\n $this->_internalObject = new stdClass();\r\n\t\t$a=serialize($this->_internalObject);\r\n\t\t\"echo $a<br>\";\r\n }", "function unserialize()\r\n {\r\n global $methodCache;\r\n\r\n $owner=$this->readOwner();\r\n\r\n if ($owner!=null)\r\n {\r\n if ($this->inheritsFrom('Component')) $this->ControlState=csLoading;\r\n\r\n $namepath=$this->readNamePath();\r\n //if (isset($_SESSION[$namepath])) $this->newunserialize($_SESSION[$namepath]);\r\n\r\n $myclassName = $this->ClassName();\r\n\r\n if( isset( $methodCache[ $myclassName ] ) )\r\n {\r\n $methods = $methodCache[ $myclassName ];\r\n }\r\n else\r\n {\r\n $refclass=new ReflectionClass( $myclassName );\r\n $methods=$refclass->getMethods();\r\n\r\n $methods = array_filter( $methods, 'filterSet' );\r\n\r\n array_walk( $methods, 'processMethods' );\r\n\r\n $methodCache[ $myclassName ] = $methods;\r\n }\r\n\r\n $ourNamePath = $this->readNamePath();\r\n\r\n foreach( $methods as $methodname )\r\n {\r\n $propname=substr($methodname, 3);\r\n\r\n $fullname = $ourNamePath . '.' . $propname;\r\n if (isset($_SESSION[$fullname]))\r\n {\r\n $this->$methodname($_SESSION[$fullname]);\r\n }\r\n else\r\n {\r\n $propname = 'get' . $propname;\r\n $ob=$this->$propname();\r\n if (is_object($ob))\r\n {\r\n if ($ob->inheritsFrom('Persistent'))\r\n {\r\n $ob->unserialize();\r\n }\r\n }\r\n }\r\n }\r\n\r\n if ($this->inheritsFrom('Component')) $this->ControlState=0;\r\n }\r\n else\r\n {\r\n global $exceptions_enabled;\r\n\r\n if ($exceptions_enabled)\r\n {\r\n throw new Exception('Cannot unserialize a component without an owner');\r\n }\r\n }\r\n }", "public function loadTheInstance();", "final private function __construct() {}", "final private function __construct() {}", "private function __construct() { // singleton\n }", "protected function __init__() { }", "protected final function __construct() {}", "final private function __construct() { }", "final private function __construct() { }", "final private function __construct() { }", "public function __wakeup() {\n\t\t\t_doing_it_wrong( __FUNCTION__, __( 'Unserializing is forbidden!', 'be-table-ship' ), '4.0' );\n\t\t}", "final private function __construct() {\n\t\t\t}", "public function __sleep()\n\t{\n\t\tthrow new DomainException('No serializing of singleton');\n\t}", "public function __wakeup() {\n // Unserializing instances of the class is forbidden\n _doing_it_wrong( __FUNCTION__, __( 'Cheatin&#8217; huh?', 'ninja-forms' ), '2.8' );\n }", "public function __wakeup ();", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "public function __wakeup();", "final private function __construct(){\r\r\n\t}", "public function __wakeup() {\n\t\t// Unserializing instances of the class is forbidden\n\t\t_doing_it_wrong( __FUNCTION__, __( 'Cheatin&#8217; huh?', 'elementor' ), '1.0.0' );\n\t}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}" ]
[ "0.7726907", "0.7351433", "0.7336374", "0.7325892", "0.7299384", "0.7170783", "0.7077778", "0.70625705", "0.6841926", "0.67905235", "0.6774618", "0.6652072", "0.655329", "0.63837093", "0.63806236", "0.63282084", "0.62266886", "0.62203526", "0.6219514", "0.6219514", "0.61305743", "0.6126501", "0.61160564", "0.60952234", "0.60952234", "0.60952234", "0.6088231", "0.6070123", "0.6046831", "0.6012014", "0.5966122", "0.5963058", "0.5963058", "0.5963058", "0.5963058", "0.5963058", "0.5963058", "0.5963058", "0.5963058", "0.5963058", "0.5963058", "0.5963058", "0.5963058", "0.5963058", "0.5963058", "0.5963058", "0.5963058", "0.5963058", "0.5963058", "0.5963058", "0.5963058", "0.5963058", "0.5963058", "0.5963058", "0.5963058", "0.5963058", "0.5963058", "0.5963058", "0.5963058", "0.5963058", "0.5963058", "0.5963058", "0.5963058", "0.5963058", "0.5963058", "0.5963058", "0.5963058", "0.5963058", "0.5963058", "0.5963058", "0.5963058", "0.5963058", "0.5963058", "0.5963058", "0.5963058", "0.5963058", "0.5963058", "0.5963058", "0.5963058", "0.5963058", "0.5963058", "0.5963058", "0.5963058", "0.5963058", "0.5963058", "0.5963058", "0.5963058", "0.59619385", "0.59619385", "0.5960546", "0.5953569", "0.595285", "0.59461075", "0.5943264", "0.5943264", "0.5943264", "0.5943264", "0.5943264", "0.5943264" ]
0.5947329
93
Returns an instance of this class.
public static function getInstance() { return Doctrine_Core::getTable('Default_Model_Doctrine_Service'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function instance() {\n\t\treturn new self;\n\t}", "public function getInstance()\n {\n return $this;\n }", "public function instance() {\n\t\n\t\treturn $this;\n\t\n\t}", "public function getInstance(): self\n {\n return $this;\n }", "public static function getInstance() {\n return new self();\n }", "public function get_instance()\n\t{\n\t\treturn $this;\n\t}", "public function get_instance()\n\t{\n\t\treturn $this;\n\t}", "public static function getInstance()\n {\n return new self();\n }", "public static function instance() {\n\n\t\t\tif ( is_null( self::$instance ) ) {\n\t\t\t\tself::$instance = new self();\n\t\t\t}\n\n\t\t\treturn self::$instance;\n\n\t\t}", "public static function get()\n\t{\n\t\tif(null == self::$_instance)\n\t\t{\n\t\t\treturn new self();\n\t\t}\n\n\t\treturn self::$_instance;\n\t}", "public static function get()\n {\n if (is_null(self::$instance)) {\n self::$instance = new self();\n }\n return self::$instance;\n }", "public static function instance() {\n\t\t\tif ( is_null( self::$_instance ) )\n\t\t\t\tself::$_instance = new self();\n\n\t\t\treturn self::$_instance;\n\t\t}", "public function newInstance()\n {\n return new self();\n }", "public static function instance() {\n\t\t\tif ( is_null( self::$_instance ) ) {\n\t\t\t\tself::$_instance = new self();\n\t\t\t}\n\t\t\treturn self::$_instance;\n\t\t}", "public static function instance() {\n\t\t\tif ( is_null( self::$_instance ) ) {\n\t\t\t\tself::$_instance = new self();\n\t\t\t}\n\t\t\treturn self::$_instance;\n\t\t}", "public static function instance() {\n\t\t\tif ( is_null( self::$_instance ) ) {\n\t\t\t\tself::$_instance = new self();\n\t\t\t}\n\t\t\treturn self::$_instance;\n\t\t}", "public static function instance() {\n\t\t\tif ( is_null( self::$_instance ) ) {\n\t\t\t\tself::$_instance = new self();\n\t\t\t}\n\t\t\treturn self::$_instance;\n\t\t}", "public static function instance() {\n\t\t\tif ( is_null( self::$_instance ) ) {\n\t\t\t\tself::$_instance = new self();\n\t\t\t}\n\t\t\treturn self::$_instance;\n\t\t}", "public static function instance() {\n\t\t\tif ( is_null( self::$_instance ) ) {\n\t\t\t\tself::$_instance = new self();\n\t\t\t}\n\t\t\treturn self::$_instance;\n\t\t}", "public static function get() \n {\n if (!isset(self::$instance)) {\n self::$instance = new self;\n }\n\n return self::$instance;\n }", "public static function get() {\n\t\tif ( self::$instance === null )\n\t\t\tself::$instance = new self();\n\n\t\treturn self::$instance;\n\t}", "public static function self() {\n\n\t\treturn self::factory( 'self' );\n\t}", "public static function instance() {\n\t\t\tif ( is_null( self::$instance ) ) {\n\t\t\t\tself::$instance = new self();\n\t\t\t}\n\n\t\t\treturn self::$instance;\n\t\t}", "public static function instance() {\n\t\t\tif ( is_null( self::$instance ) ) {\n\t\t\t\tself::$instance = new self();\n\t\t\t}\n\n\t\t\treturn self::$instance;\n\t\t}", "public static function instance() {\n\n\t\tif ( is_null( self::$_instance ) ) {\n\t\t\tself::$_instance = new self();\n\t\t}\n\n\t\treturn self::$_instance;\n\n\t}", "public static function get() {\r\n\r\n\t\tif ( self::$instance == null ) {\r\n\t\t\tself::$instance = new self();\r\n\t\t}\r\n\r\n\t\treturn self::$instance;\r\n\r\n\t}", "public static function instance() {\n\t\t\tif ( ! self::$_instance ) {\n\t\t\t\tself::$_instance = new self();\n\t\t\t}\n\n\t\t\treturn self::$_instance;\n\t\t}", "public static function instance () {\n if ( is_null( self::$_instance ) ) {\n self::$_instance = new self();\n }\n return self::$_instance;\n }", "public static function instance() {\n\t if ( !isset( self::$instance ) ) {\n\t $className = __CLASS__;\n\t self::$instance = new $className;\n\t }\n\t return self::$instance;\n\t }", "public static function instance()\n {\n global $container;\n return $container->getByType(self::class);\n }", "public static function self() {\n\n\t\treturn self::factory( 'self' );\n\n\t}", "public static function instance() {\n return new static();\n }", "public static function get() {\n\t\tif ( self::$instance == null ) {\n\t\t\tself::$instance = new self();\n\t\t}\n\t\treturn self::$instance;\n\t}", "public static function instance () {\n\t\tif ( is_null( self::$_instance ) )\n\t\t\tself::$_instance = new self();\n\t\treturn self::$_instance;\n\t}", "public static function getInstance()\n {\n return GeneralUtility::makeInstance(self::class);\n }", "public static function getInstance()\n {\n return GeneralUtility::makeInstance(self::class);\n }", "public static function newInstance()\n {\n $instance = new self;\n return $instance;\n }", "public static function instance()\n {\n return new static();\n }", "public static function instance()\n {\n return new static();\n }", "public static function get_instance()\n {\n if (true === empty(self::$instance)) {\n $instance = new self();\n }\n return $instance;\n }", "public static function instance() {\n\t\tstatic $instance;\n\n\t\tif ( empty( $instance ) ) {\n\t\t\t$instance = new self();\n\t\t}\n\n\t\treturn $instance;\n\t}", "public static function get_instance() {\n\n if ( ! self::$instance instanceof self ) {\n self::$instance = new self;\n }\n\n return self::$instance;\n\n }", "public function __construct ()\n {\n return this;\n }", "public function __construct() {\n return $this;\n }", "public static function get_instance() {\n $self = __CLASS__;\n\n if ( is_null( $self::$instance ) ) {\n $self::$instance = new $self;\n }\n\n return $self::$instance;\n }", "public static function instance() {\n\t\t\tif ( null === self::$_instance ) {\n\t\t\t\tself::$_instance = new self();\n\t\t\t}\n\t\t\treturn self::$_instance;\n\t\t}", "public static function instance() {\n\t\tif ( is_null( self::$_instance ) ) {\n\t\t\tself::$_instance = new self();\n\t\t}\n\n\t\treturn self::$_instance;\n\t}", "public static function instance() {\n\t\tif ( is_null( self::$_instance ) ) {\n\t\t\tself::$_instance = new self();\n\t\t}\n\n\t\treturn self::$_instance;\n\t}", "public static function instance() {\n\t\tif ( is_null( self::$_instance ) ) {\n\t\t\tself::$_instance = new self();\n\t\t}\n\n\t\treturn self::$_instance;\n\t}", "public static function instance() {\n if ( is_null( self::$_instance ) ) {\n self::$_instance = new self();\n }\n return self::$_instance;\n }", "public static function instance() {\n if ( is_null( self::$_instance ) ) {\n self::$_instance = new self();\n }\n return self::$_instance;\n }", "public function instance();", "public static function instance() {\n\t\tif ( !isset( self::$instance ) ) {\n\t\t\t$class_name = __CLASS__;\n\t\t\tself::$instance = new $class_name;\n\t\t}\n\t\treturn self::$instance;\n\t}", "public static function instance() {\r\n if ( is_null( self::$_instance ) ) {\r\n self::$_instance = new self();\r\n }\r\n return self::$_instance;\r\n }", "public static function instance() {\r\n if ( is_null( self::$_instance ) ) {\r\n self::$_instance = new self();\r\n }\r\n return self::$_instance;\r\n }", "public static function instance() {\n\t\tif ( is_null( self::$_instance ) )\n\t\t\tself::$_instance = new self();\n\t\treturn self::$_instance;\n\t}", "public static function instance()\n {\n if (is_null(self::$_instance)) {\n self::$_instance = new self();\n }\n\n return self::$_instance;\n }", "public static function instance() {\n\t\tif ( ! isset( self::$instance ) ) {\n\t\t\t$class_name = __CLASS__;\n\t\t\tself::$instance = new $class_name;\n\t\t}\n\t\treturn self::$instance;\n\t}", "public static function instance()\r\n\t\t{\r\n\t\t\t\r\n\t\t\tif ( ! self::$instance instanceof self )\r\n\t\t\t{\r\n\t\t\t\tself::$instance = new self;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\treturn self::$instance;\r\n\t\t}", "public function getInstance()\n {\n return $this->instance;\n }", "public function getInstance()\n {\n return $this->instance;\n }", "public function getInstance()\n {\n return $this->instance;\n }", "public function getInstance()\n {\n return $this->instance;\n }", "public static function instance() {\r\n\t\tif ( is_null( self::$_instance ) ) {\r\n\t\t\tself::$_instance = new self();\r\n\t\t}\r\n\t\treturn self::$_instance;\r\n\t}", "public static function instance() {\r\n\t\tif ( is_null( self::$_instance ) ) {\r\n\t\t\tself::$_instance = new self();\r\n\t\t}\r\n\t\treturn self::$_instance;\r\n\t}", "public static function instance() {\n if(is_null( self::$_instance)){\n self::$_instance = new self();\n }\n return self::$_instance;\n }", "public static function instance() {\n\t\tif ( is_null( self::$_instance ) ) {\n\t\t\tself::$_instance = new self();\n\t\t}\n\t\treturn self::$_instance;\n\t}", "public static function instance() {\n\t\tif ( is_null( self::$_instance ) ) {\n\t\t\tself::$_instance = new self();\n\t\t}\n\t\treturn self::$_instance;\n\t}", "public static function instance() {\n\t\tif ( is_null( self::$_instance ) ) {\n\t\t\tself::$_instance = new self();\n\t\t}\n\t\treturn self::$_instance;\n\t}", "public static function instance() {\n\t\tif ( is_null( self::$_instance ) ) {\n\t\t\tself::$_instance = new self();\n\t\t}\n\t\treturn self::$_instance;\n\t}", "public static function instance() {\n\t\tif ( is_null( self::$_instance ) ) {\n\t\t\tself::$_instance = new self();\n\t\t}\n\t\treturn self::$_instance;\n\t}", "public static function instance() {\n\t\tif ( is_null( self::$_instance ) ) {\n\t\t\tself::$_instance = new self();\n\t\t}\n\t\treturn self::$_instance;\n\t}", "public static function instance() {\n\t\tif ( is_null( self::$_instance ) ) {\n\t\t\tself::$_instance = new self();\n\t\t}\n\t\treturn self::$_instance;\n\t}", "public static function instance() {\n\t\tif ( is_null( self::$_instance ) ) {\n\t\t\tself::$_instance = new self();\n\t\t}\n\t\treturn self::$_instance;\n\t}", "public static function instance() {\n\t\tif ( is_null( self::$_instance ) ) {\n\t\t\tself::$_instance = new self();\n\t\t}\n\t\treturn self::$_instance;\n\t}", "public static function instance() {\n\t\tif ( is_null( self::$_instance ) ) {\n\t\t\tself::$_instance = new self();\n\t\t}\n\t\treturn self::$_instance;\n\t}", "public static function instance() {\n\t\tif ( is_null( self::$_instance ) ) {\n\t\t\tself::$_instance = new self();\n\t\t}\n\t\treturn self::$_instance;\n\t}", "public static function instance() {\n if ( is_null( self::$_instance ) ) {\n self::$_instance = new self();\n }\n return self::$_instance;\n }", "public static function instance() {\n\n\t\tif (!self::$instance) {\n\t\t\tself::$instance = new self();\n\t\t}\n\n\t\treturn self::$instance;\n\t}", "public static function get_instance() {\n\t\t\tif ( is_null( self::$instance ) ) {\n\t\t\t\tself::$instance = new self();\n\t\t\t}\n\n\t\t\treturn self::$instance;\n\t\t}", "public static function get_instance() {\n\n if ( null == self::$instance ) {\n self::$instance = new self;\n }\n\n return self::$instance;\n\n }", "public static function instance() {\n\t\tif ( ! isset( self::$instance ) ) {\n\t\t\t$className = __CLASS__;\n\t\t\tself::$instance = new $className;\n\t\t}\n\t\treturn self::$instance;\n\t}", "public static function get_instance(){\n\t\t\tif( is_null( self::$instance ) ){\n\t\t\t\tself::$instance = new self();\n\t\t\t}\n\n\t\t\treturn self::$instance;\n\t\t}", "public static function instance() {\n\t\tif ( is_null( self::$instance ) ) {\n\t\t\tself::$instance = new self();\n\t\t}\n\n\t\treturn self::$instance;\n\t}", "public static function instance() {\n if ( empty( self::$instance ) ) {\n self::$instance = new self;\n }\n\n return self::$instance;\n }", "public static function getInstance() {\n\t\treturn parent::getInstance(__CLASS__);\n\t}", "public function get_instance() {\n if ( null == self::$instance ) {\n self::$instance = new self;\n }\n return self::$instance;\n }", "public static function instance() {\n\t\tif ( empty( self::$instance ) ) {\n\t\t\tself::$instance = new self();\n\t\t}\n\n\t\treturn self::$instance;\n\t}", "public function getInstance() {\n\t\treturn $this->instance;\n\t}", "public static function getInstance() {\n\n static $instance;\n //If the class was already instantiated, just return it\n if (isset($instance))\n return $instance;\n\n $instance = new self;\n\n return $instance;\n }", "public static function getInstance() {\n\t\treturn parent::getInstance(__CLASS__); \n\t}", "public static function make() {\n return new self();\n }", "public static function instance()\n {\n return new static;\n }", "public static function instance()\n {\n return new static;\n }", "public static function instance()\n {\n if (is_null(self::$_instance)) {\n self::$_instance = new self();\n }\n return self::$_instance;\n }", "public static function instance(): self\n {\n return self::$instance ??= new self();\n }", "public static function instance() {\n\t\tif ( is_null( self::$instance ) ) {\n\t\t\tself::$instance = new self;\n\t\t}\n\t\treturn self::$instance;\n\t}", "public static function instance() {\n\t\tif ( is_null( ( self::$instance ) ) ) {\n\t\t\tself::$instance = new self();\n\t\t}\n\n\t\treturn self::$instance;\n\t}", "public static function instance() {\n\t\tif ( ! ( self::$instance instanceof self ) ) {\n\t\t\tself::$instance = new self();\n\t\t}\n\n\t\treturn self::$instance;\n\t}", "public static function instance() {\n\t\tif ( is_null( self::$instance ) ) {\n\t\t\tself::$instance = new self();\n\t\t}\n\t\treturn self::$instance;\n\t}", "public static function instance() {\n\t\tif ( is_null( self::$instance ) ) {\n\t\t\tself::$instance = new self();\n\t\t}\n\t\treturn self::$instance;\n\t}" ]
[ "0.8420408", "0.8294268", "0.8284727", "0.8185681", "0.814195", "0.806225", "0.806225", "0.8053714", "0.7949084", "0.79367214", "0.78899544", "0.78795964", "0.7828023", "0.78272563", "0.78272563", "0.78272563", "0.78272563", "0.78272563", "0.78272563", "0.7824446", "0.7804501", "0.78034353", "0.7802998", "0.7802998", "0.7801484", "0.77891594", "0.7786747", "0.7779779", "0.7768517", "0.7767042", "0.7766553", "0.77581304", "0.7729626", "0.77270585", "0.771491", "0.771491", "0.77145505", "0.77060175", "0.77060175", "0.7705015", "0.77044153", "0.7698231", "0.7691784", "0.7687147", "0.7683497", "0.7683059", "0.7680886", "0.7680886", "0.7680886", "0.76781887", "0.76781887", "0.7675862", "0.76598555", "0.76538944", "0.76538944", "0.7649058", "0.7646207", "0.76459575", "0.7644753", "0.76408374", "0.76408374", "0.76408374", "0.76408374", "0.7637721", "0.7637721", "0.7633592", "0.7628358", "0.7628358", "0.7628358", "0.7628358", "0.7628358", "0.7628358", "0.7628358", "0.7628358", "0.7628358", "0.7628358", "0.7628358", "0.76275927", "0.7625741", "0.76248527", "0.7622678", "0.7622546", "0.7622088", "0.7618764", "0.761812", "0.7616524", "0.76157117", "0.7597139", "0.7596042", "0.75859344", "0.75818074", "0.7580693", "0.75798005", "0.75798005", "0.75792855", "0.75749344", "0.7573568", "0.7570009", "0.7569867", "0.7565045", "0.7565045" ]
0.0
-1
Only throw exceptions for real errors, ... warnings and noticed may be debugged though
function errortoexception($errno, $errstr, $errfile, $errline , $errcontext){ switch ($errno){ case E_USER_WARNING: case E_USER_NOTICE: case E_WARNING: case E_NOTICE: case E_CORE_WARNING: case E_COMPILE_WARNING: break; case E_USER_ERROR: case E_ERROR: case E_PARSE: case E_CORE_ERROR: case E_COMPILE_ERROR: $exception = new errortoException($errstr , $errno); $exception->setFile($errfile); $exception->setLine($errline); throw $exception; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function throwError();", "protected function check_errors()\n {\n if (true === $this->error_flag) {\n throw new \\Exception($this->get_error( true ));\n }\n }", "public function testErrorHandling()\n\t{\n\t\tR::nuke();\n\t\tR::store( R::dispense( 'book' ) );\n\t\tR::freeze( FALSE );\n\t\tR::find( 'book2', ' id > 0' );\n\t\tpass();\n\t\tR::find( 'book', ' id2 > ?' );\n\t\tpass();\n\t\t$exception = NULL;\n\t\ttry {\n\t\t\tR::find( 'book', ' id = ?', array( 0, 1 ) );\n\t\t} catch( \\Exception $e ) {\n\t\t\t$exception = $e;\n\t\t}\n\t\tasrt( ( $exception instanceof SQL ), TRUE );\n\t\tR::freeze( TRUE );\n\t\t$exception = NULL;\n\t\ttry {\n\t\t\tR::find( 'book2', ' id > 0' );\n\t\t} catch( \\Exception $e ) {\n\t\t\t$exception = $e;\n\t\t}\n\t\tasrt( ( $exception instanceof SQL ), TRUE );\n\t\t$exception = NULL;\n\t\ttry {\n\t\t\tR::find( 'book', ' id2 > 0' );\n\t\t} catch( \\Exception $e ) {\n\t\t\t$exception = $e;\n\t\t}\n\t\tasrt( ( $exception instanceof SQL ), TRUE );\n\t}", "private function throwException()\n {\n throw new CacheException(\\odbc_errormsg(), (int) \\odbc_error());\n }", "public function fails();", "public function fails();", "function broken() { }", "protected static function throwHardCheckError()\n {\n throw new \\InvalidArgumentException('Value has wrong type');\n }", "public function testThrowException()\n {\n throw new ImageNotReadableException();\n }", "function dummyErrorFunc() { }", "protected function validateOrThrow() {}", "abstract public function error();", "function testrateException()\n\t{\n\t\t$this->expectException(Exception::class);\n\t\tMath_Finance::rate(20, -36.157534, 255, 0, 3);\n\t}", "public function testException() {\n\t\ttry {\n\t\t\t$array = array( 'ABC' );\n\t\t\t$percentages = new Percentages( $array );\n\t\t} catch ( \\RuntimeException $expected ) {\n\t\t\treturn;\n\t\t}\n\t\t$this->fail( 'An expected exception has not been raised.' );\n\t}", "function error(){}", "function texc($x)\r\n{\r\n\tthrow new \\Exception('Debug: ' . $x);\r\n}", "public function failed();", "public function testErrorMessage()\n {\n $this->throwErrorException();\n\n // test if code actually gets here\n $this->assertTrue(true);\n }", "public function testException()\n {\n throw new ThumbNotFoundException;\n }", "function broken() { return TRUE; }", "function module_builder_handle_sanity_exception($e) {\n $failed_sanity_level = $e->getFailedSanityLevel();\n switch ($failed_sanity_level) {\n case 'data_directory_exists':\n $message = \"The component data directory could not be created or is not writable.\";\n break;\n case 'component_data_processed':\n $message = \"No component data was found. Run 'drush mb-download' to process component data from documentation files.\";\n break;\n }\n drush_set_error(DRUSH_APPLICATION_ERROR, $message);\n}", "public function __test()\n {\n throw new \\Exception('Oops! It is a dead end!', 400);\n }", "private static function fail2()\n {\n throw new \\Exception('Thrown from fail2()');\n }", "public function error()\n {\n throw new Exception('Something went wrong!');\n }", "public function errorOccured();", "protected function error($msg) {\n \t parent::error($msg); //log in error msg\n throw new Exception ($msg); // <-- TESTS php4\n }", "abstract protected function handleError(\\Exception $e);", "private function checkForModuleOrFunctionException():void\n {\n // check for module and function error\n if ($this->hasError()) {\n //check for bad module\n $this->moduleExceptionChecker();\n\n //check for bad function\n $this->functionExceptionChecker();\n }\n }", "public function testExceptionSanity() {\r\n $e = new StorageException();\r\n $this->assertTrue($e instanceof \\Exception);\r\n }", "protected function assertErrorLogEntries() {}", "protected function tossIfException()\n\t{\n\t\tif ($this->exception) {\n\t\t\tthrow $this->exception;\n\t\t}\n\t}", "private function checkError() : void\n {\n $this->isNotPost();\n $this->notExist();\n $this->notAdmin();\n }", "private function ensureInitials()\n\t{\n\t\t$errors = $this->getInitialErrors();\n\n\t\tif($errors)\n\t\t{\n\t\t\tthrow new \\Exception(implode('<br>', $errors), 1);\n\t\t}\n\t}", "protected function throwInaccessibleException() {}", "abstract public function getLastError();", "abstract public function getLastError();", "public function testException()\n {\n throw new Exception('This is not expected.');\n }", "function check(){\r\n\t\tglobal $PDBCExceptionException;\r\n\t\tif($PDBCExceptionException)\r\n\t\t\tPDBCException::raise($PDBCExceptionException);\r\n\t}", "public abstract function onFail();", "function exception_error_handler($errno, $errstr, $errfile, $errline ) {\n // Don't catch suppressed errors with '@' sign\n // @link http://stackoverflow.com/questions/7380782/error-supression-operator-and-set-error-handler\n $error_reporting = ini_get('error_reporting');\n if (!($error_reporting & $errno)) {\n return;\n }\n throw new ErrorException($errstr, $errno, 0, $errfile, $errline);\n}", "function my_assert_handler($file, $line, $code, $msg = '')\n{\n throw new Exception($msg, (int) $code);\n}", "protected function getLastError() {}", "public function testExceptionWithMessage()\n {\n throw new ThumbNotFoundException('Thumb not found!');\n }", "public function support(\\Exception $exception);", "public function error();", "protected abstract function send_error($ex=null) ;", "public function testGetImageInfoFromBlobException()\n {\n $rwongBlob = file_get_contents(__FILE__);\n $this->setExpectedException('Exception');\n Tinebase_ImageHelper::getImageInfoFromBlob($rwongBlob);\n }", "public function try(){\n\n }", "function uncaught_exception($o){\n $o['message'] = Trace::exceptionToText($o['exception']);\n $o['trace'] = Trace::exFullTrace($o['exception']);\n unexpected_failure($o);\n }", "function getError();", "function getError();", "function handleError($errno, $errstr, $errfile, $errline, array $errcontext)\n{\n // error was suppressed with the @-operator\n if (0 === error_reporting()) {\n return false;\n }\n\n throw new ErrorException($errstr, 0, $errno, $errfile, $errline);\n}", "abstract public function handleFatalError($e);", "public function testExceptions()\n {\n $Location = new Location(self::$databaseName, self::$collection);\n $output = json_decode($Location->getAllCities('_id'));\n $this->assertEquals($output->error, \"true\");\n\n $output = json_decode($Location->getAllCities('india', true));\n $this->assertEquals($output->error, \"true\");\n\n $output = json_decode($Location->getAllCountries(true));\n $this->assertEquals($output->error, \"true\");\n }", "function debug_error() {\n\tswitch ( Request::parameter('code') ) {\n\t\tcase 'exception':\n\t\tcase '0':\n\t\t\t$key = 0;\n\t\t\tbreak;\n\t\tcase 'http-exception':\n\t\tcase '1':\n\t\t\t$key = 1;\n\t\t\tbreak;\n\t\tcase 'user-error':\n\t\tcase '2':\n\t\t\t$key = 2;\n\t\t\tbreak;\n\t\tcase 'php-error':\n\t\tcase '3':\n\t\t\t$key = 3;\n\t\t\tbreak;\n\t\tdefault:\n\t\t\t$key = mt_rand(0,3);\n\t}\n\tswitch ($key) {\n\t\tcase 0: throw new Exception(\"a debug exception occurred\");\n\t\tcase 1:\n\t\t\t$http_error_classes = array();\n\t\t\tforeach (get_declared_classes() as $c) {\n\t\t\t\t$r = new ReflectionClass($c);\n\t\t\t\tif (!$r->isAbstract() && $r->isSubclassOf('HttpException'))\n\t\t\t\t\t$http_error_classes[] = $c;\n\t\t\t}\n\t\t\t$http_error = $http_error_classes[ mt_rand(0, count($http_error_classes)-1) ];\n\t\t\tthrow new $http_error();\n\t\tcase 2: trigger_error('debug error', E_USER_ERROR);\n\t\tcase 3: $x = 2 / 0;\n\t}\n}", "function testinternalRateOfReturnException2()\n\t{\n\t\t$this->expectException(Exception::class);\n\t\tMath_Finance::internalRateOfReturn(array(70000, 12000, 15000, 18000, 21000));\n\t}", "public function throwFatalError( $the_error='' );", "public function testTask1Exception(){\n\n }", "abstract protected function _unimplemented() : Exception;", "abstract protected function _unimplemented() : Exception;", "abstract protected function _unimplemented() : Exception;", "public function testThrowException(): void\n {\n throw new Exception();\n }", "public function failure(){\n\t}", "public function testFinderRangeLifeErrors() {\n $this->setExpectedException('BadFunctionCallException');\n $this->Links->find('rangeLife');\n }", "public function failed()\n {\n // Do nothing\n }", "protected function throwRedirectException() {}", "public function checkForErrors()\n {\n if ($this->getDebtor() == '' && $this->getDebtorCode() == '') {\n throw new \\InvalidArgumentException(\n sprintf('Debtor or DebtorCode must be defined')\n );\n }\n\n if ($this->getDomain() == '') {\n throw new \\InvalidArgumentException(\n sprintf('Domain must be defined')\n );\n }\n\n if ($this->getTld() == '') {\n throw new \\InvalidArgumentException(\n sprintf('Tld must be defined')\n );\n }\n }", "function validate() {\n throw new Exception(\"Invalid validate call\");\n }", "abstract public function getErrorType(): string;", "function queryErrorCheckNoDie($a)\r\n\t{\r\n\t\tif(PEAR::isError($a)) echo $a->getMessage();\r\n\t}", "function testinternalRateOfReturnException1()\n\t{\n\t\t$this->expectException(Exception::class);\n\t\tMath_Finance::internalRateOfReturn(-70000, 12000, 15000, 18000, 21000);\n\t}", "function graceful_fail($message)\n {\n }", "public function testErrors()\n {\n $database = Database::create(['driver' => 'sqlite', 'dsn' => 'sqlite::memory:']);\n $query = new Query($database);\n $superQuery = new QueryProxy($query);\n\n $this->assertException(InvalidArgumentException::class, function () use ($superQuery) {\n $superQuery->where(new \\stdClass);\n }, function (InvalidArgumentException $exception) {\n $this->assertInstanceOf(QueryScribeInvalidArgumentException::class, $exception->getPrevious());\n });\n\n $this->assertException(InvalidReturnValueException::class, function () use ($superQuery) {\n $superQuery->apply(function () {\n return 'hello';\n });\n }, function (InvalidReturnValueException $exception) {\n $this->assertInstanceOf(QueryScribeInvalidReturnValueException::class, $exception->getPrevious());\n });\n }", "public function badFilter(): void\n {\n throw new RuntimeException('nope');\n }", "public function diagnose() {}", "function testBug2301() \n {\n $sText = <<<SCRIPT\n<?php\nthrow new AccountFindException();\n?>\nSCRIPT;\n $this->setText($sText);\n $sExpected = <<<SCRIPT\n<?php\nthrow new AccountFindException();\n?>\nSCRIPT;\n $this->assertEquals($sExpected, $this->oBeaut->get());\n }", "public function capable(\\Exception $error);", "protected function exceptions($exception){\n\t\tthrow $exception;\n\t}", "public function getException();", "protected static function exception()\n {\n foreach (self::fetch('exceptions') as $file) {\n Bus::need($file);\n }\n }", "function ErrorNative() {}", "function raise(\\Exception $ex);", "public function testFaultyProperties()\n {\n $international = new International();\n\n try {\n $international->setProduct(str_repeat('a', 10));\n $this->fail('BpostInvalidValueException not launched');\n } catch (BpostInvalidValueException $e) {\n // Nothing, the exception is good\n } catch (Exception $e) {\n $this->fail('BpostInvalidValueException not caught');\n }\n\n // Exceptions were caught,\n $this->assertTrue(true);\n }", "function test_4() {\n\ttry {\n\t\t$res = gather(function() {\n\t\t\ttake(1);\n\t\t\tthrow new Exception('meh');\n\t\t});\n\t}\n\tcatch (Exception $e) {\n\t\treturn true;\n\t}\n\treturn 'non-last()-generated exceptions are left alone';\n}", "function exception_error_handler($errno, $errstr, $errfile, $errline ) {\n throw new \\ErrorException($errstr, 0, $errno, $errfile, $errline);\n}", "public function error() {\n // The tests cover errors, so there will be plenty to sift through\n // $msg = func_get_arg(0);\n // $err = 'API ERROR: ' . $msg . PHP_EOL;\n\n // $objs = func_get_args();\n // array_splice($objs, 0, 1);\n\n // ob_start();\n // foreach($objs as $obj) {\n // var_dump($obj);\n // }\n // $strings = ob_get_clean();\n\n // file_put_contents('tests.log', [$err, $strings], FILE_APPEND);\n }", "function returnError($message, $code)\n{\n throw new \\Exception($message, $code);\n}", "function do_exception($line, $code = -1) {\n\tthrow new Exception(\"Error at line: {$line}\", $code);\n}", "function testmodifiedInternalRateOfReturnException1()\n\t{\n\t\t$this->expectException(Exception::class);\n\t\tMath_Finance::modifiedInternalRateOfReturn(-70000, 12000, 15000, 18000, 21000, 0.10, 0.12);\n\t}", "function testpaymentException1()\n\t{\n\t\t$this->expectException(Exception::class);\n\t\tMath_Finance::payment(0.29, -7, 435);\n\t}", "function errorHandler($errno, $errstr, $errfile, $errline) {\n if ($errno != 2 && $errno != 8) {\n throw new Exception(\"Fatal Error Detected: [$errno] $errstr line: $errline\", 1);\n }\n }", "function errorHandler($errno,$errstr){\n\t global $errors;\n\n\t raiseError(\"We are working to solve an internal issue in our service. Please, try later.\", Constants::HTTP_INTERNAL_SERVER_ERROR);\n\t}", "abstract function bootErrorAction(array $errors = null);", "function testmodifiedInternalRateOfReturnException2()\n\t{\n\t\t$this->expectException(Exception::class);\n\t\tMath_Finance::modifiedInternalRateOfReturn(array(70000, 12000, 15000, 18000, 21000), 0.10, 0.12);\n\t}", "abstract protected function doEvil();", "public function testImportingQueueEngineFailure(): void\n {\n $this->expectException('\\InvalidArgumentException');\n\n Queue::setConfig('fail', []);\n Queue::engine('fail');\n }", "public function testThrowWithoutOffset() {\n\t\ttry {\n\t\t\tthrow new \\YapepBase\\Exception\\IndexOutOfBoundsException();\n\t\t\t$this->fail('Exception not thrown!');\n\t\t} catch (\\YapepBase\\Exception\\IndexOutOfBoundsException $e) {\n\t\t\t$this->assertNotEquals('', $e->getMessage(), 'Message is empty!');\n\t\t}\n\t}", "public function testWarningMessage()\n {\n $this->throwWarningException();\n\n // test if code actually gets here\n $this->assertTrue(true);\n }", "function testpaymentException2()\n\t{\n\t\t$this->expectException(Exception::class);\n\t\tMath_Finance::payment(0.29, 7, 435, 0, 3);\n\t}", "public function test_ThrowableException()\n {\n try {\n throw new \\RuntimeException(\"some exception\");\n } catch (\\Exception $e) {\n\n } catch (\\Throwable $e) {\n\n }\n\n $this->assertTrue(true);\n }" ]
[ "0.7070242", "0.6882576", "0.68061376", "0.6755365", "0.6728808", "0.6728808", "0.6703112", "0.6652806", "0.6609627", "0.65868795", "0.65684634", "0.6517485", "0.648824", "0.64871967", "0.64558315", "0.64291763", "0.64261645", "0.6395946", "0.6389801", "0.63845587", "0.6360091", "0.6353451", "0.63391715", "0.6332642", "0.6305353", "0.6301505", "0.6251166", "0.6227099", "0.6216895", "0.6207493", "0.6204079", "0.61996126", "0.619682", "0.619519", "0.618806", "0.618806", "0.61701816", "0.6166831", "0.61644053", "0.61358863", "0.6117215", "0.6097724", "0.6089689", "0.60874164", "0.6079216", "0.606968", "0.60647655", "0.60545367", "0.60465944", "0.6038068", "0.6038068", "0.6036553", "0.60363775", "0.602988", "0.6027619", "0.6020652", "0.6017564", "0.6017555", "0.6009382", "0.6009382", "0.6009382", "0.6008206", "0.6000719", "0.59902364", "0.59695977", "0.5965502", "0.59625256", "0.5944985", "0.593447", "0.59307253", "0.5929801", "0.592725", "0.59089524", "0.5906033", "0.5900276", "0.5896816", "0.58905834", "0.58868045", "0.58824396", "0.5877059", "0.5877031", "0.5875174", "0.58740413", "0.58663416", "0.5863348", "0.58620477", "0.58603615", "0.58492804", "0.5847997", "0.5845529", "0.58410156", "0.5836712", "0.5836377", "0.58347714", "0.5832612", "0.5831561", "0.58239913", "0.5821917", "0.5821013", "0.58194125" ]
0.59715694
64
endregion region MAIN METHODS endregion region SCOPE METHODS endregion region RELATION METHODS
public function inquirer() { return $this->belongsTo(Inquirer::class,'inquirer_id','id'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function _i() {\n }", "abstract protected function external();", "private function __() {\n }", "protected function __init__() { }", "public function __init(){}", "final function velcom(){\n }", "final private function __construct() {}", "final private function __construct() {}", "private function __construct()\t{}", "final private function __construct(){\r\r\n\t}", "private function method2()\n\t{\n\t}", "protected function _refine() {\n\n\t}", "final private function __construct() { }", "final private function __construct() { }", "final private function __construct() { }", "public function helper()\n\t{\n\t\n\t}", "abstract public function getScope();", "public function getBase(): void {}", "abstract protected function initialize();", "abstract protected function initialize();", "abstract protected function initialize();", "abstract protected function initialize();", "abstract protected function initialize();", "final function __construct() { \n\t}", "private function method1()\n\t{\n\t}", "abstract protected function _init();", "abstract protected function _init();", "function getFinal()\n {\n }", "public function init() {\n\t\t\n\t}", "abstract protected function init();", "abstract protected function init();", "abstract protected function init();", "abstract protected function init();", "abstract protected function init();", "abstract protected function init();", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "private function init()\n\t{\n\t\treturn;\n\t}", "public function init() {\t\t\n\n }", "function _construct() {\n \t\n\t\t\n\t}", "abstract protected function _initialize();", "public function init()\n {\t\t\t\n }", "public function init()\n {\t\t\t\n }", "public function custom()\n\t{\n\t}", "public function init ()\r\n {\r\n }", "private function __construct () {}", "public function init()\n {\n \treturn;\n }", "protected function init()\n\t{\n\t\t\n\t}", "abstract protected function _finalize();", "public function init()\n\t\t{\n\t\n\t\t}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private final function __construct() {}", "protected function init() {return;}", "final private function __construct()\n\t{\n\t}", "final private function __construct() {\n\t\t\t}", "public function ogs()\r\n {\r\n }", "private function __construct() {\r\n\t\r\n\t}", "private function __construct() {\r\n\t\t\r\n\t}", "protected final function __construct() {}", "abstract protected function _init( );", "public function access();", "public function _init() {\r\n\r\n }", "protected function _init()\r\n\t{\r\n\t}", "private function __construct( )\n {\n\t}", "public function method() {\n\t}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}" ]
[ "0.6048549", "0.60397094", "0.6024018", "0.59121823", "0.5752649", "0.56953806", "0.5661099", "0.5661099", "0.56576693", "0.56394434", "0.5622048", "0.56065094", "0.5590188", "0.5590188", "0.5590188", "0.55845124", "0.5573584", "0.55489314", "0.55385095", "0.55385095", "0.55385095", "0.55385095", "0.55385095", "0.5536238", "0.55283237", "0.5511827", "0.5511827", "0.55026704", "0.5494017", "0.5491929", "0.5491929", "0.5491929", "0.5491929", "0.5491929", "0.5491929", "0.5491619", "0.5491619", "0.5491619", "0.5491619", "0.5491619", "0.5491619", "0.5490962", "0.5490962", "0.5490962", "0.5490962", "0.5490388", "0.5490388", "0.5474036", "0.54640496", "0.5454011", "0.54169834", "0.54027426", "0.54027426", "0.54013807", "0.5398822", "0.53888667", "0.5383537", "0.5383162", "0.538248", "0.53813267", "0.53782123", "0.53782123", "0.53782123", "0.53782123", "0.53782123", "0.53782123", "0.53782123", "0.53782123", "0.53782123", "0.53782123", "0.53782123", "0.53782123", "0.53782123", "0.53782123", "0.53782123", "0.53782123", "0.53782123", "0.53782034", "0.5376313", "0.53733134", "0.53679675", "0.53611946", "0.53596693", "0.5357998", "0.53496915", "0.5333107", "0.53318524", "0.53189", "0.5316768", "0.52995956", "0.52955496", "0.52948475", "0.52948475", "0.52948475", "0.52948475", "0.52948475", "0.52948475", "0.52948475", "0.52948475", "0.52948475", "0.52948475" ]
0.0
-1
Load a promotion's properties
private function _load($id) { $id = abs(intval($id)); $db = Denkmal_Db::get(); $sql = 'SELECT id, text, active FROM promotion WHERE id=?'; $this->_data = $db->fetchRow($sql, $id); if (!$this->_data) { throw new Denkmal_Exception("Promotion doesn't exist (" . $id . ")"); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function loadMetadata() {\n\t\t$this->pMeta = $this->em->getClassMetadata('OcProduct');\n\t\t$this->pdMeta = $this->em->getClassMetadata('OcProductDescription');\n\t}", "public function setPromotion($promotion)\n {\n $this->promotion = $promotion;\n }", "public function loadItemProperties()\n {\n $data = Yii::app()->db->createCommand()\n ->select('t1.title,t1.il,t1.iwa,t1.iww,t1.iwt,t1.ils,t1.iws,t1.iwp,t1.iwss,t1.iwcb,t1.bw,t1.vpr,t1.rpli,t1.iwar,t1.iwwr,t2.stretch')\n ->from('itemsize as t1')\n ->leftJoin('item as t2','t2.id=t1.item_id')\n ->where('t1.item_id=:item_id', array(':item_id'=>$this->itemId))\n ->queryAll();\n \n foreach($data as $itemSize)\n {\n foreach($itemSize as $key=>$value) \n {\n if($key!='title') {\n $this->itemProperties[$itemSize['title'].'_'.$this->itemS[$key]]=$value;\n $this->sizeList[$itemSize['title']]=$itemSize['title'];\n } \n }\n }\n //Helper::myPrint_r($this->itemProperties);\n }", "private function metaLoad()\n {\n $this->meta ??= $this?->relations['meta'] ?? $this->meta()->get();\n }", "public function getPromotion(){\n return $this->promotion;\n }", "public function promotion()\n {\n return $this->hasOne('App\\Entities\\Promotion', 'id_promotion', 'id_promotion');\n }", "private function getProperties(){\n\n\n\t\t$props = get_post_meta(\n\t\t\t$this->post_id,\n\t\t\t'_column_props_'.$this->fullId,\n\t\t\ttrue\n\t\t);\n\n\n\n\t\t$defaults = $this->getDefaultColumnArgs();\n\t\t$props = wp_parse_args( $props, $defaults );\n\n\t\t$this->properties = $props;\n\n\t}", "protected function loadPropertyTypes() {\n\t\tif (empty($this->cachedPropertyTypes)) {\n\t\t\t$completePropertyTypeConfiguration = $this->configurationManager->getConfiguration('PropertyTypes');\n\t\t\tforeach (array_keys($completePropertyTypeConfiguration) as $propertyTypeName) {\n\t\t\t\t$this->loadPropertyType($propertyTypeName, $completePropertyTypeConfiguration);\n\t\t\t}\n\t\t}\n\t}", "abstract protected function get_properties();", "public function show(Promotion $promotion)\n {\n //\n }", "abstract public function getProperties();", "public function _getProperties() {}", "private function _populatePromotorMeta()\n {\n return $this->promotor_meta->set(\n $this->promotorNewsData['promotor_ID'], \n $this->promotorNewsData['name'], \n $this->promotorNewsData['content']\n );\n }", "abstract protected function getProperties();", "public function load_wp_dependent_properties() {\n\t\t\tdefine( 'BITLIVECC_PLUGIN_URL', untrailingslashit( plugin_dir_url( BITLIVECC_PLUGIN_FILE ) ) );\n\t\t\tdefine( 'BITLIVECC_PLUGIN_BASENAME', plugin_basename( __FILE__ ) );\n\t\t}", "public function setPromotion($promotion){\n $this->promotion = $promotion;\n return $this;\n }", "abstract protected function properties();", "public function getProperties() {}", "public function getProperties() {}", "public function getProperties() {}", "public function getProperties() {}", "function load ()\n {\n $this->relationships = parent::_load ( $this->basepath ) ;\n }", "public function property()\n {\n return $this->belongsTo(Properties::class);\n }", "public function getShopStoreProperty()\n {\n return $this->hasOne(ShopStoreProperty::className(), ['id' => 'shop_store_property_id']);\n }", "private function initPromoItem()\n {\n $this->promoItem = $this->createPartialMock(\n \\Amasty\\Promo\\Model\\ItemRegistry\\PromoItemData::class,\n []\n );\n $this->promoItem->setSku('test_sku')->setRuleId(1);\n }", "private function readLoaderProperties()\n {\n // Read all properties of the loader.\n foreach ((new \\ReflectionClass($this->loader))->getProperties(\\ReflectionProperty::IS_PRIVATE) as $property) {\n $this->properties[$property->name] = static::getObjectAttribute($this->loader, $property->name);\n }\n }", "public function getByID($promotion_id)\n {\n return $this->promotionsRepo->getPromotionByID($promotion_id);\n }", "public function getProperties();", "public function getProperties();", "public function getProperties();", "public function getProperties();", "public function setPromotionType($promotion_type)\n {\n $this->promotion_type = $promotion_type;\n }", "function _getProperties() ;", "public function getProperty();", "public function setPromotionAdapter(\\core\\IPromotionAdapter $promotion)\n {\n $this->promotion = $promotion;\n $this->has_promotion = true;\n }", "public function properties()\n {\n return $this->hasMany('App\\Property');\n }", "public function loadDBProperties()\n\t{\n\t\t$xml = simplexml_load_file(self::DB_PROPERTIES);\n\t\t$this->hostname = (string)$xml->hostname;\n\t\t$this->username = (string)$xml->username;\n\t\t$this->password = (string)$xml->password;\n\t\t$this->database = (string)$xml->database;\n\t}", "private function mapProperties(): void\n {\n $this->properties = Collect::keyBy($this->collection->getProperties()->getValues(), 'identifier');\n }", "public function custompromotion() {\n\n $sessionstaff = $this->Session->read('staff');\n $options6['conditions'] = array('Promotion.clinic_id' => $sessionstaff['clinic_id'], 'Promotion.default' => 0, 'Promotion.is_lite' => 0,'Promotion.is_global'=>0);\n $Promotionlist = $this->Promotion->find('all', $options6);\n $this->set('Promotions', $Promotionlist);\n\n $checkaccess = $this->Api->accesscheck($sessionstaff['clinic_id'], 'Promotions');\n if ($checkaccess == 0) {\n $this->render('/Elements/access');\n }\n }", "private function load(){\n\t\tglobal $TBL_ecommerce_coupon;\n\t\t$link = dbConnect();\n\t\t$request = request(\"SELECT * FROM `$TBL_ecommerce_coupon` WHERE `code`='$this->code'\",$link);\n\t\tmysql_close($link);\n\t\tif(!mysql_num_rows($request)) {\n\t\t\treturn;\n\t\t}\n\t\t$coupon = mysql_fetch_object($request);\n\t\t$this->id=$coupon->id;\n\t\t$this->code=$coupon->code;\n\t\t$this->idClient=$coupon->id_client;\n\t\t$this->type=$coupon->type;\n\t\t$this->value=$coupon->value;\n\t\t$this->percentage=$coupon->percentage;\n\t\t$this->grid=EcommerceCoupon::parseGrid($coupon->grid);\n\t\t$this->usage = $coupon->usage;\n\t\t$this->maxUsage = $coupon->max_usage;\n\t\t$this->usageCount = $coupon->usage_count;\n\t\t$this->validFrom = $coupon->valid_from;\n\t\t$this->validUntil = $coupon->valid_until;\n\n\t\t$this->getStatus();\n\t}", "public function testComAdobeCqCommerceImplPromotionPromotionManagerImpl()\n {\n $client = static::createClient();\n\n $path = '/system/console/configMgr/com.adobe.cq.commerce.impl.promotion.PromotionManagerImpl';\n\n $crawler = $client->request('POST', $path);\n }", "public function load(ObjectManager $manager)\n {\n $productSizesDirector = $this->getDirector('product_sizes');\n \n $product = $this->getReference('product');\n $productSize = $this->getReference('product-size');\n\n $productSizes = $productSizesDirector\n ->create()\n ->setProduct($product)\n ->setSize($productSize);\n\n $productSizesDirector->save($productSizes);\n $this->addReference('product-sizes', $productSizes);\n }", "protected function loadMetaData() {}", "public function load_products() {\n\t\t$this->get_products_posts();\n\t\tif ( $this->posts !== null ) {\n\t\t\tforeach ( $this->posts as $ps_post ) {\n\t\t\t\t$this->add( new ShowcaseProduct( $ps_post ) );\n\t\t\t}\n\t\t}\n\t}", "public function getSwellendamSimilarPropertyOnShow(){\n\t\t\ttry{\n\t\t\t\t$query = \"SELECT properties.property_id, property_type, property_desc, price, num_bathrooms, street_no, \n\t\t\t\t street_name, num_beds, num_garages, property_image_id, image_location, suburbs.suburb_id, \n\t\t\t\t\t\t suburb_name, cities.city_id, city_name, municipalities.municipality_id, municipalities.municipality_name,\n\t\t\t\t\t\t agents.agent_id, firstname, lastname, email, phone, agencies.agency_id, agency_name, logo \n\t\t\t\t\t\t FROM property_images \n\t\t\t\t\t\t LEFT JOIN properties\n\t\t\t\t\t\t ON property_images.property_id = properties.property_id\n\t\t\t\t\t\t LEFT JOIN suburbs\n\t\t\t\t\t\t ON properties.suburb_id = suburbs.suburb_id\n\t\t\t\t\t\t LEFT JOIN cities\n\t\t\t\t\t\t ON suburbs.city_id = cities.city_id\n\t\t\t\t\t\t LEFT JOIN municipalities\n\t\t\t\t\t\t ON cities.municipality_id = municipalities.municipality_id\n\t\t\t\t\t\t LEFT JOIN agents\n\t\t\t\t\t\t ON properties.agent_id = agents.agent_id\n\t\t\t\t\t\t LEFT JOIN agencies\n\t\t\t\t\t\t ON agents.agency_id = agencies.agency_id\n\t\t\t\t\t\t WHERE municipalities.municipality_id = 114\n\t\t\t\t\t\t AND properties.property_status = 'On Show'\n\t\t\t\t\t\t GROUP BY properties.property_id\n\t\t\t\t\t\t DESC\n\t\t\t\t\t\t LIMIT 3\n\t\t\t\t\t\t \";\n\t\t\t\t$result = $this->conn->query($query);\n\n\t\t\t $properties = array();\n\t\t\t\t\n\t\t\t\tforeach($result as $row){\n\t\t\t\t\t$agency = new Agency();\n\t\t\t\t\t$agency->setAgencyID($row['agency_id']);\n\t\t\t\t\t$agency->setAgencyName($row['agency_name']);\n\t\t\t\t\t$agency->setLogo($row['logo']);\n\t\t\t\t\t\n\t\t\t\t\t$agent = new Agent();\n\t\t\t\t\t$agent->setAgentID($row['agent_id']);\n\t\t\t\t\t$agent->setFirstname($row['firstname']);\n\t\t\t\t\t$agent->setLastname($row['lastname']);\n\t\t\t\t\t$agent->setEmail($row['email']);\n\t\t\t\t\t$agent->setPhone($row['phone']);\n\t\t\t\t\t$agent->setAgency($agency);\n\t\t\t\t\t\n\t\t\t\t\t$munucipality = new Municipality();\n\t\t\t\t\t$munucipality->setMunicipalityID($row['municipality_id']);\n\t\t\t\t\t$munucipality->setMunicipalityName($row['municipality_name']);\n\t\t\t\t\t\n\t\t\t\t\t$city = new City();\n\t\t\t\t\t$city->setCityID($row['city_id']);\n\t\t\t\t\t$city->setCityName($row['city_name']);\n\t\t\t\t\t$city->setMunicipality($munucipality);\n\t\t\t\t\t\n\t\t\t\t\t$suburb = new Suburb();\n\t\t\t\t\t$suburb->setSuburbID($row['suburb_id']);\n\t\t\t\t\t$suburb->setSuburbName($row['suburb_name']);\n\t\t\t\t\t$suburb->setCity($city);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t$property = new Property();\t\t\n\t\t\t\t\t$property->setPropertyID($row['property_id']);\t\t\t\n\t\t\t\t\t$property->setSuburb($suburb);\t\n\t\t\t\t\t$property->setAgent($agent);\n\t\t\t\t\t$property->setNumBathRoom($row['num_bathrooms']);\n\t\t\t\t\t$property->setNumBed($row['num_beds']);\n\n\t\t\t\t\t$property->setNumGarage($row['num_garages']);\t\n\t\t\t\t\t$property->setStreetNo($row['street_no']);\t\n\t\t\t\t\t$property->setStreetName($row['street_name']);\t\n\t\t\t\t\t$property->setPropertyDescription($row['property_desc']);\t\n\t\t\t\t\t$property->setPropertyType($row['property_type']);\t\t\n\t\t\t\t\t$property->setPrice($row['price']);\t\n\t\t\t\t\t$property->setImageLocation($row['image_location']);\n\t\t\t\t\t$property->setSuburbID($row['suburb_id']);\n\t\t\t\t\t$property->setMunicipalityID($row['municipality_id']);\n\t\t\t\t\t$property->setMunicipalityName($row['municipality_name']);\n\t\t\t\t\t$property->setCityID($row['city_id']);\n\t\t\t\t\t$properties[] = $property;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\treturn $properties;\n\t\t\t\t\n\t\t\t}catch(PDOException $e){\n\t\t\t\techo $e->getMessage();\n\t\t\t}\n\t\t}", "public function setPromotion(Promotion $promotion)\n {\n $result = DB::select('SELECT fn_invoice_item_promo_eligible(?,?) AS eligible', [$this->id,\n $promotion->id]);\n\n if (!empty($result) && $result[0]->eligible != null) {\n $this->promotion_id = null;\n } else {\n $this->promotion_id = $promotion->id;\n $this->load('promotion');\n }\n $this->save();\n $this->_calculateTotal();\n }", "public function load(): void\n {\n $list = $this->localCache->getObject($this->key);\n $value = $this->resultExtractor->extractObjectFromList($list, $this->targetType);\n $this->resultObject->setValue($this->property, $value);\n }", "public function load()\n {\n $this->settings = get_option($this->optionName);\n }", "public function getSwartlandSimilarPropertyOnShow(){\n\t\t\ttry{\n\t\t\t\t$query = \"SELECT properties.property_id, property_type, property_desc, price, num_bathrooms, street_no, \n\t\t\t\t street_name, num_beds, num_garages, property_image_id, image_location, suburbs.suburb_id, \n\t\t\t\t\t\t suburb_name, cities.city_id, city_name, municipalities.municipality_id, municipalities.municipality_name,\n\t\t\t\t\t\t agents.agent_id, firstname, lastname, email, phone, agencies.agency_id, agency_name, logo \n\t\t\t\t\t\t FROM property_images \n\t\t\t\t\t\t LEFT JOIN properties\n\t\t\t\t\t\t ON property_images.property_id = properties.property_id\n\t\t\t\t\t\t LEFT JOIN suburbs\n\t\t\t\t\t\t ON properties.suburb_id = suburbs.suburb_id\n\t\t\t\t\t\t LEFT JOIN cities\n\t\t\t\t\t\t ON suburbs.city_id = cities.city_id\n\t\t\t\t\t\t LEFT JOIN municipalities\n\t\t\t\t\t\t ON cities.municipality_id = municipalities.municipality_id\n\t\t\t\t\t\t LEFT JOIN agents\n\t\t\t\t\t\t ON properties.agent_id = agents.agent_id\n\t\t\t\t\t\t LEFT JOIN agencies\n\t\t\t\t\t\t ON agents.agency_id = agencies.agency_id\n\t\t\t\t\t\t WHERE municipalities.municipality_id = 120\n\t\t\t\t\t\t AND properties.property_status = 'On Show'\n\t\t\t\t\t\t GROUP BY properties.property_id\n\t\t\t\t\t\t DESC\n\t\t\t\t\t\t LIMIT 3\n\t\t\t\t\t\t \";\n\t\t\t\t$result = $this->conn->query($query);\n\n\t\t\t $properties = array();\n\t\t\t\t\n\t\t\t\tforeach($result as $row){\n\t\t\t\t\t$agency = new Agency();\n\t\t\t\t\t$agency->setAgencyID($row['agency_id']);\n\t\t\t\t\t$agency->setAgencyName($row['agency_name']);\n\t\t\t\t\t$agency->setLogo($row['logo']);\n\t\t\t\t\t\n\t\t\t\t\t$agent = new Agent();\n\t\t\t\t\t$agent->setAgentID($row['agent_id']);\n\t\t\t\t\t$agent->setFirstname($row['firstname']);\n\t\t\t\t\t$agent->setLastname($row['lastname']);\n\t\t\t\t\t$agent->setEmail($row['email']);\n\t\t\t\t\t$agent->setPhone($row['phone']);\n\t\t\t\t\t$agent->setAgency($agency);\n\t\t\t\t\t\n\t\t\t\t\t$munucipality = new Municipality();\n\t\t\t\t\t$munucipality->setMunicipalityID($row['municipality_id']);\n\t\t\t\t\t$munucipality->setMunicipalityName($row['municipality_name']);\n\t\t\t\t\t\n\t\t\t\t\t$city = new City();\n\t\t\t\t\t$city->setCityID($row['city_id']);\n\t\t\t\t\t$city->setCityName($row['city_name']);\n\t\t\t\t\t$city->setMunicipality($munucipality);\n\t\t\t\t\t\n\t\t\t\t\t$suburb = new Suburb();\n\t\t\t\t\t$suburb->setSuburbID($row['suburb_id']);\n\t\t\t\t\t$suburb->setSuburbName($row['suburb_name']);\n\t\t\t\t\t$suburb->setCity($city);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t$property = new Property();\t\t\n\t\t\t\t\t$property->setPropertyID($row['property_id']);\t\t\t\n\t\t\t\t\t$property->setSuburb($suburb);\t\n\t\t\t\t\t$property->setAgent($agent);\n\t\t\t\t\t$property->setNumBathRoom($row['num_bathrooms']);\n\t\t\t\t\t$property->setNumBed($row['num_beds']);\n\n\t\t\t\t\t$property->setNumGarage($row['num_garages']);\t\n\t\t\t\t\t$property->setStreetNo($row['street_no']);\t\n\t\t\t\t\t$property->setStreetName($row['street_name']);\t\n\t\t\t\t\t$property->setPropertyDescription($row['property_desc']);\t\n\t\t\t\t\t$property->setPropertyType($row['property_type']);\t\t\n\t\t\t\t\t$property->setPrice($row['price']);\t\n\t\t\t\t\t$property->setImageLocation($row['image_location']);\n\t\t\t\t\t$property->setSuburbID($row['suburb_id']);\n\t\t\t\t\t$property->setMunicipalityID($row['municipality_id']);\n\t\t\t\t\t$property->setMunicipalityName($row['municipality_name']);\n\t\t\t\t\t$property->setCityID($row['city_id']);\n\t\t\t\t\t$properties[] = $property;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\treturn $properties;\n\t\t\t\t\n\t\t\t}catch(PDOException $e){\n\t\t\t\techo $e->getMessage();\n\t\t\t}\n\t\t}", "public function load() {\n\n\t\t\t// load the payload\n\t\t\t$payload = new \\Yapapaya\\DevOps\\WPD\\Payload( $this->config );\n\t\t\t$this->payload = $payload->setup();\n\n\t\t\t// map the payload with the configuration\n\t\t\t$map = new \\Yapapaya\\DevOps\\WPD\\Map();\n\t\t\t$map->init( $this->config, $this->payload );\n\t\t}", "public function properties()\n {\n return $this->hasMany('App\\Models\\Property');\n }", "public function testLoadMetadata()\n {\n $metadata = $this->driver->loadMetadataForClass(new \\ReflectionClass(Example::class));\n $this->assertInstanceOf(ClassMetadata::class, $metadata);\n $properties = $metadata->getPropertyMetadata();\n $this->assertArrayHasKey('fieldOne', $properties);\n $propertyOne = $properties['fieldOne'];\n\n $this->assertEquals('markdown', $propertyOne->getType());\n $this->assertEquals('title', $propertyOne->getRole());\n $this->assertEquals('group_one', $propertyOne->getGroup());\n $this->assertEquals([\n 'option_one' => 'Foobar',\n 'option_two' => 'Barfoo',\n 'option_three' => [\n 'sub_one' => 'One',\n 'sub_two' => 'Two',\n ],\n ], $propertyOne->getOptions()->getSharedOptions());\n\n $this->assertEquals([\n 'a' => 'A',\n 'b' => 'B',\n ], $propertyOne->getOptions()->getFormOptions());\n\n $this->assertEquals([\n 'c' => 'C',\n ], $propertyOne->getOptions()->getViewOptions());\n\n $this->assertEquals([\n 'd' => 'D',\n ], $propertyOne->getOptions()->getStorageOptions());\n\n $this->assertArrayHasKey('fieldTwo', $properties);\n }", "public function show(Promo $promo)\n {\n //\n }", "public function properties()\n {\n // Fetch all properties existing in the database\n $properties = Property::all();\n\n // return list of properties;\n return $properties;\n\n }", "public function loadSettings()\n {\n $this->loadJSON($this->settings);\n }", "public function userPromotion() {\n return $this->belongsTo(UserPromotion::class, 'promotion_id');\n }", "public function getById($id = null)\n {\n if ($id == null || $id == '') {\n throw new InvalidArgumentException('Promo tidak ditemukan');\n }\n $promo = $this->promo->find($id);\n if (!$promo) {\n throw new InvalidArgumentException('Promo tidak ditemukan');\n }\n return $promo;\n }", "public function load(ObjectManager $manager)\n {\n $propriete = new propriete(); \n $propriete->setDescription('Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut \n aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in.');\n $propriete->setNomPropriete(\"villa bonheur\");\n $propriete->setTypepropriete(\"Appartement\");\n \n $propriete2 = new propriete(); \n $propriete2->setDescription('Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut \n aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in.');\n $propriete2->setNomPropriete(\"villa\");\n $propriete2->setTypepropriete(\"Maison\");\n \n $propriete3 = new propriete(); \n $propriete3->setDescription('Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut \n aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in.');\n $propriete3->setNomPropriete(\"villa bonheur\");\n $propriete3->setTypepropriete(\"Villa\");\n \n $propriete4 = new propriete(); \n $propriete4->setDescription('Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut \n aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in.');\n $propriete4->setNomPropriete(\"villa\");\n $propriete4->setTypepropriete(\"Villa\");\n \n /*GESTION DES CLES */\n $propriete->setAdresse($this->getReference('user_adrPropriete'));\n $propriete->setProprietaire($this->getReference('loca_proprio'));\n \n $propriete2->setAdresse($this->getReference('user_adrPropriete2'));\n $propriete2->setProprietaire($this->getReference('loca_proprio2'));\n \n $propriete3->setAdresse($this->getReference('user_adrPropriete'));\n $propriete3->setProprietaire($this->getReference('loca_proprio'));\n \n $propriete4->setAdresse($this->getReference('user_adrPropriete'));\n $propriete4->setProprietaire($this->getReference('loca_proprio2'));\n \n $manager->persist($propriete);$manager->persist($propriete2);\n $manager->persist($propriete3);$manager->persist($propriete4);\n $manager->flush();\n \n $this->addReference('loca_propriete', $propriete);\n $this->addReference('loca_propriete2', $propriete2);\n $this->addReference('loca_propriete3', $propriete3);\n $this->addReference('loca_propriete4', $propriete4);\n }", "public function activarPantalla() {\n $pantallaActual=new Properties();\n $pantallaActual->load(file_get_contents(\"./pantallaActiva.properties\"));\n $pantallaActual->setProperty(\"Pantalla.activa\",4);\n file_put_contents('./pantallaActiva.properties', $pantallaActual->toString(true));\n\n\n // $this->pantalla_activa=$pantalla;\n }", "public function getSwartlandSimilarPropertyForSale(){\n\t\t\ttry{\n\t\t\t\t$query = \"SELECT properties.property_id, property_status, property_type, property_desc, price, num_bathrooms, \n\t\t\t\t\t\t street_no, street_name, num_beds, num_garages, property_image_id, image_location, suburbs.suburb_id, \n\t\t\t\t\t\t suburb_name, cities.city_id, city_name, municipalities.municipality_id, municipalities.municipality_name,\n\t\t\t\t\t\t agents.agent_id, firstname, lastname, email, phone, agencies.agency_id, agency_name, logo \n\t\t\t\t\t\t FROM property_images \n\t\t\t\t\t\t LEFT JOIN properties\n\t\t\t\t\t\t ON property_images.property_id = properties.property_id\n\t\t\t\t\t\t LEFT JOIN suburbs\n\t\t\t\t\t\t ON properties.suburb_id = suburbs.suburb_id\n\t\t\t\t\t\t LEFT JOIN cities\n\t\t\t\t\t\t ON suburbs.city_id = cities.city_id\n\t\t\t\t\t\t LEFT JOIN municipalities\n\t\t\t\t\t\t ON cities.municipality_id = municipalities.municipality_id\n\t\t\t\t\t\t LEFT JOIN agents\n\t\t\t\t\t\t ON properties.agent_id = agents.agent_id\n\t\t\t\t\t\t LEFT JOIN agencies\n\t\t\t\t\t\t ON agents.agency_id = agencies.agency_id\n\t\t\t\t\t\t WHERE municipalities.municipality_id = 120\n\t\t\t\t\t\t AND properties.property_status = 'For Sale'\n\t\t\t\t\t\t GROUP BY properties.property_id\n\t\t\t\t\t\t DESC\n\t\t\t\t\t\t LIMIT 3\n\t\t\t\t\t\t \";\n\t\t\t\t$result = $this->conn->query($query);\n\n\t\t\t $properties = array();\n\t\t\t\t\n\t\t\t\tforeach($result as $row){\n\t\t\t\t\t$agency = new Agency();\n\t\t\t\t\t$agency->setAgencyID($row['agency_id']);\n\t\t\t\t\t$agency->setAgencyName($row['agency_name']);\n\t\t\t\t\t$agency->setLogo($row['logo']);\n\t\t\t\t\t\n\t\t\t\t\t$agent = new Agent();\n\t\t\t\t\t$agent->setAgentID($row['agent_id']);\n\t\t\t\t\t$agent->setFirstname($row['firstname']);\n\t\t\t\t\t$agent->setLastname($row['lastname']);\n\t\t\t\t\t$agent->setEmail($row['email']);\n\t\t\t\t\t$agent->setPhone($row['phone']);\n\t\t\t\t\t$agent->setAgency($agency);\n\t\t\t\t\t\n\t\t\t\t\t$munucipality = new Municipality();\n\t\t\t\t\t$munucipality->setMunicipalityID($row['municipality_id']);\n\t\t\t\t\t$munucipality->setMunicipalityName($row['municipality_name']);\n\t\t\t\t\t\n\t\t\t\t\t$city = new City();\n\t\t\t\t\t$city->setCityID($row['city_id']);\n\t\t\t\t\t$city->setCityName($row['city_name']);\n\t\t\t\t\t$city->setMunicipality($munucipality);\n\t\t\t\t\t\n\t\t\t\t\t$suburb = new Suburb();\n\t\t\t\t\t$suburb->setSuburbID($row['suburb_id']);\n\t\t\t\t\t$suburb->setSuburbName($row['suburb_name']);\n\t\t\t\t\t$suburb->setCity($city);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t$property = new Property();\t\t\n\t\t\t\t\t$property->setPropertyID($row['property_id']);\t\t\t\n\t\t\t\t\t$property->setSuburb($suburb);\t\n\t\t\t\t\t$property->setAgent($agent);\n\t\t\t\t\t$property->setNumBathRoom($row['num_bathrooms']);\n\t\t\t\t\t$property->setNumBed($row['num_beds']);\n\t\t\t\t\t$property->setNumGarage($row['num_garages']);\t\n\t\t\t\t\t$property->setStreetNo($row['street_no']);\t\n\t\t\t\t\t$property->setStreetName($row['street_name']);\t\n\t\t\t\t\t$property->setPropertyDescription($row['property_desc']);\t\n\t\t\t\t\t$property->setPropertyType($row['property_type']);\t\t\n\t\t\t\t\t$property->setPrice($row['price']);\t\n\t\t\t\t\t$property->setImageLocation($row['image_location']);\n\t\t\t\t\t$property->setSuburbID($row['suburb_id']);\n\t\t\t\t\t$property->setMunicipalityID($row['municipality_id']);\n\t\t\t\t\t$property->setMunicipalityName($row['municipality_name']);\n\t\t\t\t\t$property->setCityID($row['city_id']);\n\t\t\t\t\t$properties[] = $property;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\treturn $properties;\n\t\t\t\t\n\t\t\t}catch(PDOException $e){\n\t\t\t\techo $e->getMessage();\n\t\t\t}\n\t\t}", "private function mapProperties(Collection $collection): void\n {\n // Create a properties array of this relationship\n $this->properties = Collect::keyBy($collection->getProperties()->getValues(), 'identifier');\n }", "public function show($id)\n {\n $property = Property::findOrFail($id);\n $property->agent = User::findOrFail($property->userId);\n\n\n $property->images = PropertyImage::where('propertyId', $property->id)->get();\n $inspectionTime = InspectionTime::where('propertyId', $property->id)->get();\n\n return view(\"Properties.show\")->with('user', $property)->with('inspectionTime', $inspectionTime);\n }", "public function properties()\n {\n $properties = Property::where('status_id',1)\n ->whereIn('user_id',[1, auth()->user() ? auth()->user()->id : 0])\n ->orderBy('user_id', \"desc\")->get();\n return view('front.properties', compact('properties'));\n }", "public function property() {\n return $this->belongsTo('App\\Property', 'property_id');\n }", "function getProperties($properties);", "protected function _fillAvailableProperties()\n {\n $properties = array(\n __(\"Special Properties\") => array(\n 0 => __(\"<Unmapped>\"),\n -1 => __(\"Tags\"),\n -2 => __(\"File\"),\n -3 => __(\"Item Type\"),\n -4 => __(\"Collection\"),\n -5 => __(\"Public\"),\n -6 => __(\"Featured\"),\n )\n );\n $elementSets = $this->_helper->db->getTable('ElementSet')->findAll();\n foreach ($elementSets as $elementSet)\n {\n $idNamePairs = array();\n $elementTexts = $elementSet->getElements();\n foreach ($elementTexts as $elementText)\n {\n $idNamePairs[$elementText->id] = $elementText->name;\n }\n $properties[$elementSet->name] = $idNamePairs;\n }\n $this->view->available_properties = $properties;\n }", "public function show(Property $property_id)\n {\n }", "public function getPrinceAlbertSimilarPropertyOnShow(){\n\t\t\ttry{\n\t\t\t\t$query = \"SELECT properties.property_id, property_type, property_desc, price, num_bathrooms, street_no, \n\t\t\t\t street_name, num_beds, num_garages, property_image_id, image_location, suburbs.suburb_id, \n\t\t\t\t\t\t suburb_name, cities.city_id, city_name, municipalities.municipality_id, municipalities.municipality_name,\n\t\t\t\t\t\t agents.agent_id, firstname, lastname, email, phone, agencies.agency_id, agency_name, logo \n\t\t\t\t\t\t FROM property_images \n\t\t\t\t\t\t LEFT JOIN properties\n\t\t\t\t\t\t ON property_images.property_id = properties.property_id\n\t\t\t\t\t\t LEFT JOIN suburbs\n\t\t\t\t\t\t ON properties.suburb_id = suburbs.suburb_id\n\t\t\t\t\t\t LEFT JOIN cities\n\t\t\t\t\t\t ON suburbs.city_id = cities.city_id\n\t\t\t\t\t\t LEFT JOIN municipalities\n\t\t\t\t\t\t ON cities.municipality_id = municipalities.municipality_id\n\t\t\t\t\t\t LEFT JOIN agents\n\t\t\t\t\t\t ON properties.agent_id = agents.agent_id\n\t\t\t\t\t\t LEFT JOIN agencies\n\t\t\t\t\t\t ON agents.agency_id = agencies.agency_id\n\t\t\t\t\t\t WHERE municipalities.municipality_id = 106\n\t\t\t\t\t\t AND properties.property_status = 'On Show'\n\t\t\t\t\t\t GROUP BY properties.property_id\n\t\t\t\t\t\t DESC\n\t\t\t\t\t\t LIMIT 3\n\t\t\t\t\t\t \";\n\t\t\t\t$result = $this->conn->query($query);\n\n\t\t\t $properties = array();\n\t\t\t\t\n\t\t\t\tforeach($result as $row){\n\t\t\t\t\t$agency = new Agency();\n\t\t\t\t\t$agency->setAgencyID($row['agency_id']);\n\t\t\t\t\t$agency->setAgencyName($row['agency_name']);\n\t\t\t\t\t$agency->setLogo($row['logo']);\n\t\t\t\t\t\n\t\t\t\t\t$agent = new Agent();\n\t\t\t\t\t$agent->setAgentID($row['agent_id']);\n\t\t\t\t\t$agent->setFirstname($row['firstname']);\n\t\t\t\t\t$agent->setLastname($row['lastname']);\n\t\t\t\t\t$agent->setEmail($row['email']);\n\t\t\t\t\t$agent->setPhone($row['phone']);\n\t\t\t\t\t$agent->setAgency($agency);\n\t\t\t\t\t\n\t\t\t\t\t$munucipality = new Municipality();\n\t\t\t\t\t$munucipality->setMunicipalityID($row['municipality_id']);\n\t\t\t\t\t$munucipality->setMunicipalityName($row['municipality_name']);\n\t\t\t\t\t\n\t\t\t\t\t$city = new City();\n\t\t\t\t\t$city->setCityID($row['city_id']);\n\t\t\t\t\t$city->setCityName($row['city_name']);\n\t\t\t\t\t$city->setMunicipality($munucipality);\n\t\t\t\t\t\n\t\t\t\t\t$suburb = new Suburb();\n\t\t\t\t\t$suburb->setSuburbID($row['suburb_id']);\n\t\t\t\t\t$suburb->setSuburbName($row['suburb_name']);\n\t\t\t\t\t$suburb->setCity($city);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t$property = new Property();\t\t\n\t\t\t\t\t$property->setPropertyID($row['property_id']);\t\t\t\n\t\t\t\t\t$property->setSuburb($suburb);\t\n\t\t\t\t\t$property->setAgent($agent);\n\t\t\t\t\t$property->setNumBathRoom($row['num_bathrooms']);\n\t\t\t\t\t$property->setNumBed($row['num_beds']);\n\t\t\t\t\t$property->setNumGarage($row['num_garages']);\t\n\t\t\t\t\t$property->setStreetNo($row['street_no']);\t\n\t\t\t\t\t$property->setStreetName($row['street_name']);\t\n\t\t\t\t\t$property->setPropertyDescription($row['property_desc']);\t\n\t\t\t\t\t$property->setPropertyType($row['property_type']);\t\t\n\t\t\t\t\t$property->setPrice($row['price']);\t\n\t\t\t\t\t$property->setImageLocation($row['image_location']);\n\t\t\t\t\t$property->setSuburbID($row['suburb_id']);\n\t\t\t\t\t$property->setMunicipalityID($row['municipality_id']);\n\t\t\t\t\t$property->setMunicipalityName($row['municipality_name']);\n\t\t\t\t\t$property->setCityID($row['city_id']);\n\t\t\t\t\t$properties[] = $property;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\treturn $properties;\n\t\t\t\t\n\t\t\t}catch(PDOException $e){\n\t\t\t\techo $e->getMessage();\n\t\t\t}\n\t\t}", "function load_variation_settings_fields( $variations ) {\n $variations['variation_popular_status'] = get_post_meta( $variations[ 'variation_id' ], '_variation_popular_status', true );\n $variations['variation_popular_title'] = get_post_meta( $variations[ 'variation_id' ], '_variation_popular_title', true ); \n return $variations;\n}", "public function property()\n {\n return $this->belongsTo('App\\Property', 'property_id');\n }", "public function getPropertyDetails(){\n $objectManager = \\Magento\\Framework\\App\\ObjectManager::getInstance ();\n return $objectManager->get ( 'Apptha\\Airhotels\\Model\\Attributes' );\n }", "public function getSwellendamSimilarPropertyForSale(){\n\t\t\ttry{\n\t\t\t\t$query = \"SELECT properties.property_id, property_status, property_type, property_desc, price, num_bathrooms, \n\t\t\t\t\t\t street_no, street_name, num_beds, num_garages, property_image_id, image_location, suburbs.suburb_id, \n\t\t\t\t\t\t suburb_name, cities.city_id, city_name, municipalities.municipality_id, municipalities.municipality_name,\n\t\t\t\t\t\t agents.agent_id, firstname, lastname, email, phone, agencies.agency_id, agency_name, logo \n\t\t\t\t\t\t FROM property_images \n\t\t\t\t\t\t LEFT JOIN properties\n\t\t\t\t\t\t ON property_images.property_id = properties.property_id\n\t\t\t\t\t\t LEFT JOIN suburbs\n\t\t\t\t\t\t ON properties.suburb_id = suburbs.suburb_id\n\t\t\t\t\t\t LEFT JOIN cities\n\t\t\t\t\t\t ON suburbs.city_id = cities.city_id\n\t\t\t\t\t\t LEFT JOIN municipalities\n\t\t\t\t\t\t ON cities.municipality_id = municipalities.municipality_id\n\t\t\t\t\t\t LEFT JOIN agents\n\t\t\t\t\t\t ON properties.agent_id = agents.agent_id\n\t\t\t\t\t\t LEFT JOIN agencies\n\t\t\t\t\t\t ON agents.agency_id = agencies.agency_id\n\t\t\t\t\t\t WHERE municipalities.municipality_id = 114\n\t\t\t\t\t\t AND properties.property_status = 'For Sale'\n\t\t\t\t\t\t GROUP BY properties.property_id\n\t\t\t\t\t\t DESC\n\t\t\t\t\t\t LIMIT 3\n\t\t\t\t\t\t \";\n\t\t\t\t$result = $this->conn->query($query);\n\n\t\t\t $properties = array();\n\t\t\t\t\n\t\t\t\tforeach($result as $row){\n\t\t\t\t\t$agency = new Agency();\n\t\t\t\t\t$agency->setAgencyID($row['agency_id']);\n\t\t\t\t\t$agency->setAgencyName($row['agency_name']);\n\t\t\t\t\t$agency->setLogo($row['logo']);\n\t\t\t\t\t\n\t\t\t\t\t$agent = new Agent();\n\t\t\t\t\t$agent->setAgentID($row['agent_id']);\n\t\t\t\t\t$agent->setFirstname($row['firstname']);\n\t\t\t\t\t$agent->setLastname($row['lastname']);\n\t\t\t\t\t$agent->setEmail($row['email']);\n\t\t\t\t\t$agent->setPhone($row['phone']);\n\t\t\t\t\t$agent->setAgency($agency);\n\t\t\t\t\t\n\t\t\t\t\t$munucipality = new Municipality();\n\t\t\t\t\t$munucipality->setMunicipalityID($row['municipality_id']);\n\t\t\t\t\t$munucipality->setMunicipalityName($row['municipality_name']);\n\t\t\t\t\t\n\t\t\t\t\t$city = new City();\n\t\t\t\t\t$city->setCityID($row['city_id']);\n\t\t\t\t\t$city->setCityName($row['city_name']);\n\t\t\t\t\t$city->setMunicipality($munucipality);\n\t\t\t\t\t\n\t\t\t\t\t$suburb = new Suburb();\n\t\t\t\t\t$suburb->setSuburbID($row['suburb_id']);\n\t\t\t\t\t$suburb->setSuburbName($row['suburb_name']);\n\t\t\t\t\t$suburb->setCity($city);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t$property = new Property();\t\t\n\t\t\t\t\t$property->setPropertyID($row['property_id']);\t\t\t\n\t\t\t\t\t$property->setSuburb($suburb);\t\n\t\t\t\t\t$property->setAgent($agent);\n\t\t\t\t\t$property->setNumBathRoom($row['num_bathrooms']);\n\t\t\t\t\t$property->setNumBed($row['num_beds']);\n\t\t\t\t\t$property->setNumGarage($row['num_garages']);\t\n\t\t\t\t\t$property->setStreetNo($row['street_no']);\t\n\t\t\t\t\t$property->setStreetName($row['street_name']);\t\n\t\t\t\t\t$property->setPropertyDescription($row['property_desc']);\t\n\t\t\t\t\t$property->setPropertyType($row['property_type']);\t\t\n\t\t\t\t\t$property->setPrice($row['price']);\t\n\t\t\t\t\t$property->setImageLocation($row['image_location']);\n\t\t\t\t\t$property->setSuburbID($row['suburb_id']);\n\t\t\t\t\t$property->setMunicipalityID($row['municipality_id']);\n\t\t\t\t\t$property->setMunicipalityName($row['municipality_name']);\n\t\t\t\t\t$property->setCityID($row['city_id']);\n\t\t\t\t\t$properties[] = $property;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\treturn $properties;\n\t\t\t\t\n\t\t\t}catch(PDOException $e){\n\t\t\t\techo $e->getMessage();\n\t\t\t}\n\t\t}", "public function getPrinceAlbertSimilarPropertyForSale(){\n\t\t\ttry{\n\t\t\t\t$query = \"SELECT properties.property_id, property_status, property_type, property_desc, price, num_bathrooms, \n\t\t\t\t\t\t street_no, street_name, num_beds, num_garages, property_image_id, image_location, suburbs.suburb_id, \n\t\t\t\t\t\t suburb_name, cities.city_id, city_name, municipalities.municipality_id, municipalities.municipality_name,\n\t\t\t\t\t\t agents.agent_id, firstname, lastname, email, phone, agencies.agency_id, agency_name, logo \n\t\t\t\t\t\t FROM property_images \n\t\t\t\t\t\t LEFT JOIN properties\n\t\t\t\t\t\t ON property_images.property_id = properties.property_id\n\t\t\t\t\t\t LEFT JOIN suburbs\n\t\t\t\t\t\t ON properties.suburb_id = suburbs.suburb_id\n\t\t\t\t\t\t LEFT JOIN cities\n\t\t\t\t\t\t ON suburbs.city_id = cities.city_id\n\t\t\t\t\t\t LEFT JOIN municipalities\n\t\t\t\t\t\t ON cities.municipality_id = municipalities.municipality_id\n\t\t\t\t\t\t LEFT JOIN agents\n\t\t\t\t\t\t ON properties.agent_id = agents.agent_id\n\t\t\t\t\t\t LEFT JOIN agencies\n\t\t\t\t\t\t ON agents.agency_id = agencies.agency_id\n\t\t\t\t\t\t WHERE municipalities.municipality_id = 106\n\t\t\t\t\t\t AND properties.property_status = 'For Sale'\n\t\t\t\t\t\t GROUP BY properties.property_id\n\t\t\t\t\t\t DESC\n\t\t\t\t\t\t LIMIT 3\n\t\t\t\t\t\t \";\n\t\t\t\t$result = $this->conn->query($query);\n\n\t\t\t $properties = array();\n\t\t\t\t\n\t\t\t\tforeach($result as $row){\n\t\t\t\t\t$agency = new Agency();\n\t\t\t\t\t$agency->setAgencyID($row['agency_id']);\n\t\t\t\t\t$agency->setAgencyName($row['agency_name']);\n\t\t\t\t\t$agency->setLogo($row['logo']);\n\t\t\t\t\t\n\t\t\t\t\t$agent = new Agent();\n\t\t\t\t\t$agent->setAgentID($row['agent_id']);\n\t\t\t\t\t$agent->setFirstname($row['firstname']);\n\t\t\t\t\t$agent->setLastname($row['lastname']);\n\t\t\t\t\t$agent->setEmail($row['email']);\n\t\t\t\t\t$agent->setPhone($row['phone']);\n\t\t\t\t\t$agent->setAgency($agency);\n\t\t\t\t\t\n\t\t\t\t\t$munucipality = new Municipality();\n\t\t\t\t\t$munucipality->setMunicipalityID($row['municipality_id']);\n\t\t\t\t\t$munucipality->setMunicipalityName($row['municipality_name']);\n\t\t\t\t\t\n\t\t\t\t\t$city = new City();\n\t\t\t\t\t$city->setCityID($row['city_id']);\n\t\t\t\t\t$city->setCityName($row['city_name']);\n\t\t\t\t\t$city->setMunicipality($munucipality);\n\t\t\t\t\t\n\t\t\t\t\t$suburb = new Suburb();\n\t\t\t\t\t$suburb->setSuburbID($row['suburb_id']);\n\t\t\t\t\t$suburb->setSuburbName($row['suburb_name']);\n\t\t\t\t\t$suburb->setCity($city);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t$property = new Property();\t\t\n\t\t\t\t\t$property->setPropertyID($row['property_id']);\t\t\t\n\t\t\t\t\t$property->setSuburb($suburb);\t\n\t\t\t\t\t$property->setAgent($agent);\n\t\t\t\t\t$property->setNumBathRoom($row['num_bathrooms']);\n\t\t\t\t\t$property->setNumBed($row['num_beds']);\n\t\t\t\t\t$property->setNumGarage($row['num_garages']);\t\n\t\t\t\t\t$property->setStreetNo($row['street_no']);\t\n\t\t\t\t\t$property->setStreetName($row['street_name']);\t\n\t\t\t\t\t$property->setPropertyDescription($row['property_desc']);\t\n\t\t\t\t\t$property->setPropertyType($row['property_type']);\t\t\n\t\t\t\t\t$property->setPrice($row['price']);\t\n\t\t\t\t\t$property->setImageLocation($row['image_location']);\n\t\t\t\t\t$property->setSuburbID($row['suburb_id']);\n\t\t\t\t\t$property->setMunicipalityID($row['municipality_id']);\n\t\t\t\t\t$property->setMunicipalityName($row['municipality_name']);\n\t\t\t\t\t$property->setCityID($row['city_id']);\n\t\t\t\t\t$properties[] = $property;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\treturn $properties;\n\t\t\t\t\n\t\t\t}catch(PDOException $e){\n\t\t\t\techo $e->getMessage();\n\t\t\t}\n\t\t}", "public function getCapeAgulhasSimilarPropertyOnShow(){\n\t\t\ttry{\n\t\t\t\t$query = \"SELECT properties.property_id, property_type, property_desc, price, num_bathrooms, street_no, \n\t\t\t\t street_name, num_beds, num_garages, property_image_id, image_location, suburbs.suburb_id, \n\t\t\t\t\t\t suburb_name, cities.city_id, city_name, municipalities.municipality_id, municipalities.municipality_name,\n\t\t\t\t\t\t agents.agent_id, firstname, lastname, email, phone, agencies.agency_id, agency_name, logo \n\t\t\t\t\t\t FROM property_images \n\t\t\t\t\t\t LEFT JOIN properties\n\t\t\t\t\t\t ON property_images.property_id = properties.property_id\n\t\t\t\t\t\t LEFT JOIN suburbs\n\t\t\t\t\t\t ON properties.suburb_id = suburbs.suburb_id\n\t\t\t\t\t\t LEFT JOIN cities\n\t\t\t\t\t\t ON suburbs.city_id = cities.city_id\n\t\t\t\t\t\t LEFT JOIN municipalities\n\t\t\t\t\t\t ON cities.municipality_id = municipalities.municipality_id\n\t\t\t\t\t\t LEFT JOIN agents\n\t\t\t\t\t\t ON properties.agent_id = agents.agent_id\n\t\t\t\t\t\t LEFT JOIN agencies\n\t\t\t\t\t\t ON agents.agency_id = agencies.agency_id\n\t\t\t\t\t\t WHERE municipalities.municipality_id = 112\n\t\t\t\t\t\t AND properties.property_status = 'On Show'\n\t\t\t\t\t\t GROUP BY properties.property_id\n\t\t\t\t\t\t DESC\n\t\t\t\t\t\t LIMIT 3\n\t\t\t\t\t\t \";\n\t\t\t\t$result = $this->conn->query($query);\n\n\t\t\t $properties = array();\n\t\t\t\t\n\t\t\t\tforeach($result as $row){\n\t\t\t\t\t$agency = new Agency();\n\t\t\t\t\t$agency->setAgencyID($row['agency_id']);\n\t\t\t\t\t$agency->setAgencyName($row['agency_name']);\n\t\t\t\t\t$agency->setLogo($row['logo']);\n\t\t\t\t\t\n\t\t\t\t\t$agent = new Agent();\n\t\t\t\t\t$agent->setAgentID($row['agent_id']);\n\t\t\t\t\t$agent->setFirstname($row['firstname']);\n\t\t\t\t\t$agent->setLastname($row['lastname']);\n\t\t\t\t\t$agent->setEmail($row['email']);\n\t\t\t\t\t$agent->setPhone($row['phone']);\n\t\t\t\t\t$agent->setAgency($agency);\n\t\t\t\t\t\n\t\t\t\t\t$munucipality = new Municipality();\n\t\t\t\t\t$munucipality->setMunicipalityID($row['municipality_id']);\n\t\t\t\t\t$munucipality->setMunicipalityName($row['municipality_name']);\n\t\t\t\t\t\n\t\t\t\t\t$city = new City();\n\t\t\t\t\t$city->setCityID($row['city_id']);\n\t\t\t\t\t$city->setCityName($row['city_name']);\n\t\t\t\t\t$city->setMunicipality($munucipality);\n\t\t\t\t\t\n\t\t\t\t\t$suburb = new Suburb();\n\t\t\t\t\t$suburb->setSuburbID($row['suburb_id']);\n\t\t\t\t\t$suburb->setSuburbName($row['suburb_name']);\n\t\t\t\t\t$suburb->setCity($city);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t$property = new Property();\t\t\n\t\t\t\t\t$property->setPropertyID($row['property_id']);\t\t\t\n\t\t\t\t\t$property->setSuburb($suburb);\t\n\t\t\t\t\t$property->setAgent($agent);\n\t\t\t\t\t$property->setNumBathRoom($row['num_bathrooms']);\n\t\t\t\t\t$property->setNumBed($row['num_beds']);\n\t\t\t\t\t$property->setNumGarage($row['num_garages']);\t\n\t\t\t\t\t$property->setStreetNo($row['street_no']);\t\n\t\t\t\t\t$property->setStreetName($row['street_name']);\t\n\t\t\t\t\t$property->setPropertyDescription($row['property_desc']);\t\n\t\t\t\t\t$property->setPropertyType($row['property_type']);\t\t\n\t\t\t\t\t$property->setPrice($row['price']);\t\n\t\t\t\t\t$property->setImageLocation($row['image_location']);\n\t\t\t\t\t$property->setSuburbID($row['suburb_id']);\n\t\t\t\t\t$property->setMunicipalityID($row['municipality_id']);\n\t\t\t\t\t$property->setMunicipalityName($row['municipality_name']);\n\t\t\t\t\t$property->setCityID($row['city_id']);\n\t\t\t\t\t$properties[] = $property;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\treturn $properties;\n\t\t\t\t\n\t\t\t}catch(PDOException $e){\n\t\t\t\techo $e->getMessage();\n\t\t\t}\n\t\t}", "public function load() { }", "public function load($id) {\n \tglobal $DB;\n\n \tparent::load($id);\n\n \t$productVariations = $DB->get_records(\n \t\t'local_moodec_variation', \n \t\tarray(\n \t\t\t'product_id' => $id,\n\t\t\t)\n\t\t);\n\n \tif(!!$productVariations) {\n\t \tforeach ($productVariations as $pv) {\n\t \t\t$variationid = (int) $pv->id;\n\t \t\t$this->_variations[$variationid] = new MoodecProductVariation($variationid, true);\n\t \t}\n\t } else {\n \tthrow new Exception('Unable to load product variation information using identifier: ' . $id);\n \t\t}\n }", "public function promotions()\n {\n return $this->hasMany(Promotion::class);\n }", "public function managedProperties(){\n\n /*$manager =Auth::user()->whereHas('roles', function ($query) {\n $query->where('id',1);\n })->firstOrFail();*/\n\n $manager= Auth::user();\n //dd($manager);\n\n $managedProperties = Property::whereHas('information', function ($query) use ($manager){\n $query->where('manager_id',$manager->id)->where('isApprovedManager',1);\n })->verified()->latest()->paginate(10);\n\n $title = \"My Managed Properties\";\n\n return view('frontend.pages.view-property.managed-property.index',compact('title'))->with('properties',$managedProperties);\n }", "public function getHessequaSimilarPropertyOnShow(){\n\t\t\ttry{\n\t\t\t\t$query = \"SELECT properties.property_id, property_type, property_desc, price, num_bathrooms, street_no, \n\t\t\t\t street_name, num_beds, num_garages, property_image_id, image_location, suburbs.suburb_id, \n\t\t\t\t\t\t suburb_name, cities.city_id, city_name, municipalities.municipality_id, municipalities.municipality_name,\n\t\t\t\t\t\t agents.agent_id, firstname, lastname, email, phone, agencies.agency_id, agency_name, logo \n\t\t\t\t\t\t FROM property_images \n\t\t\t\t\t\t LEFT JOIN properties\n\t\t\t\t\t\t ON property_images.property_id = properties.property_id\n\t\t\t\t\t\t LEFT JOIN suburbs\n\t\t\t\t\t\t ON properties.suburb_id = suburbs.suburb_id\n\t\t\t\t\t\t LEFT JOIN cities\n\t\t\t\t\t\t ON suburbs.city_id = cities.city_id\n\t\t\t\t\t\t LEFT JOIN municipalities\n\t\t\t\t\t\t ON cities.municipality_id = municipalities.municipality_id\n\t\t\t\t\t\t LEFT JOIN agents\n\t\t\t\t\t\t ON properties.agent_id = agents.agent_id\n\t\t\t\t\t\t LEFT JOIN agencies\n\t\t\t\t\t\t ON agents.agency_id = agencies.agency_id\n\t\t\t\t\t\t WHERE municipalities.municipality_id = 109\n\t\t\t\t\t\t AND properties.property_status = 'On Show'\n\t\t\t\t\t\t GROUP BY properties.property_id\n\t\t\t\t\t\t DESC\n\t\t\t\t\t\t LIMIT 3\n\t\t\t\t\t\t \";\n\t\t\t\t$result = $this->conn->query($query);\n\n\t\t\t $properties = array();\n\t\t\t\t\n\t\t\t\tforeach($result as $row){\n\t\t\t\t\t$agency = new Agency();\n\t\t\t\t\t$agency->setAgencyID($row['agency_id']);\n\t\t\t\t\t$agency->setAgencyName($row['agency_name']);\n\t\t\t\t\t$agency->setLogo($row['logo']);\n\t\t\t\t\t\n\t\t\t\t\t$agent = new Agent();\n\t\t\t\t\t$agent->setAgentID($row['agent_id']);\n\t\t\t\t\t$agent->setFirstname($row['firstname']);\n\t\t\t\t\t$agent->setLastname($row['lastname']);\n\t\t\t\t\t$agent->setEmail($row['email']);\n\t\t\t\t\t$agent->setPhone($row['phone']);\n\t\t\t\t\t$agent->setAgency($agency);\n\t\t\t\t\t\n\t\t\t\t\t$munucipality = new Municipality();\n\t\t\t\t\t$munucipality->setMunicipalityID($row['municipality_id']);\n\t\t\t\t\t$munucipality->setMunicipalityName($row['municipality_name']);\n\t\t\t\t\t\n\t\t\t\t\t$city = new City();\n\t\t\t\t\t$city->setCityID($row['city_id']);\n\t\t\t\t\t$city->setCityName($row['city_name']);\n\t\t\t\t\t$city->setMunicipality($munucipality);\n\t\t\t\t\t\n\t\t\t\t\t$suburb = new Suburb();\n\t\t\t\t\t$suburb->setSuburbID($row['suburb_id']);\n\t\t\t\t\t$suburb->setSuburbName($row['suburb_name']);\n\t\t\t\t\t$suburb->setCity($city);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t$property = new Property();\t\t\n\t\t\t\t\t$property->setPropertyID($row['property_id']);\t\t\t\n\t\t\t\t\t$property->setSuburb($suburb);\t\n\t\t\t\t\t$property->setAgent($agent);\n\t\t\t\t\t$property->setNumBathRoom($row['num_bathrooms']);\n\t\t\t\t\t$property->setNumBed($row['num_beds']);\n\t\t\t\t\t$property->setNumGarage($row['num_garages']);\t\n\t\t\t\t\t$property->setStreetNo($row['street_no']);\t\n\t\t\t\t\t$property->setStreetName($row['street_name']);\t\n\t\t\t\t\t$property->setPropertyDescription($row['property_desc']);\t\n\t\t\t\t\t$property->setPropertyType($row['property_type']);\t\t\n\t\t\t\t\t$property->setPrice($row['price']);\t\n\t\t\t\t\t$property->setImageLocation($row['image_location']);\n\t\t\t\t\t$property->setSuburbID($row['suburb_id']);\n\t\t\t\t\t$property->setMunicipalityID($row['municipality_id']);\n\t\t\t\t\t$property->setMunicipalityName($row['municipality_name']);\n\t\t\t\t\t$property->setCityID($row['city_id']);\n\t\t\t\t\t$properties[] = $property;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\treturn $properties;\n\t\t\t\t\n\t\t\t}catch(PDOException $e){\n\t\t\t\techo $e->getMessage();\n\t\t\t}\n\t\t}", "public function getOudtshoornSimilarPropertyForSale(){\n\t\t\ttry{\n\t\t\t\t$query = \"SELECT properties.property_id, property_status, property_type, property_desc, price, num_bathrooms, \n\t\t\t\t\t\t street_no, street_name, num_beds, num_garages, property_image_id, image_location, suburbs.suburb_id, \n\t\t\t\t\t\t suburb_name, cities.city_id, city_name, municipalities.municipality_id, municipalities.municipality_name,\n\t\t\t\t\t\t agents.agent_id, firstname, lastname, email, phone, agencies.agency_id, agency_name, logo \n\t\t\t\t\t\t FROM property_images \n\t\t\t\t\t\t LEFT JOIN properties\n\t\t\t\t\t\t ON property_images.property_id = properties.property_id\n\t\t\t\t\t\t LEFT JOIN suburbs\n\t\t\t\t\t\t ON properties.suburb_id = suburbs.suburb_id\n\t\t\t\t\t\t LEFT JOIN cities\n\t\t\t\t\t\t ON suburbs.city_id = cities.city_id\n\t\t\t\t\t\t LEFT JOIN municipalities\n\t\t\t\t\t\t ON cities.municipality_id = municipalities.municipality_id\n\t\t\t\t\t\t LEFT JOIN agents\n\t\t\t\t\t\t ON properties.agent_id = agents.agent_id\n\t\t\t\t\t\t LEFT JOIN agencies\n\t\t\t\t\t\t ON agents.agency_id = agencies.agency_id\n\t\t\t\t\t\t WHERE municipalities.municipality_id = 102\n\t\t\t\t\t\t AND properties.property_status = 'For Sale'\n\t\t\t\t\t\t GROUP BY properties.property_id\n\t\t\t\t\t\t DESC\n\t\t\t\t\t\t LIMIT 3\n\t\t\t\t\t\t \";\n\t\t\t\t$result = $this->conn->query($query);\n\n\t\t\t $properties = array();\n\t\t\t\t\n\t\t\t\tforeach($result as $row){\n\t\t\t\t\t$agency = new Agency();\n\t\t\t\t\t$agency->setAgencyID($row['agency_id']);\n\t\t\t\t\t$agency->setAgencyName($row['agency_name']);\n\t\t\t\t\t$agency->setLogo($row['logo']);\n\t\t\t\t\t\n\t\t\t\t\t$agent = new Agent();\n\t\t\t\t\t$agent->setAgentID($row['agent_id']);\n\t\t\t\t\t$agent->setFirstname($row['firstname']);\n\t\t\t\t\t$agent->setLastname($row['lastname']);\n\t\t\t\t\t$agent->setEmail($row['email']);\n\t\t\t\t\t$agent->setPhone($row['phone']);\n\t\t\t\t\t$agent->setAgency($agency);\n\t\t\t\t\t\n\t\t\t\t\t$munucipality = new Municipality();\n\t\t\t\t\t$munucipality->setMunicipalityID($row['municipality_id']);\n\t\t\t\t\t$munucipality->setMunicipalityName($row['municipality_name']);\n\t\t\t\t\t\n\t\t\t\t\t$city = new City();\n\t\t\t\t\t$city->setCityID($row['city_id']);\n\t\t\t\t\t$city->setCityName($row['city_name']);\n\t\t\t\t\t$city->setMunicipality($munucipality);\n\t\t\t\t\t\n\t\t\t\t\t$suburb = new Suburb();\n\t\t\t\t\t$suburb->setSuburbID($row['suburb_id']);\n\t\t\t\t\t$suburb->setSuburbName($row['suburb_name']);\n\t\t\t\t\t$suburb->setCity($city);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t$property = new Property();\t\t\n\t\t\t\t\t$property->setPropertyID($row['property_id']);\t\t\t\n\t\t\t\t\t$property->setSuburb($suburb);\t\n\t\t\t\t\t$property->setAgent($agent);\n\t\t\t\t\t$property->setNumBathRoom($row['num_bathrooms']);\n\t\t\t\t\t$property->setNumBed($row['num_beds']);\n\t\t\t\t\t$property->setNumGarage($row['num_garages']);\t\n\t\t\t\t\t$property->setStreetNo($row['street_no']);\t\n\t\t\t\t\t$property->setStreetName($row['street_name']);\t\n\t\t\t\t\t$property->setPropertyDescription($row['property_desc']);\t\n\t\t\t\t\t$property->setPropertyType($row['property_type']);\t\t\n\t\t\t\t\t$property->setPrice($row['price']);\t\n\t\t\t\t\t$property->setImageLocation($row['image_location']);\n\t\t\t\t\t$property->setSuburbID($row['suburb_id']);\n\t\t\t\t\t$property->setMunicipalityID($row['municipality_id']);\n\t\t\t\t\t$property->setMunicipalityName($row['municipality_name']);\n\t\t\t\t\t$property->setCityID($row['city_id']);\n\t\t\t\t\t$properties[] = $property;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\treturn $properties;\n\t\t\t\t\n\t\t\t}catch(PDOException $e){\n\t\t\t\techo $e->getMessage();\n\t\t\t}\n\t\t}", "public function setPromotion(PromotionInterface $promotion)\n {\n $this->promotion = $promotion;\n }", "public function getOudtshoornWestSimilarPropertyOnShow(){\n\t\t\ttry{\n\t\t\t\t$query = \"SELECT properties.property_id, property_type, property_desc, price, num_bathrooms, street_no, \n\t\t\t\t street_name, num_beds, num_garages, property_image_id, image_location, suburbs.suburb_id, \n\t\t\t\t\t\t suburb_name, cities.city_id, city_name, municipalities.municipality_id, municipalities.municipality_name,\n\t\t\t\t\t\t agents.agent_id, firstname, lastname, email, phone, agencies.agency_id, agency_name, logo \n\t\t\t\t\t\t FROM property_images \n\t\t\t\t\t\t LEFT JOIN properties\n\t\t\t\t\t\t ON property_images.property_id = properties.property_id\n\t\t\t\t\t\t LEFT JOIN suburbs\n\t\t\t\t\t\t ON properties.suburb_id = suburbs.suburb_id\n\t\t\t\t\t\t LEFT JOIN cities\n\t\t\t\t\t\t ON suburbs.city_id = cities.city_id\n\t\t\t\t\t\t LEFT JOIN municipalities\n\t\t\t\t\t\t ON cities.municipality_id = municipalities.municipality_id\n\t\t\t\t\t\t LEFT JOIN agents\n\t\t\t\t\t\t ON properties.agent_id = agents.agent_id\n\t\t\t\t\t\t LEFT JOIN agencies\n\t\t\t\t\t\t ON agents.agency_id = agencies.agency_id\n\t\t\t\t\t\t WHERE municipalities.municipality_id = 102\n\t\t\t\t\t\t AND properties.property_status = 'On Show'\n\t\t\t\t\t\t GROUP BY properties.property_id\n\t\t\t\t\t\t DESC\n\t\t\t\t\t\t LIMIT 3\n\t\t\t\t\t\t \";\n\t\t\t\t$result = $this->conn->query($query);\n\n\t\t\t $properties = array();\n\t\t\t\t\n\t\t\t\tforeach($result as $row){\n\t\t\t\t\t$agency = new Agency();\n\t\t\t\t\t$agency->setAgencyID($row['agency_id']);\n\t\t\t\t\t$agency->setAgencyName($row['agency_name']);\n\t\t\t\t\t$agency->setLogo($row['logo']);\n\t\t\t\t\t\n\t\t\t\t\t$agent = new Agent();\n\t\t\t\t\t$agent->setAgentID($row['agent_id']);\n\t\t\t\t\t$agent->setFirstname($row['firstname']);\n\t\t\t\t\t$agent->setLastname($row['lastname']);\n\t\t\t\t\t$agent->setEmail($row['email']);\n\t\t\t\t\t$agent->setPhone($row['phone']);\n\t\t\t\t\t$agent->setAgency($agency);\n\t\t\t\t\t\n\t\t\t\t\t$munucipality = new Municipality();\n\t\t\t\t\t$munucipality->setMunicipalityID($row['municipality_id']);\n\t\t\t\t\t$munucipality->setMunicipalityName($row['municipality_name']);\n\t\t\t\t\t\n\t\t\t\t\t$city = new City();\n\t\t\t\t\t$city->setCityID($row['city_id']);\n\t\t\t\t\t$city->setCityName($row['city_name']);\n\t\t\t\t\t$city->setMunicipality($munucipality);\n\t\t\t\t\t\n\t\t\t\t\t$suburb = new Suburb();\n\t\t\t\t\t$suburb->setSuburbID($row['suburb_id']);\n\t\t\t\t\t$suburb->setSuburbName($row['suburb_name']);\n\t\t\t\t\t$suburb->setCity($city);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t$property = new Property();\t\t\n\t\t\t\t\t$property->setPropertyID($row['property_id']);\t\t\t\n\t\t\t\t\t$property->setSuburb($suburb);\t\n\t\t\t\t\t$property->setAgent($agent);\n\t\t\t\t\t$property->setNumBathRoom($row['num_bathrooms']);\n\t\t\t\t\t$property->setNumBed($row['num_beds']);\n\t\t\t\t\t$property->setNumGarage($row['num_garages']);\t\n\t\t\t\t\t$property->setStreetNo($row['street_no']);\t\n\t\t\t\t\t$property->setStreetName($row['street_name']);\t\n\t\t\t\t\t$property->setPropertyDescription($row['property_desc']);\t\n\t\t\t\t\t$property->setPropertyType($row['property_type']);\t\t\n\t\t\t\t\t$property->setPrice($row['price']);\t\n\t\t\t\t\t$property->setImageLocation($row['image_location']);\n\t\t\t\t\t$property->setSuburbID($row['suburb_id']);\n\t\t\t\t\t$property->setMunicipalityID($row['municipality_id']);\n\t\t\t\t\t$property->setMunicipalityName($row['municipality_name']);\n\t\t\t\t\t$property->setCityID($row['city_id']);\n\t\t\t\t\t$properties[] = $property;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\treturn $properties;\n\t\t\t\t\n\t\t\t}catch(PDOException $e){\n\t\t\t\techo $e->getMessage();\n\t\t\t}\n\t\t}", "function &getProperties() {\r\n\t\t// Load the data\r\n\t\tif (empty ($this->_properties)) {\r\n\r\n\t\t\t$database \t=& $this->_db;\r\n\t\t\t$ce \t\t=& $this->_content_element;\r\n\t\t\t$ref_table \t= $ce->table;\r\n\t\t\t$content_id = $this->_id;\r\n\r\n\t\t\t$database = $this->_db;\r\n\t\t\t$ce = $this->_content_element;\r\n\t\t\t// retrieve values\r\n\t\t\t// $selstr[] \t= \"c.id \";\r\n $selstr[] = \"c.\".$ce->id;\r\n\t\t\t$fromstr[] \t= \"#__$ref_table AS c\";\r\n\t\t\t$wherestr\t= \"c.\".$ce->id .\" = '\" . $this->_id . \"'\";\r\n\r\n\t\t\tif($ce->sec_table){\r\n\t\t\t\t$selstr[] \t\t= \"sec.\".$ce->sec_table_id.\" AS secid \";\r\n\t\t\t\t$selstr[] \t\t= \"sec.\".$ce->sec_table_title.\" AS section\";\r\n\t\t\t\t$fromstr[] \t\t= \"LEFT JOIN #__\".$ce->sec_table.\" AS sec ON(c.\".$ce->sectionid.\" = sec.\".$ce->sec_table_id.\") \";\r\n\t\t\t}\r\n\r\n\t\t\tif($ce->cat_table){\r\n\t\t\t\t$selstr[] \t\t= \"cat.\".$ce->cat_table_id.\" AS catid \";\r\n\t\t\t\t$selstr[] \t\t= \"cat.\".$ce->cat_table_title.\" AS category\";\r\n\t\t\t\t$fromstr[] \t\t= \"LEFT JOIN #__\".$ce->cat_table.\" AS cat ON(c.\".$ce->catid.\" = cat.\".$ce->cat_table_id.\") \";\r\n\t\t\t}\r\n\r\n\r\n\r\n\t\t\t$query = \"SELECT \" .implode( ',', $selstr). \" FROM \" . implode(' ', $fromstr). \" WHERE $wherestr \";\r\n\t\t\t$database->setQuery($query);\r\n\t\t\t$row = $database->loadObject();\r\n\r\n\t\t\t$properties = \tarray (\t'section' \t=> $row->section,\r\n\t\t\t \t\t\t\t\t\t'category' \t=> $row->category,\r\n\t\t\t \t\t\t\t\t\t'content_element' => $ce->label\r\n\t\t\t \t\t\t\t\t\t);\r\n\t\t\t$this->_properties = $properties;\r\n\t\t}\r\n\t\treturn $this->_properties;\r\n\t}", "public function property()\n {\n return $this->belongsTo('App\\Models\\Property\\Property');\n }", "public function getLaingsburgSimilarPropertyOnShow(){\n\t\t\ttry{\n\t\t\t\t$query = \"SELECT properties.property_id, property_type, property_desc, price, num_bathrooms, street_no, \n\t\t\t\t street_name, num_beds, num_garages, property_image_id, image_location, suburbs.suburb_id, \n\t\t\t\t\t\t suburb_name, cities.city_id, city_name, municipalities.municipality_id, municipalities.municipality_name,\n\t\t\t\t\t\t agents.agent_id, firstname, lastname, email, phone, agencies.agency_id, agency_name, logo \n\t\t\t\t\t\t FROM property_images \n\t\t\t\t\t\t LEFT JOIN properties\n\t\t\t\t\t\t ON property_images.property_id = properties.property_id\n\t\t\t\t\t\t LEFT JOIN suburbs\n\t\t\t\t\t\t ON properties.suburb_id = suburbs.suburb_id\n\t\t\t\t\t\t LEFT JOIN cities\n\t\t\t\t\t\t ON suburbs.city_id = cities.city_id\n\t\t\t\t\t\t LEFT JOIN municipalities\n\t\t\t\t\t\t ON cities.municipality_id = municipalities.municipality_id\n\t\t\t\t\t\t LEFT JOIN agents\n\t\t\t\t\t\t ON properties.agent_id = agents.agent_id\n\t\t\t\t\t\t LEFT JOIN agencies\n\t\t\t\t\t\t ON agents.agency_id = agencies.agency_id\n\t\t\t\t\t\t WHERE municipalities.municipality_id = 105\n\t\t\t\t\t\t AND properties.property_status = 'On Show'\n\t\t\t\t\t\t GROUP BY properties.property_id\n\t\t\t\t\t\t DESC\n\t\t\t\t\t\t LIMIT 3\n\t\t\t\t\t\t \";\n\t\t\t\t$result = $this->conn->query($query);\n\n\t\t\t $properties = array();\n\t\t\t\t\n\t\t\t\tforeach($result as $row){\n\t\t\t\t\t$agency = new Agency();\n\t\t\t\t\t$agency->setAgencyID($row['agency_id']);\n\t\t\t\t\t$agency->setAgencyName($row['agency_name']);\n\t\t\t\t\t$agency->setLogo($row['logo']);\n\t\t\t\t\t\n\t\t\t\t\t$agent = new Agent();\n\t\t\t\t\t$agent->setAgentID($row['agent_id']);\n\t\t\t\t\t$agent->setFirstname($row['firstname']);\n\t\t\t\t\t$agent->setLastname($row['lastname']);\n\t\t\t\t\t$agent->setEmail($row['email']);\n\t\t\t\t\t$agent->setPhone($row['phone']);\n\t\t\t\t\t$agent->setAgency($agency);\n\t\t\t\t\t\n\t\t\t\t\t$munucipality = new Municipality();\n\t\t\t\t\t$munucipality->setMunicipalityID($row['municipality_id']);\n\t\t\t\t\t$munucipality->setMunicipalityName($row['municipality_name']);\n\t\t\t\t\t\n\t\t\t\t\t$city = new City();\n\t\t\t\t\t$city->setCityID($row['city_id']);\n\t\t\t\t\t$city->setCityName($row['city_name']);\n\t\t\t\t\t$city->setMunicipality($munucipality);\n\t\t\t\t\t\n\t\t\t\t\t$suburb = new Suburb();\n\t\t\t\t\t$suburb->setSuburbID($row['suburb_id']);\n\t\t\t\t\t$suburb->setSuburbName($row['suburb_name']);\n\t\t\t\t\t$suburb->setCity($city);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t$property = new Property();\t\t\n\t\t\t\t\t$property->setPropertyID($row['property_id']);\t\t\t\n\t\t\t\t\t$property->setSuburb($suburb);\t\n\t\t\t\t\t$property->setAgent($agent);\n\t\t\t\t\t$property->setNumBathRoom($row['num_bathrooms']);\n\t\t\t\t\t$property->setNumBed($row['num_beds']);\n\t\t\t\t\t$property->setNumGarage($row['num_garages']);\t\n\t\t\t\t\t$property->setStreetNo($row['street_no']);\t\n\t\t\t\t\t$property->setStreetName($row['street_name']);\t\n\t\t\t\t\t$property->setPropertyDescription($row['property_desc']);\t\n\t\t\t\t\t$property->setPropertyType($row['property_type']);\t\t\n\t\t\t\t\t$property->setPrice($row['price']);\t\n\t\t\t\t\t$property->setImageLocation($row['image_location']);\n\t\t\t\t\t$property->setSuburbID($row['suburb_id']);\n\t\t\t\t\t$property->setMunicipalityID($row['municipality_id']);\n\t\t\t\t\t$property->setMunicipalityName($row['municipality_name']);\n\t\t\t\t\t$property->setCityID($row['city_id']);\n\t\t\t\t\t$properties[] = $property;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\treturn $properties;\n\t\t\t\t\n\t\t\t}catch(PDOException $e){\n\t\t\t\techo $e->getMessage();\n\t\t\t}\n\t\t}", "public function populate()\n { \n $this->data = $this->iDatasourceModel->getData( $this->propertyTypeInfo );\n $this->state = self::STATE_POPULATED;\n return;\n }", "public function property()\n {\n return $this->belongsTo(Property::class);\n }", "public function property()\n {\n return $this->belongsTo(Property::class);\n }", "public function __construct(EntityTypeManagerInterface $entity_type_manager) {\n $this->promotionStorage = $entity_type_manager->getStorage('commerce_promotion');\n }", "static function onSmwInitProperties () {\n\n\t\t// id, typeid, label, show\n\t\t// \\SMW\\DIProperty::registerProperty(\n\t\t\t// '___somenewproperty',\n\t\t\t// 2,\n\t\t\t// 'meetingminutes-some-property',\n\t\t\t// true\n\t\t// );\n\t\t\n\t\t\n\t\t/**\n\t\t * @note Property data types as follows (this needs to go somewhere else)\n\t\t * From SMWDataItem:\n\t\t * 0 = No data item class (not sure if this can be used)\n\t\t * 1 = Number\n\t\t * 2 = String/Text\n\t\t * 3 = Blob\n\t\t * 4 = Boolean\n\t\t * 5 = URI\n\t\t * 6 = Time (This must mean Date)\n\t\t * 7 = Geo\n\t\t * 8 = Container\n\t\t * 9 = WikiPage\n\t\t * 10 = Concept\n\t\t * 11 = Property\n\t\t * 12 = Error\n\t\t */\n\t\treturn MeetingPropertyRegistry::getInstance()->registerPropertiesAndAliases();\n\t\t\n\t}", "public function load()\n {\n }", "public function load()\n {\n }", "public function load()\n {\n }", "public function load()\n {\n }", "public function load()\n {\n }", "public function loadRelated()\n {\n return;\n }", "public function setPromotion(?PromotionInterface $promotion): void\n {\n }", "function getSourceProperties() {\r\n\t\t$properties = array();\r\n\t\t/* @var $source modMediaSource */\r\n\t\tif ($source = $this->resource->initializeMediaSource()) {\r\n\t\t\t$tmp = $source->getProperties();\r\n\t\t\t$properties = array();\r\n\t\t\tforeach ($tmp as $v) {\r\n\t\t\t\t$properties[$v['name']] = $v['value'];\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn $properties;\r\n\t}", "public function property()\n {\n return $this->hasOne('App\\Property');\n }", "abstract public function getJsProperties();" ]
[ "0.5702725", "0.56455034", "0.5431423", "0.54167455", "0.5398116", "0.5358069", "0.53289217", "0.52273667", "0.522143", "0.51951015", "0.5179486", "0.5165047", "0.5134871", "0.5118978", "0.5115698", "0.510623", "0.5104682", "0.50665665", "0.50659674", "0.50659674", "0.50659674", "0.49955177", "0.49952304", "0.49685568", "0.496032", "0.49466237", "0.4945383", "0.49368003", "0.49368003", "0.49368003", "0.49368003", "0.48929965", "0.48849648", "0.4876908", "0.48606473", "0.48513693", "0.48497277", "0.48485005", "0.48336825", "0.48051462", "0.4790645", "0.47778803", "0.477679", "0.47711936", "0.47633687", "0.47565985", "0.47501022", "0.4732995", "0.47265851", "0.4714132", "0.4713393", "0.47072914", "0.4696691", "0.46901393", "0.4684798", "0.46816668", "0.46810338", "0.4679487", "0.4678738", "0.46709913", "0.46693408", "0.4669085", "0.46667293", "0.46651065", "0.4662379", "0.4658329", "0.46556345", "0.46493188", "0.46474528", "0.46395275", "0.46344155", "0.4633706", "0.46213377", "0.46125937", "0.46100366", "0.45992246", "0.4598241", "0.45893428", "0.45888978", "0.45869783", "0.45828834", "0.45816788", "0.45812863", "0.45775348", "0.4573072", "0.45720932", "0.4570967", "0.4570967", "0.4569508", "0.45665365", "0.45659268", "0.45655528", "0.45655528", "0.45655528", "0.45655268", "0.45654315", "0.45637438", "0.45622355", "0.45608544", "0.45533165" ]
0.5753371
0
Return the promotion's id
public function getId() { if (isset($this->_data['id'])) { return intval($this->_data['id']); } return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getIdPromocion()\n {\n return $this->id_promocion;\n }", "public function getPromId()\n {\n return $this->prom_id;\n }", "private function getPromotionId($plan_id){\n $promotion = Promotion::where('plan_id',$plan_id)->where('status', 'active')->first();\n if(!$promotion){\n return 0;\n }\n return $promotion->id;\n }", "public function getPromotioncode()\n {\n return $this->promotioncode;\n }", "public function getPromotionCode()\n {\n return $this->promotionCode;\n }", "public function promotion()\n {\n return $this->hasOne('App\\Entities\\Promotion', 'id_promotion', 'id_promotion');\n }", "public function getShopifyId() {\n return $this->getShopifyProperty('id');\n }", "function findPromotionalChallengeId(){\n\t\t$this->PromotionalChallenge->recursive = -1;\n\t\t$promotional_challenge = $this->PromotionalChallenge->find('first', \n\t\t\tarray(\n\t\t\t\t'conditions' => array(\n\t\t\t\t\t'PromotionalChallenge.title' => strtolower($this->data['Challenge']['title'])\n\t\t\t\t), \n\t\t\t\t'fields' => array(\n\t\t\t\t\t'PromotionalChallenge.id'\n\t\t\t\t)\n\t\t\t)\n\t\t);\n\t\t\n\t\t$untracked_challenge = !($this->data['Challenge']['promotional_challenge_id'] = $promotional_challenge['PromotionalChallenge']['id']);\n\t\t\n\t\tif($untracked_challenge){\n\t\t\treturn 15;\n\t\t} \n\t\t\n\t\treturn $promotional_challenge['PromotionalChallenge']['id'];\n\t}", "public function getPromotion(){\n return $this->promotion;\n }", "public function getByID($promotion_id)\n {\n return $this->promotionsRepo->getPromotionByID($promotion_id);\n }", "public function getPromotionCode()\r\n\t{\r\n\t\treturn $this->root->getAttribute('codepromo');\r\n\t}", "public function testGETPromotionRulesPromotionRuleId()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "private function get_id()\n\t{\n\t\treturn $this->m_id;\n\t}", "private function get_id()\n\t{\n\t\treturn $this->m_id;\n\t}", "private function get_id()\n\t{\n\t\treturn $this->m_id;\n\t}", "public function getIdPromocionesProducto()\n {\n return $this->id_promociones_producto;\n }", "function get_id()\n {\n return $this->get_default_property(self :: PROPERTY_ID);\n }", "public function id()\n\t{\n\t\treturn $this->get($this->meta()->primary_key);\n\t}", "function get_id()\r\n {\r\n return $this->get_default_property(self :: PROPERTY_ID);\r\n }", "public function getPurchase_Id() {\n return $this->purchase_Id;\n }", "function get_id() {\n return $this->get_mapped_property('id');\n }", "public static function id()\n {\n // can't use facades to access properties unfortunately!\n return query()->post->ID ?? null;\n }", "function get_id() {\n\t\treturn $this->get_data( 'id' );\n\t}", "public function getId()\n {\n return $this->product->{$this->params['productFieldId']};\n }", "public function getId()\r\n {\r\n return (int) $this->m_id;\r\n }", "public function getID()\n {\n return $this->banner_campaign_id;\n }", "public static function getActivePromotion() {\n\t\t$db = Denkmal_Db::get();\n\t\t$id = $db->fetchOne('SELECT id\n\t\t\t\t\t\t\t\tFROM promotion p\n\t\t\t\t\t\t\t\tWHERE p.active=1\n\t\t\t\t\t\t\t\tLIMIT 1');\n\t\tif ($id) {\n\t\t\treturn new Promotion ($id);\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public function pId()\n {\n static $id = null;\n\n if (!is_null($id)) {\n return $id;\n }\n\n $id = $this->property('id');\n\n if (strpos($id, 'http') === 0) {\n $path = explode('/', parse_url($id, PHP_URL_PATH));\n\n if ($path[1] == 'gallery') {\n $id = $path[2];\n }\n elseif ($path[1] == 'a') {\n $id = 'a/'.$path[2];\n }\n else {\n $id = $path[1];\n }\n }\n\n return $id;\n }", "function getID(){ return (int)$this->productInfo['products_id']; }", "public function getIdProduto()\n\t\t{\n\t\t\treturn $this -> idproduto;\n\t\t}", "public function get_id() {\r\n\t\treturn ($this->id);\r\n\t}", "public function get_id() {\r\n\t\treturn ($this->id);\r\n\t}", "public function getId(){\n if(!$this->id){\n return $this->getShippingOptionId().'_'.md5($this->getShippingServiceName());\n }\n return $this->id;\n }", "public function getId()\n {\n return $this->product->{$this->params['productFieldId']};\n }", "public function getId() : int\n {\n return $this->getValue('nb_icontact_prospect_id');\n }", "public function getPromotionVendorCode()\n {\n return $this->promotionVendorCode;\n }", "public function getId()\n {\n return isset($this->id) ? $this->id : '';\n }", "public function getId()\n {\n return isset($this->id) ? $this->id : '';\n }", "public function getId()\n {\n return $this->savePayment();\n }", "public function getId()\n {\n return $this->source['order_item_id'];\n }", "public function get_id();", "public function get_id();", "private function getPaymentId()\n {\n return Session::get('mall.payment.id');\n }", "function getId()\n\t{\n\t\t$id=(int)$_GET['prodid'];\n\t\tif(is_int($id))\n\t\t{\n\t\t\treturn $id;\n\t\t}\n\t}", "function getPromotion($id) {\n $xml = simplexml_load_file(__DIR__ . '/../public/promotions.xml');\n\n $xml->registerXPathNamespace('p', 'http://wgcard.xml.hslu.ch/promotions');\n\n return xpathOnlyOne(\n $xml,\n '/p:promotions/p:promotion[@id=' . $id . ']',\n $id . ' has been found multible times in the promtions xml file'\n );\n}", "public function determineId() {}", "function getProposalId(){\n\t\t$articleDao = DAORegistry::getDAO('ArticleDAO');\n\t\t$article =& $articleDao->getArticle($this->getArticleId());\n\t\treturn $article->getLocalizedProposalId();\n\t}", "function get_id() {\n\t\treturn $this->id;\n\t}", "public static function meta_id_field() { return 'id'; }", "public function getId() : string\n {\n return $this->get('id', 'products');\n }", "public function id() {\n return $this->entity->id();\n }", "public function get_id()\n {\n return $this->id;\n }", "public function get_id()\n {\n return $this->id;\n }", "public function get_id()\n {\n return $this->id;\n }", "public function getCommerceId() : int\n {\n return $this->getValue('nb_commerce_id');\n }", "public static function getActualId()\n {\n if (self::$context->getName() == 'citation'\n && self::getCitationItem()!== false) {\n return self::getCitationItem()->get('id');\n }\n\n return self::getData()->getVariable('id');\n }", "public function get_id() {\n\t\treturn $this->id;\n\t}", "public function get_id() {\n\t\treturn $this->id;\n\t}", "public function get_id() {\n\t\treturn $this->id;\n\t}", "public function get_id() {\n\t\treturn $this->id;\n\t}", "public function get_id() {\n return $this->id;\n }", "public function get_id() {\n return $this->id;\n }", "public function get_id() {\n return $this->id;\n }", "function get_id() {\n\t\treturn $this->id;\n\n\t}", "public function get_id () {\r\n\t\treturn $this->id;\r\n\t}", "public function se_get_id() {\n\t\treturn version_compare( WC_VERSION, '3.0', '>=' ) ? $this->get_id() : $this->id;\n\t}", "public function se_get_id() {\n\t\treturn version_compare( WC_VERSION, '3.0', '>=' ) ? $this->get_id() : $this->id;\n\t}", "protected function getId() {\n // Since initializePurgersService() autogenerates the IDs, ours is known.\n return 'id0';\n }", "public function getPromomessagelistId()\n {\n try {\n return $this->promomessagelistRepository->getById(\n $this->context->getRequest()->getParam('promomessagelist_id')\n )->getId();\n } catch (\\Magento\\Framework\\Exception\\NoSuchEntityException $e) {\n return null;\n }\n }", "public function get_data_promotion($id)\n {\n $this->db->where('socialEmpresaId', $id);\n $datos = $this->db->get('social_media_empresa');\n return $datos->row();\n }", "public function getId()\n {\n return $this->response['id'] ?: null;\n }", "public function getId()\n {\n return $this->response['id'] ?: null;\n }", "public function getId()\n {\n return isset($this->id) ? $this->id : 0;\n }", "public function getId()\n {\n return isset($this->id) ? $this->id : 0;\n }", "public function getId()\n {\n return isset($this->id) ? $this->id : 0;\n }", "public function getPurchasableId();", "function get_id() {\n return $this->id;\n }", "function get_id()\n {\n return $this->id;\n }", "public function getProductOptionId();", "public function getId()\n {\n if (array_key_exists(\"id\", $this->_propDict)) {\n return $this->_propDict[\"id\"];\n } else {\n return null;\n }\n }", "public function getId()\n {\n return $this->idProduct;\n }", "function get_id()\n\t{\n\t\treturn $this->id;\n\t}", "public function getById($id = null)\n {\n if ($id == null || $id == '') {\n throw new InvalidArgumentException('Promo tidak ditemukan');\n }\n $promo = $this->promo->find($id);\n if (!$promo) {\n throw new InvalidArgumentException('Promo tidak ditemukan');\n }\n return $promo;\n }", "public function get_id()\n\t{\n\t\treturn $this->id;\n\t}", "public function get_id()\n\t{\n\t\treturn $this->id;\n\t}", "public function get_id()\n\t{\n\t\treturn $this->id;\n\t}", "public function getProductID()\n {\n if ($product = $this->Product()) {\n return $product->ID;\n }\n return 0;\n }", "public function getMediaId();", "public function getId()\n {\n $headers = $this->getHeaders();\n return isset($headers['X-NE-Delivery']) ? $headers['X-NE-Delivery'] : null;\n }", "public function get_id() {\n\n\t\treturn $this->id;\n\t}", "public function get_id() {\n\n\t\treturn $this->id;\n\t}", "public function getId() {\n return isset($this->query['id']) ? $this->query['id'] : null;\n }", "public function getIncrementId(){\n return $this->_getData(self::INCREMENT_ID);\n }", "public function get_id() {\n\t\t\treturn $this->id;\n\t\t}", "public function userPromotion() {\n return $this->belongsTo(UserPromotion::class, 'promotion_id');\n }", "function GetID () {\n return $this->hunt_id;\n }", "public function getId()\n {\n return $this->id ?? null;\n }", "public function getCouponId()\n {\n return $this->getParameter('couponId');\n }", "public function getId_produto()\n {\n return $this->id_produto;\n }", "public function getId() {\n\t\treturn $this->response['id'] ?: NULL;\n\t}", "public function getId()\n {\n return $this->id->getId();\n }" ]
[ "0.7169019", "0.7105434", "0.6938158", "0.6858767", "0.68483603", "0.6632169", "0.65818465", "0.6501446", "0.64649737", "0.64443594", "0.63667613", "0.6101002", "0.6086787", "0.6086787", "0.6086787", "0.6070271", "0.6064948", "0.6023708", "0.59989214", "0.59937084", "0.59930974", "0.5981141", "0.59668934", "0.5946561", "0.59417075", "0.59321874", "0.5908931", "0.5903755", "0.59007394", "0.5898979", "0.58952034", "0.58952034", "0.58935314", "0.5892679", "0.5876511", "0.586713", "0.58637816", "0.58637816", "0.58577347", "0.58453786", "0.58404076", "0.58404076", "0.5838286", "0.5822305", "0.5816309", "0.58102113", "0.5805388", "0.58024734", "0.5801739", "0.5798782", "0.5791418", "0.57901466", "0.57901466", "0.57901466", "0.5788214", "0.57837194", "0.57816416", "0.57816416", "0.57816416", "0.57816416", "0.5779035", "0.5779035", "0.5779035", "0.5778336", "0.5777509", "0.57702774", "0.57702774", "0.57678825", "0.576416", "0.57621497", "0.5761079", "0.5761079", "0.57577646", "0.57577646", "0.57577646", "0.5757547", "0.5752289", "0.575112", "0.5745763", "0.57429653", "0.5742085", "0.5735846", "0.57339036", "0.5733203", "0.5733203", "0.5733203", "0.5732068", "0.5728788", "0.5724793", "0.57233953", "0.57233953", "0.571192", "0.5709448", "0.5707127", "0.5694855", "0.5691392", "0.5682932", "0.56809926", "0.56801575", "0.567741", "0.5673417" ]
0.0
-1
Return the promotion's text
public function getText() { if (isset($this->_data['text'])) { return $this->_data['text']; } return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getPromoText()\n {\n return isset($this->promo_text) ? $this->promo_text : '';\n }", "public function getPromotion(){\n return $this->promotion;\n }", "public function text()\n {\n if ($this->text_translated) {\n return cms_trans($this->text_translated);\n }\n\n return $this->text;\n }", "public function setPromoText($var)\n {\n GPBUtil::checkString($var, True);\n $this->promo_text = $var;\n\n return $this;\n }", "public function get_text(): string\n {\n return $this -> text;\n }", "function get_text()\n {\n if ( !$this->_converted ) {\n $this->_convert();\n }\n\n return $this->text;\n }", "public function getPromotioncode()\n {\n return $this->promotioncode;\n }", "public function getCustomizeText(){\n\n $text = Mage::getStoreConfig(self::XPATH_CONFIG_INSTALLMENT_TEXT);\n if(!empty($text)){\n return $text;\n }\n return __('Juros');\n }", "public function get_text()\n {\n }", "public function getReviewText() : string {\n\t\treturn ($this->reviewText);\n\t}", "public function getPromotionCode()\r\n\t{\r\n\t\treturn $this->root->getAttribute('codepromo');\r\n\t}", "public function getText()\n {\n return $this->text();\n }", "public function getText()\n {\n return $this->text();\n }", "public function promotional();", "public function text()\n {\n return $this->getText();\n }", "public function getText()\n {\n return $this->text;\n }", "public function getPromotionCode()\n {\n return $this->promotionCode;\n }", "public function text()\n {\n return $this->message->text ?? $this->edited_message->text ?? null;\n }", "public function getText() {\n return $this->text;\n }", "public function getText(){\n return $this->TEXT;\n }", "public function getContenu(): string\n {\n return $this->contenu;\n }", "public function getText()\n {\n return $this->text;\n }", "public function getText()\n {\n return $this->text;\n }", "public function getText()\n {\n return $this->text;\n }", "public function getText()\n {\n return $this->text;\n }", "public function getText()\n {\n return $this->text;\n }", "public function getText()\n {\n return $this->text;\n }", "public function getText()\n {\n return $this->text;\n }", "public function getText()\n {\n return $this->text;\n }", "public function getText()\n {\n return $this->text;\n }", "public function getText()\n {\n return $this->text;\n }", "public function getText()\n {\n return $this->text;\n }", "public function getText()\n {\n return $this->text;\n }", "public function getText()\n {\n return $this->text;\n }", "public function text()\n {\n if($this->escapeText) {\n return $this->purifier->clean($this->object->text, 'ma_messageboard.mb_purifier_conf');\n }\n\n return $this->object->text;\n }", "public function text()\n {\n if($this->escapeText) {\n return $this->purifier->clean($this->object->text, 'ma_messageboard.mb_purifier_conf');\n }\n\n return $this->object->text;\n }", "public function getText(): string\n {\n return $this->text;\n }", "public function getText(): string\n {\n return $this->text;\n }", "public function getText(): string\n {\n return $this->text;\n }", "public function getText(): string\n {\n return $this->text;\n }", "public function getText(): string\n {\n return $this->text;\n }", "public function getText(): string\n {\n return $this->Text;\n }", "public function getText()\r\n {\r\n return $this->text;\r\n }", "function getText()\r\n {\r\n return $this->text;\r\n }", "public function getMessageText() {\n\treturn ($this->messageText);\n}", "public function getText() {\n return $this->data->text;\n }", "public function getTextShort(Notification $notification) : string;", "public function getDescription() {\n return $this->text;\n }", "public function getText() : string\n {\n return $this->text;\n }", "public function getText() : string\n {\n return $this->text;\n }", "public function getText() : string\n {\n return $this->text;\n }", "public function getText()\n {\n return $this->text;\n }", "public function getText()\n\t{\n\t\treturn $this->text;\n\t}", "public function getText()\n\t{\n\t\treturn $this->text;\n\t}", "public function getText(): string\n {\n return $this->before.$this->text.$this->after;\n }", "public function getText(): string\n {\n return $this->_text;\n }", "public function getText() {\n\t\treturn $this->text;\n\t}", "public function getTELEFONOC()\r\n {\r\n return $this->TELEFONOC;\r\n }", "public function getText(): string {\n\t\treturn $this->text;\n\t}", "public function getTexte()\n {\n return $this->texte;\n }", "public function getText()\n {\n return $this->traitGetText();\n }", "public static function get_suggested_policy_text()\n {\n }", "public function getText()\n {\n return $this->_text;\n }", "public function getText()\n {\n return $this->_text;\n }", "public function getText()\n {\n return $this->_text;\n }", "public function getTexto() {\n return $this->texto;\n }", "public function getText()\n\t{\n\t\treturn $this->getValue('text');\n\t}", "public function getSource()\n {\n return 'promo';\n }", "public function getTextoNot() {\n\t\treturn $this->TextoNot;\n\t}", "public function getText()\n {\n return isset($this->Text) ? $this->Text : null;\n }", "public function getText(){\n\t\treturn $this->_text;\n\t}", "public final function toText() : string\n {\n return $this->getText();\n }", "public function getString()\n {\n return $this->text;\n }", "public final function getText() : string\n {\n return self::htmlToText($this->getHtml());\n }", "public function getPromotionAmount()\r\n\t{\r\n\t\treturn $this->root->getAttribute('mtpromo');\r\n\t}", "protected function myDescription()\n {\n return _t('OrderStep.SENTINVOICE_DESCRIPTION', 'Invoice gets sent to the customer via e-mail. In many cases, it is better to only send a receipt and sent the invoice to the shop admin only so that they know an order is coming, while the customer only sees a receipt which shows payment as well as the order itself.');\n }", "public function getItemText()\n {\n return $this->stripTags($this->getEntity()->getData('list_item_text'));\n }", "public function getInfotext()\n {\n return $this->_infotext;\n }", "public function getAsString(): string\n {\n return $this->text;\n }", "public function getText() {\n\t\treturn html_entity_decode($this->text);\n\t}", "function sensei_custom_lesson_quiz_text () {\n\t$text = \"Report What You Have Learned\";\n\treturn $text;\n}", "public function getDescription()\n {\n return $this->post->post_content;\n }", "public function getText()\n {\n return $this->hasText() ? $this->update->message->text : null;\n }", "public function getText(): string\n\t{\n\t\treturn implode(\"\\n\", $this->items);\n\t}", "function metaDescriptionText ( $item ) {\n\tif ( $item != '') {\n\t\treturn $item;\n\t} else {\n\n\t\treturn METADESCRIPTION;\n\t}\n\n}", "public function getText()\n {\n if (array_key_exists(\"text\", $this->_propDict)) {\n return $this->_propDict[\"text\"];\n } else {\n return null;\n }\n }", "function getExtraContent() {\n\t\treturn get_language_string($this->get(\"extracontent\"));\n\t}", "public function getConsentText()\n {\n return $this->consent_text;\n }", "public function get_text()\r\n\t{\r\n\t\t$text = '';\r\n\t\t\r\n\t\tforeach($this->children as $child)\r\n\t\t\t$text .= $child->get_text();\r\n\t\t\r\n\t\treturn $text;\r\n\t}", "public function summarise() {\n if (trim($this->text) != '') {\n return get_string('summarisechoice', 'qtype_ddimageortext', $this);\n } else {\n return get_string('summarisechoiceno', 'qtype_ddimageortext', $this->no);\n }\n }", "private function getModalTitleText() : \\Magento\\Framework\\Phrase\n {\n return __('Are You Sure You Want to Turn Off Page Builder?');\n }", "public function getMotCle()\n {\n return $this->motCle;\n }", "public function getMessageText(): string\n {\n return $this->message_text;\n }", "private function getTitleText() {\n\t\t$titleText = $this->getOutput()->getProperty( 'wikibase-titletext' );\n\n\t\tif ( $titleText === null ) {\n\t\t\t$titleText = $this->getTitle()->getPrefixedText();\n\t\t}\n\n\t\treturn $titleText;\n\t}", "public function get_default_additional_content()\n {\n\n return __('Hope to see you back soon.', 'subscriptio');\n }", "public function get_default_additional_content()\n {\n\n return __('Thanks for reading.', 'subscriptio');\n }", "public function getDescription(): string\n {\n /** @var Translation|PaymentTranslation $translation */\n $translation = $this->translate(null, true);\n\n return $translation->getDescription();\n }", "public function getQuestionText()\n {\n return Html::encode($this->text);\n }", "function getRTETextWithMediaObjects()\n\t{\n\t\t$text = parent::getRTETextWithMediaObjects();\n\t\treturn $text;\n\t}", "public function getText()\n {\n if (!isset($this->_text)) {\n $this->_text = \"\";\n $pageDoc = $this->getPageComment();\n $match = $match2 = array();\n if (preg_match('/(?:\\/\\*\\*|^)[\\s\\*\\r\\f\\n]*\\S.*?[\\r\\f\\n]/', $pageDoc, $match)) {\n if (preg_match('/[\\s\\*\\r\\f\\n]([^@\\{]+)/si', $pageDoc, $match2, 0, mb_strlen($match[0]))) {\n $this->_text = trim(preg_replace('/^\\s*\\*\\s*/Um', '', $match2[1]));\n }\n }\n }\n return $this->_text;\n }", "public function getCustomCustomerDescriptionToProduct(): string;" ]
[ "0.83842474", "0.6701446", "0.6604134", "0.64335865", "0.64205766", "0.6361773", "0.63509613", "0.62955344", "0.6270937", "0.62363017", "0.6218619", "0.6179228", "0.6179228", "0.61762196", "0.616144", "0.61582583", "0.61396587", "0.61176497", "0.61089313", "0.6106976", "0.60877633", "0.6074512", "0.6074512", "0.6074512", "0.6074512", "0.6074512", "0.6074512", "0.6074512", "0.6074512", "0.6074512", "0.6074512", "0.6074512", "0.6074512", "0.6074512", "0.60694396", "0.60694396", "0.6067311", "0.6067311", "0.6067311", "0.6067311", "0.6067311", "0.60653925", "0.6063411", "0.6039537", "0.60087234", "0.6006058", "0.59964585", "0.59896374", "0.5980453", "0.5980453", "0.5980453", "0.59765744", "0.5972817", "0.5972817", "0.59714603", "0.5967729", "0.59659517", "0.59571946", "0.5956052", "0.5946736", "0.5941065", "0.59398425", "0.5934826", "0.5934826", "0.5934826", "0.5923829", "0.59214485", "0.5912848", "0.5901547", "0.58791924", "0.5872588", "0.5870482", "0.5865656", "0.58606267", "0.58562016", "0.5850164", "0.58460265", "0.5842734", "0.5841117", "0.5820418", "0.5819508", "0.58132285", "0.5807894", "0.58022165", "0.5769148", "0.57523847", "0.5751061", "0.57471865", "0.574318", "0.5742071", "0.5727743", "0.57167965", "0.57104456", "0.5691838", "0.5690073", "0.5688292", "0.56882685", "0.5677904", "0.56704754", "0.56658655", "0.5665759" ]
0.0
-1
Return whether the promotion is active
public function getActive() { if (isset($this->_data['active']) && $this->_data['active']) { return true; } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function isGotPromotion()\n {\n return $this->promotion->checkCondition()?true:false;\n }", "public static function getActivePromotion() {\n\t\t$db = Denkmal_Db::get();\n\t\t$id = $db->fetchOne('SELECT id\n\t\t\t\t\t\t\t\tFROM promotion p\n\t\t\t\t\t\t\t\tWHERE p.active=1\n\t\t\t\t\t\t\t\tLIMIT 1');\n\t\tif ($id) {\n\t\t\treturn new Promotion ($id);\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public function hasPromotion()\n {\n if($this->promotion instanceof PromotionInterface){\n return true;\n }\n return false;\n }", "public function isActive() \n {\t\n \t// if PIWIK tracking is activated return TRUE\n \tif (Mage::getStoreConfig('piwik/piwik/active')) {\n \t\treturn true;\n \t}\n \t// return FALSE otherwise\n \treturn false;\n }", "public function is_active(): bool;", "public function isActive()\n {\n return ($this->slug == \"actief\");\n }", "public function canBeActivated()\n {\n return !$this->getIsActive();\n }", "public function isAcitve()\n\t{\n\t\treturn $this->status == AdFox::OBJECT_STATUS_ACTIVE;\n\t}", "public function isThreatMetrixActive()\r\n {\r\n $enabled = Mage::getStoreConfig('payment/threat_metrix/active');\r\n return $enabled;\r\n }", "public function isActive()\n {\n return $this->status == 'active';\n }", "public function isActive()\n {\n if ($this->status == 1) {\n return true;\n } else {\n return false;\n }\n }", "public function IsActive()\n {\n return true;\n }", "public function is_active();", "public function isActive() {\n return (bool) $this->settings->isActive();\n }", "public function hasActivePokemon()\n {\n return $this->ActivePokemon !== null;\n }", "public function hasAutomotive()\n {\n return $this->automotive !== null;\n }", "public function isActive (){\n if($this->is_active == 1) {\n return true;\n }else{\n return false;\n }\n }", "public function isActive()\n\t{\n\t\treturn $this->isActivated() && !$this->isBanned();\n\t}", "public function getIsActive()\r\n {\r\n return ($this->isActive=='1');\r\n }", "static function activePayment()\n\t{\n global $configClass;\n if($configClass['active_payment'] == 1 || $configClass['integrate_membership'] == 1)\n\t\t{\n return true;\n }\n\t\telse\n\t\t{\n return false;\n }\n }", "public function isActive() : bool\n {\n return $this->id !== 0 && $this->activated;\n }", "public function isActive() {\n $isActive = Mage::getStoreConfig('santander/general/active');\n if($isActive) {\n return true;\n } else {\n return false;\n }\n }", "public function isActive() {\n $isActive = Mage::getStoreConfig('santander/general/active');\n if($isActive) {\n return true;\n } else {\n return false;\n }\n }", "public function getIsActive(): bool;", "public function getIsActive(): bool;", "public function getIsActive(): bool;", "public function can_activate(): bool;", "public function isActive(): bool\n {\n return in_array($this -> charging_status, $this->activeOrdersStatuses);\n }", "public function isActive()\n {\n return $this->getStatus() == self::STATUS_ACTIVE;\n }", "public function isActive()\n\t{\n\t\treturn $this->Status === 'active';\n\t}", "function isActive(){\n\t\treturn $this->getSessionID() == $this->getUser()->getShift() && $this->getStatus() == '1' ? true : false;\n\t}", "public function getIsActive();", "public function isActive()\n {\n return $this->getActive();\n }", "public function isActive()\n {\n return ($this->isDraft() || $this->isExpired()) ? false : true;\n }", "public function isActive() {\r\n return $this->getModelPlugin()->isActive($this->getPluginKey());\r\n }", "public function isActive(): bool\n {\n return $this->active;\n }", "function uds_pricing_is_active()\n{\n\tif(function_exists('uds_active_shortcodes')) {\n\t\t$active_shortcodes = uds_active_shortcodes();\n\t\tif( ! in_array('uds-pricing-table', $active_shortcodes)) {\n\t\t\treturn false;\n\t\t}\n\t}\n\t\n\treturn true;\n}", "private function isOpcModuleActive()\n {\n // fallback for mobile-enabled theme\n if (Configuration::get('OPC_MOBILE_FALLBACK') && $this->context->getMobileDevice())\n return false;\n\n // fallback for paypal express checkout\n if (isset($this->context->cookie->express_checkout) && Configuration::get('OPC_PAYPAL_EXPRESS_FALLBACK'))\n return false;\n\n if ($this->opcModuleActive > -1)\n return $this->opcModuleActive;\n\n $opc_mod_script = _PS_MODULE_DIR_ . 'onepagecheckout/onepagecheckout.php';\n if (file_exists($opc_mod_script)) {\n require_once($opc_mod_script);\n $opc_mod = new OnePageCheckout();\n $this->opcModuleActive = (Tools::getValue('opc-debug') == 1900)?true:((Tools::getValue('opc-debug') == 1901)?false:$opc_mod->active);\n } else {\n $this->opcModuleActive = 0;\n }\n return $this->opcModuleActive;\n }", "public function isActive() {\n return (bool) $this->getValue('active');\n }", "public function isActive()\n {\n return (bool)$this->getValue(self::KEY_ACTIVE);\n }", "public function isActive(): bool;", "public function isActive(): bool;", "public function hasActiveCart();", "public function isEnabled()\n {\n return Mage::getStoreConfig(self::GENE_BRAINTREE_APPLEPAY_ACTIVE)\n && Mage::getStoreConfig(self::GENE_BRAINTREE_APPLEPAY_EXPRESS_ACTIVE);\n }", "public function isActive()\n {\n return ($this->getStatus()->getId() === self::STATUS_ACTIVE);\n }", "public function isActive()\n {\n return $this->isPublished();\n }", "public function hasCoupon()\n {\n return (bool)$this->coupon_id;\n }", "public function isActive(){\n return (bool)$this->active;\n }", "public function isActive() : bool\n {\n if (!isset($this->data['active'])) {\n return false;\n }\n return ($this->data['active'] === true || $this->data['active'] === 'Y');\n }", "public function getIsActive() {}", "public function isActive()\n\t\t{\n\t\t\treturn $this->_state === 1;\n\t\t}", "public function getIsActiveAttribute()\n {\n return $this->is_activated && $this->is_not_deactivated;\n }", "public function isPaid(){\n return $this->status == \"SUCCESS\";\n }", "public function isActive()\n {\n return $this->active;\n }", "public function getPromotions():bool \n {\n return $this->promotions;\n }", "public function isEnabled(){\n return $this->activo;\n }", "public function isActive()\n {\n return $this->active;\n }", "public function isActive()\n {\n return $this->active;\n }", "public function isActive()\n {\n return $this->active;\n }", "public function isActive()\n {\n return $this->active;\n }", "public function isActive()\n {\n return $this->active;\n }", "public function isActive()\n {\n return $this->active;\n }", "public function isActive()\n {\n return $this->active;\n }", "public function isActive()\n {\n return $this->active;\n }", "public function isActive() {\n return $this->active;\n }", "public function isActive()\n {\n If ($this->theme_active == 1)\n {\n //plugin is active\n return true;\n\n } else {\n \n //plugin is not active\n return false;\n }\n\n }", "public function isActive(): bool\n {\n return (bool) $this->_getEntity()->isActive();\n }", "public function IsActive ();", "public function isActive()\n\t{\n\t\tif (($record=$this->getActiveRecord())===null) {\n\t\t\treturn false;\n\t\t}\n\t\treturn (bool)$record->esta_activo;\n\t}", "function discount_active($discount_active=null)\n {\n if (isset($discount_active)) {\n $this->discount_active = (boolean)$discount_active;\n }\n return $this->discount_active;\n }", "protected function _isEnabled()\n {\n return $this->currentCustomer->getCustomerId() && $this->_rewardData->isEnabledOnFront()\n && $this->_rewardData->getGeneralConfig('publish_history');\n }", "public function isActive() {\n\t\treturn $this->active;\n\t}", "public function isActive()\n {\n return (bool) ($this->_state == 'active');\n }", "public function isActive()\n {\n return $this->is_published;\n }", "public function vote_active() { \n\n\t\t/* Going to do a little more here later */\n\t\tif ($this->type == 'vote') { return true; } \n\n\t\treturn false;\n\n\t}", "public function isActive()\n\t{\n\t\treturn $this->status;\n\t}", "private function isPayflowProVaultEnable()\r\n {\r\n return (bool)$this->scopeConfig->getValue(self::XML_PATH_PAYMENT_PAYFLOWPRO_CC_VAULT_ACTIVE);\r\n }", "public function hasActiveSubscription()\n {\n return $this->user->hasActiveSubscription();\n }", "public function is_inactive(): bool;", "public function isActive();", "public function isActive();", "public function isActive();", "public function isActive();", "public function active() : bool\n {\n if (!Di::getDefault()->get('app')->subscriptionBased()) {\n return true;\n }\n\n return (bool) $this->is_active &&\n $this->stripe_status !== StripeSubscription::STATUS_INCOMPLETE &&\n $this->stripe_status !== StripeSubscription::STATUS_INCOMPLETE_EXPIRED &&\n $this->stripe_status !== StripeSubscription::STATUS_UNPAID;\n }", "public function isEnabled()\n {\n return $this->getIsActive();\n }", "public function isActive() {\n\n\t\treturn ($this->getConfigValue('account_status') == \"active\");\n\t}", "public function isEnabled()\n {\n\t\tif($this->actif == 1) return true;\n \telse return false;\n }", "public function isActive(){\n return (bool) ($this->hasStarted() && ! $this->hasExpired() && !$this->isCancelled());\n }", "public function billingIsActive()\n {\n return $this->billing_active;\n }", "function isApproved() {\n return $this->getStatus() == UserpointsTransaction::STATUS_APPROVED;\n }", "public function companyIsActive()\n {\n return true ;\n }", "function isActive() {\n\t\treturn ($this->getActive() == self::PROFILE_ACTIVE);\n\t}", "public function isActive()\n {\n return ($this->getIsActive() == self::STATUS_ENABLED);\n }", "public function getIsActive()\n {\n return $this->is_active;\n }", "public function getIsActive()\n {\n return $this->isActive;\n }", "public function getIsActive()\n {\n return $this->isActive;\n }", "public function getIsActive()\n {\n return $this->isActive;\n }", "public function getIsActive()\n {\n return $this->isActive;\n }", "public function isActivatable()\n {\n return true ;\n }", "public function isActiveOrPending()\n {\n return $this->isApproved() || $this->isPending();\n }" ]
[ "0.780368", "0.738413", "0.71995944", "0.70778495", "0.6677931", "0.6676369", "0.661993", "0.65981007", "0.65321505", "0.6532144", "0.651813", "0.6490059", "0.64830035", "0.6472264", "0.6446136", "0.6445156", "0.64413667", "0.63811433", "0.6381028", "0.6380798", "0.63801765", "0.6379486", "0.6379486", "0.6377987", "0.6377987", "0.6377987", "0.6365178", "0.6343238", "0.6333002", "0.6311394", "0.63008225", "0.6294941", "0.6286856", "0.6277807", "0.6276945", "0.6274224", "0.62711984", "0.62687665", "0.6267915", "0.62671626", "0.62627715", "0.62627715", "0.6259187", "0.62468934", "0.62308496", "0.62286836", "0.62232316", "0.62189806", "0.6207405", "0.6205239", "0.6193797", "0.61927015", "0.6188815", "0.6183584", "0.6183271", "0.61803406", "0.61768013", "0.61768013", "0.61768013", "0.61768013", "0.61768013", "0.61768013", "0.61768013", "0.61768013", "0.6162017", "0.6159923", "0.61567545", "0.61563164", "0.61516476", "0.61432385", "0.61353356", "0.6133464", "0.6115375", "0.61125475", "0.6103262", "0.6101728", "0.610081", "0.60946983", "0.6092857", "0.60926574", "0.60926574", "0.60926574", "0.60926574", "0.60893744", "0.60831785", "0.6081466", "0.6078016", "0.60701025", "0.60586303", "0.60521406", "0.60502154", "0.60457563", "0.60391665", "0.60301894", "0.60245526", "0.60245526", "0.60245526", "0.60245526", "0.60197574", "0.6014177" ]
0.6014232
99
Return number of entries
public function getEntriesNum() { $db = Denkmal_Db::get(); return $db->fetchOne('SELECT COUNT(1) FROM promotion_entry e WHERE e.promotionId=?' , array($this->getId())); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getEntryCount() {}", "public function countEntries()\n\t{\n\t\treturn count($this->_results);\n\t}", "public function count()\n {\n return count($this->entries);\n }", "public function count() : int\n {\n return count($this->entries);\n }", "public function size() \n {\n return count($this->_entries);\n }", "public function getNumberOfEntries()\n {\n return $this->numberOfEntries;\n }", "public function getEntriesCount()\n\t{\n\t\treturn $this->lastCount;\n\t}", "public function count() {\n\t\treturn count($this->_data);\n\t}", "public function count() {\n\t\treturn count($this->data);\n\t}", "public function getCount()\n\t{\n\t\treturn count($this->_d);\n\t}", "public function count() {\n\t\treturn count($this->getData());\n\t}", "public function totalEntries()\n\t{\n\t\t$count = craft()->formBuilder2_entry->getTotalEntries();\n\t\treturn $count;\n\t}", "function count() {\n\t\treturn count($this->data);\n\t}", "public /*int*/ function count()\n\t{\n\t\treturn count($this->_data);\n\t}", "public function count()\n {\n return count($this->_data);\n }", "public function count()\n {\n return count($this->_data);\n }", "public function count()\n {\n return count($this->_data);\n }", "public function count()\n {\n return count($this->_data);\n }", "public function count()\n {\n return count($this->_data);\n }", "public function count() {\n return count($this->_data);\n }", "function guestbook_count_entries() {\r\n \tif(guestbook_open_for_read() === FALSE) {\t// Aquires shared lock on guestbook file\r\n \t\treturn 0;\r\n \t}\r\n \t$raw_entries = @file(guestbook_file_path());\r\n \tguestbook_close();\t// Releases shared lock \r\n \tif($raw_entries === FALSE) {\r\n \t\treturn 0;\r\n \t}\r\n \t\r\n \t// Return size of entry array\r\n \treturn sizeof($raw_entries);\r\n\r\n}", "public function count()\r\n {\r\n return count($this->data);\r\n }", "public function count() {\r\n return count($this->data);\r\n }", "public function count()\n\t{\n\t\treturn count($this->getListByKey());\n\t}", "public function count()\n {\n return count( $this->data );\n }", "public function count()\n {\n return sizeof($this->getData());\n }", "public function count()\n {\n return count($this->data);\n }", "public function count()\n {\n return count($this->data);\n }", "public function count()\n {\n return count($this->data);\n }", "public function count()\n {\n return count($this->data);\n }", "public function count()\n {\n return count($this->data);\n }", "public function count(): int\n {\n return count($this->data);\n }", "public function count()\n {\n return count($this->_data);\n }", "public function count() {\n\t\t// return $this->_count;\n\t\treturn count($this->_data);\n\t}", "function count() {\n return count($this->data);\n }", "public function count() {\n\t\treturn count($this->array);\n\t}", "public function count(): int {\n return count($this->toArray());\n }", "public function count() {\n\t\treturn $this->length();\n\t}", "public function count() {\n return sizeof($this->data);\n }", "public function count() {\n return sizeof($this->data);\n }", "public function count() {\n return sizeof($this->data);\n }", "function count()\n {\n // this catches the situation where OL returned errno 32 = no such object!\n if (!$this->_search) {\n return 0;\n }\n return @ldap_count_entries($this->_link, $this->_search);\n }", "public function countItems();", "public function count(): int\n {\n return count( $this->toArray() );\n }", "public function count() {\n return count($this->list);\n }", "public function count() {\n $this->next();\n\n $names = [];\n while ($this->valid()) {\n $row_data = $this->current();\n $this->next();\n\n $names[] = $row_data['Name'];\n }\n $items = array_unique($names);\n $items = array_filter($items);\n\n return count($items);\n }", "public function count()\n\t{\n\t\treturn count($this->list);\n\t}", "public function countKeys();", "public static function count();", "public function getEntriesCountForTable($table);", "public function countData()\n {\n return count($this->data);\n }", "public function count() {\n\t\treturn count($this->_dataobjects);\n\t}", "public function size() {\n return n(count($this->value()));\n }", "public function count() {\n return count( $this->list );\n }", "public function count()\n {\n return count($this->list);\n }", "public function count();", "public function count();", "public function count();", "public function count();", "public function count();", "public function count();", "public function count();", "public function count();", "public function count();", "public function count();", "public function count();", "public function count();", "public function count();", "public function count();", "public function count();", "public function count();", "public function count();", "public function count();", "public function count();", "public function count();", "public function count();", "public function count();", "public function count()\n {\n return $this->size();\n }", "public function count()\n\t{\n\t\treturn $this->getCount();\n\t}", "public function count() {\n\t\treturn count($this->values);\n\t}", "public function count()\n {\n return count($this->currentData);\n }", "public function count()\n {\n return $this->length();\n }", "public function count() {\n return count($this->__rows__);\n }", "public function count ( )\n {\n return count($this->_values);\n }", "public function count ( )\n {\n if(!isset($this->data))\n {\n return 0;\n }\n if(is_array($this->data))\n {\n return count($this->data);\n }\n return 1;\n }", "public function count()\n {\n return $this->length();\n }", "public function count()\n\t{\n\t\treturn count($this->values);\n\t}", "public function count()\n {\n $count = Doctrine_Query::create()\n ->select('COUNT(id) as total')\n ->from('Zfplanet_Model_Entry')\n ->fetchone();\n return $count->total;\n }", "public function count(){\n\t\t$this->initRecordSet();\n\t\treturn $this->recordSetSize;\n\t}", "public function getDataCount()\n {\n return count($this->data);\n }", "public function count(): int\n\t{\n\t\treturn count($this->all());\n\t}", "public function count()\n {\n $this->buffer();\n\n // Armazena quantos registro possui o array\n $this->count = count($this->toArray());\n\n // Retorna para o primeiro elemento\n $this->rewind();\n\n // Retorna a quantidade de dados\n return $this->count;\n }", "public function numberOfItems();", "public function getCount ()\n {\n return count ( $this->_list ) ;\n }", "public function getTotalEntries(){\n if($this->databaseConnection()){\n $query = $this->db_connection->prepare('select count(*) from events ');\n $query->execute();\n $result = $query->fetchColumn();\n return $result; \n }\n }", "public function count(): int\n {\n return iterator_count($this->items);\n }", "function count() {\n # The return value of this function is intended to indicate the total\n # number of results of the operation the Iter represents.\n return NULL;\n }", "public function count(): int\n {\n return $this->keyTotal;\n }", "public function count(): int {\n return count($this->items);\n }", "function RowCount() {}" ]
[ "0.8385772", "0.838274", "0.8267118", "0.8224408", "0.80294836", "0.8021473", "0.7444095", "0.73937845", "0.7378646", "0.7357511", "0.7354793", "0.73397666", "0.7314732", "0.7280966", "0.72592574", "0.72592574", "0.72592574", "0.72592574", "0.72592574", "0.725596", "0.72465223", "0.7238154", "0.7236974", "0.72236997", "0.7210591", "0.72101176", "0.7202786", "0.7202786", "0.7202786", "0.7202786", "0.7202786", "0.7180432", "0.7173552", "0.71648645", "0.7154543", "0.7150592", "0.7146522", "0.71433073", "0.71396697", "0.71396697", "0.71396697", "0.71356726", "0.7132956", "0.71246547", "0.7113048", "0.71022296", "0.7101119", "0.70932496", "0.70899487", "0.7071773", "0.7068893", "0.7045797", "0.7036681", "0.7027938", "0.7024482", "0.70097846", "0.70097846", "0.70097846", "0.70097846", "0.70097846", "0.70097846", "0.70097846", "0.70097846", "0.70097846", "0.70097846", "0.70097846", "0.70097846", "0.70097846", "0.70097846", "0.70097846", "0.70097846", "0.70097846", "0.70097846", "0.70097846", "0.70097846", "0.70097846", "0.70097846", "0.7009014", "0.70031714", "0.69773465", "0.6970639", "0.6970151", "0.6970125", "0.69663507", "0.6961859", "0.6951974", "0.69506085", "0.6943204", "0.6931331", "0.69227546", "0.69185984", "0.6916637", "0.6915497", "0.69105786", "0.69088995", "0.6906609", "0.6904516", "0.6898382", "0.6896171", "0.68957007" ]
0.7337809
12
Return whether the current user (cookie) has already submitted
public function getHasSubmitted() { @$cookie = $_COOKIE['promotion_' . $this->getId()]; return (bool) $cookie; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isUserRegistered()\r\n{\r\n $statusFlag = FALSE;\r\n \r\n // if user has previously registered, return true;\r\n if( isset($_COOKIE[\"user_email\"] ))\r\n $statusFlag = TRUE;\r\n\t \r\nreturn $statusFlag;\r\n\r\n}", "public function kapee_cookie_setted() {\n\t\treturn isset( $_COOKIE[self::$cookie['name']] );\n\t}", "public function hasPostAuthentication()\n {\n return isset($this->sessionStorage->user['twofactor_activated']) && $this->sessionStorage->user['twofactor_activated'] === true;\n }", "private function _loginPermitted ()\r\n {\r\n if(empty($_COOKIE[self::$_cookieCount])) {\r\n return true;\r\n }\r\n\r\n return $_COOKIE[self::$_cookieCount] < self::$_incercari;\r\n }", "public function hasQueueingCookie(): bool;", "private function checkCurrentUser(){\n return isset($_SESSION['user']);\n }", "function UserIsClear()\n {\n StartSession();\n $isClear = isset($_SESSION[GetExamIdentifier()]);\n \n return $isClear;\n }", "function isSubmittedBy();", "static function keepMeLogged() {\n\t\treturn isset ( $_COOKIE [session_name ()] );\n\t}", "function is() {\n global $_SESSION;\n if (! empty($_SESSION['payback']['user'])) return true;\n else return false;\n }", "public function hasRememberMe()\n\t{\n return $this->cookies->has('RMU');\n }", "public function valid() \n {\n return isset($_COOKIE[$this->key()]);\n }", "private function user_already_logged() {\n echo \"Entro por user_already_logged\";\n return isset($this->session->userdata['logged_in']);\n }", "public function cookieIsset() {\n\t\tif(isset($_COOKIE[$this->cookieName])) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "function renren_user_logined() {\n global $RR_config;\n return isset($_COOKIE[$RR_config->APIKey.'_session_key']) || !empty($_COOKIE[$RR_config->APIKey.'_session_key']);\n}", "public function has_submit() {\n\t\treturn false;\n\t}", "public function hasRememberMe()\n {\n return $this->cookies->has('RMU');\n }", "public function logged_in()\n\t{\n\t\treturn $this->_me != NULL;\n\t}", "public function isCookieSet() {}", "public function isSetSessionCookie() {}", "public function isSetSessionCookie() {}", "public function isSubmitted()\n\t{\n\t\tif ($this->http_method == 'get') {\n\t\t\t// GET form is always submitted\n\t\t\treturn TRUE;\n\t\t} else if (isset($this->raw_input['__'])) {\n\t\t\t$__ = $this->raw_input['__'];\n\t\t} else {\n\t\t\treturn FALSE;\n\t\t}\n\t\tforeach ((array) $__ as $token => $x) {\n\t\t\t$t = static::validateFormToken($token, $this->id);\n\t\t\tif ($t !== FALSE) {\n\t\t\t\t// Submitted\n\t\t\t\tif ($this->form_ttl > 0 && time() - $t > $this->form_ttl) {\n\t\t\t\t\t$this->form_errors[self::E_FORM_EXPIRED] = array(\n\t\t\t\t\t\t'message' => _('The form has expired, please check entered data and submit it again.')\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\treturn TRUE;\n\t\t\t}\n\t\t}\n\t\treturn FALSE;\n\t}", "protected function valid()\r\n {\r\n return isset($_SESSION['user']['user_id']) ? true : false;\r\n }", "function isSubmitted()\r\n\t\t{\r\n\t\t\tif( isset($_POST[$this->form_id.'-issubmitted'] ) )\r\n\t\t\t\treturn TRUE;\r\n\t\t\telse\r\n\t\t\t\treturn FALSE;\r\n\r\n\t\t}", "private function can_continue_current_form(){\n if(!isset($_GET['token'])){ return false; }\n if(!is_user_logged_in()){ return false; }\n\n $allowed = false;\n\n //check token\n $token_from_url = sanitize_text_field($_GET['token']);\n $token_from_post_meta = get_post_meta((int) $_GET['post_id'], 'secret_token', true);\n\n //check author\n $author_id = get_post_field('post_author', $_GET['post_id']);\n $current_user_id = get_current_user_id();\n\n if(($token_from_url === $token_from_post_meta) && ($author_id == $current_user_id)){\n $allowed = true;\n }\n\n return $allowed;\n }", "public static function check()\n {\n if (isset($_SESSION['user'])) {\n return true;\n }\n return false;\n }", "protected function creatingNewUser() {\n return ($this->request_exists('user_choice') && $this->request('user_choice') == 'new' );\n }", "public function isSubmitted();", "public static function granted(): bool\n {\n global $Users;\n\n // Check login form and verify.\n if (!empty($_POST['user']) AND !empty($_POST['pass']) AND isset($Users[$_POST['user']]) AND password_verify($_POST['pass'], $Users[$_POST['user']]))\n {\n if (isset($_POST['remember']))\n {\n setcookie(session_name(), session_id(), strtotime('+1 Month'), '/', $_SERVER['HTTP_HOST'], true, true);\n }\n\n $_SESSION['loggedIn'] = true;\n\n return true;\n }\n\n // Check sessions.\n if (isset($_SESSION) AND isset($_SESSION['loggedIn']) AND $_SESSION['loggedIn'] === true)\n {\n return true;\n }\n\n return false;\n }", "static public function isUser(){\n if ( isset($_SESSION['id']) && $_SESSION['id'] != 0 ) {\n return true;\n } else {\n return false;\n }\n }", "public function customerIsAlreadyLoggedIn()\n {\n return (bool)$this->httpContext->getValue(\\Magento\\Customer\\Model\\Context::CONTEXT_AUTH);\n }", "public static function check(){\n\t\tif (isset($_SESSION['username'])) {\n\t\t\treturn true;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}", "function checkLogined()\r\n{\r\n if ($_COOKIE['userName'] != \"\") {\r\n $mes=\"logined\";\r\n return $mes;\r\n }\r\n}", "public function userActive(){\n\t\treturn (isset($this->session) && $this->session != null && isset($this->session['id']) && $this->session['id'] > 0) ? true : false;\n\t}", "protected function is_first_time()\n\t{\n\t\tif ( !get_site_option( 'cur_from' ) && !get_site_option( 'confirm-user-registration' ) ) :\n\t\t\treturn TRUE;\n\t\telse :\n\t\t\treturn FALSE;\n\t\tendif;\n\t}", "public function check() {\n return (isset($_SESSION['usuario']));\n }", "public function isUserLogged(){\r\n return isset($_SESSION[$this->userSessionKey]);\r\n }", "public static function is_submitting(){\n\t\treturn (strcasecmp('POST', $_SERVER['REQUEST_METHOD'] ) == 0);\n\t}", "protected function _isAlreadyLoggedIn(){\n debug($_SESSION);\n die();\n if ($this->Session->read('Auth.User')) {\n $role = $this->Role->read(null, $this->Auth->user('role_id'));\n CakeSession::write('Auth.User.role', $role['Role']['alias']);\n\n $url = null;\n switch ($role['Role']['alias']) {\n case 'admin':\n case 'manager':\n $this->Session->setFlash(__('If you pretend to register an other person, user \"Add Register (Consolidate)\" at Administrative Panel.'), 'default', array('class' => 'notice'));\n $url = array('plugin' => false, 'controller' => 'systems', 'action' => 'dashboard', 'prefix' => 'admin', 'admin' => true);\n break;\n case 'registered':\n $this->Session->setFlash(__('You has already registered!'), 'default', array('class' => 'notice'));\n $url = array('plugin' => false, 'controller' => 'systems', 'action' => 'dashboard', 'prefix' => 'profile', 'profile' => true);\n break;\n default:\n $url = $this->Auth->redirect();\n break;\n }\n $this->redirect($url);\n }\n return array('success' => true);\n \n }", "function isNew()\n {\n\t $counter = $this->get( 'session.counter' );\n\t\tif( $counter === 1 ) {\n\t\t\treturn true;\n\t\t}\n return false;\n }", "public function hasUserCookies ()\n\t{\n\t\t// Simply check if the storage key for cookies exists and is non-empty.\n\t\treturn ! empty($this->loadUserCookies()) ? true : false;\n\t}", "function checkCookie(){\n global $cookie;\n\n // Check database to see if a user exists with this cookie\n if (getSingleValue(\"SELECT COUNT(`id`) FROM `private_users` WHERE `cookie` ='\" . $cookie . \"' LIMIT 0 , 1\") != 1){\n // Some user has this cookie, it is valid\n return false;\n }else{\n // Nobody has this cookie, therefore it's invalid\n return true;\n }\n}", "public static function isExist() {\n return ((self::$_isSessionRunning) && !empty($_COOKIE[session_name()]));\n }", "public function cookieExists() {\n if (isset($_COOKIE[$this->cookie['name']])){\n return true;\n }\n\n return false;\n }", "public function callbackSubmit()\n {\n $this->user = new \\Anax\\Users\\User();\n $this->user->setDI($this->di);\n\n if (isset($_SESSION[\"user\"])) {\n unset($_SESSION[\"user\"]);\n return $this->isLogoutSuccessful();\n } else {\n $this->logoutMessage = \"Du är inte inloggad!\";\n return false;\n }\n }", "private function isLoggedIn()\n {\n return isset($_SESSION['user']); \n }", "function estaLogueado() {\n return isset($_SESSION[\"email\"]);\n }", "public function is_cookie_set()\n {\n }", "public function isLogined()\n {\n return isset($_SESSION['userLogin']);\n }", "function isUserLogged() {\r\n return isset($_SESSION['user']);\r\n }", "function logged_in()\n{\n if(isset($_SESSION['email']) || isset($_COOKIE['email'])){\n return true;\n }else{\n return false;\n }\n}", "public function isSelf() {\n return $this->isLogin() && $this->request->session['userInfo']['id'] == $this->user[0]['id'];\n }", "function loggedIn() {\n\t\treturn isset($_SESSION['username']);\n\t}", "public function formSubmitted() {\n return $_SERVER[\"REQUEST_METHOD\"] == 'POST';\n }", "private static function is_logged_in () {\n\t\t# Check for the existence of the cookie\n\t\tif (isset($_COOKIE[\"user_id\"])) {\n\t\t\treturn (true);\n\t\t} else {\n\t\t\treturn (false);\n\t\t}\n\t}", "public static function check()\n {\n if(isset($_SESSION['auth_user'])) {\n return true;\n }\n\n return false;\n }", "public function check()\n {\n $user = $this->user();\n return !empty($user);\n }", "public static function check()\n {\n if (!empty($_SESSION['LOGGED_IN_USER'])){\n return true;\n } else{\n return false;\n }\n }", "function check_form_submitted()\n {\n $query = $this->recruitment_model->get_faculty_info($this->user_id);\n if($query->num_rows()==1)\n {\n if($query->row()->final_submission==1)\n {\n return 1;\n }\n else\n {\n return 0;\n }\n }\n return 0;\n }", "public function isSubmit() {\n return Tools::isSubmit($this->key());\n }", "public function isUsed()\n\t{\n\t\treturn $this->data && $this->data['forms_attempts'] > 0;\n\t}", "public function isAlreadySaved()\n\t\t{\n\t\t\treturn $this->_alreadySaved == true;\n\t\t}", "function logged_in(){\n\n // if the user loging session is active return true \n // otherwise the user needed to reenter the critentials\n if(isset( $_SESSION['email']) || isset($_COOKIE['email'])){\n\n return true ;\n\n }\n else\n {\n\n return false; \n }\n }", "public function has() {\n\t\t$userid = $this->get();\n\t\treturn ! empty( $userid );\n\t}", "function is_authed() {\n\tif (isset($_SESSION['username'])) {\n\t\treturn true;\n\t}\n\telse {\n\t\treturn false;\n\t}\n}", "function form_submitted()\n{\n return isset($_POST['Submit']);\n}", "function user_exists()\n\t{\t\n\t\tif((empty($_SESSION['username'])))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t}", "public function isLoggedIn()\n {\n return isset($_SESSION['user']);\n }", "public function state()\n {\n return isset($_SESSION['id']);\n }", "private\n function checkAuth()\n {\n if (!isset($_SESSION['artiste_id'])) {\n return false;\n }\n return true;\n }", "function isAuthed ()\r\n\t{\r\n\t\tif ((strlen($this->acUserAuth) > 0 ? $this->acUserAuth : 0) >= $this->acPageAuth)\r\n\t\t{\r\n\t\t\t$status = true;\r\n\t\t} else\r\n\t\t{\r\n\t\t\t$status = false;\r\n\t\t}\r\n\t\treturn $status;\r\n\t}", "protected function loggedIn() {\n return isset($_SESSION) && array_key_exists(self::user, $_SESSION);\n }", "public static function exists()\n {\n return Session::get('UserID') != null;\n }", "public function isPosted()\n\t{\n\t\treturn (! empty($_POST['change_password']));\n\t}", "protected function _hasCookie($cookie_name)\n {\n\n if (!$this->request->hasCookie($cookie_name))\n {\n Cookie::queue(Cookie::forever($cookie_name, 1)); //Cookie::forever($cookie_name, '1');\n return false;\n }\n else\n {\n return true;\n }\n\n }", "function _checkCookies() {\n if(isset($_COOKIE)) {\n if(isset($_COOKIE['user'])) {\n $_SESSION['is_login'] = true;\n $_SESSION['userid'] = $_COOKIE['user'];\n }\n }\n }", "public function allowedToAndSetCookie(){\n\t\t$rechte_zum_sperren=$this->dbObj->sqlGet(\"select etchat_userprivilegien FROM {$this->_prefix}etchat_user where etchat_user_id = \".$_SESSION['etchat_'.$this->_prefix.'user_id']);\n\t\tif ($rechte_zum_sperren[0][0]!=\"admin\" && $rechte_zum_sperren[0][0]!=\"mod\"){\n\t\t\t$this->dbObj->sqlSet(\"DELETE FROM {$this->_prefix}etchat_useronline WHERE etchat_onlineuser_fid = \".$_SESSION['etchat_'.$this->_prefix.'user_id']);\n\t\t\tsetcookie(\"cookie_etchat_blacklist_until\", $this->user_bann_time, $this->user_bann_time, \"/\"); \n\t\t\tsetcookie(\"cookie_etchat_blacklist_ip\", $this->user_param_all, $this->user_bann_time, \"/\");\n\t\t\treturn true;\n\t\t}\n\t\telse return false;\n\t}", "public function hasPressedRegister(){\n if(isset($_POST[self::$RegisterID])){\n return true;\n }\n return null;\n }", "public function isAuthed() {\n return $this->state == 2;\n }", "function checkUserIdBL() {\n\t $isExisting = false;\n\t // If the user exists\n\t if ( checkUserIdDAL($_POST['userId']) )\n\t {\n\t\t $isExisting = true;\n\t }\n\t return $isExisting;\n }", "public static function checkAuthCookie()\n {\n foreach (self::get() as $value) {\n if ($value === null) {\n return false;\n }\n }\n\n return true;\n }", "public function authorize()\n {\n return !empty(session(\"borrower_id\"));\n }", "public function userCanSubmit() {\n\t\tglobal $content_isAdmin;\n\t\tif (!is_object(icms::$user)) return false;\n\t\tif ($content_isAdmin) return true;\n\t\t$user_groups = icms::$user->getGroups();\n\t\t$module = icms::handler(\"icms_module\")->getByDirname(basename(dirname(dirname(__FILE__))), TRUE);\n\t\treturn count(array_intersect($module->config['poster_groups'], $user_groups)) > 0;\n\t}", "public function isLogged(){\n return isset($_SESSION[\"user\"]);\n }", "public function getRemember() {\n\t\tif (isset($_POST['remember'])) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public static function exists($name){\n\t\treturn (isset($_COOKIE[$name])) ? true : false;\t\t\t\t// Returns similar to the session method for the name we have defined and see if the cookie has been set.\n\t}", "function formSubmitted()\n\t{\n\t\t// Do we have a form name? If so, if we have this form name, then this\n\t\t// particular form has been submitted.\n\t\tif ($this->formName) {\n\t\t\treturn (isset($_POST['update']) && $_POST['update'] == $this->formName);\t\n\t\t} \n\t\t// No form name, just detect our hidden field.\n\t\telse {\n\t\t\treturn (isset($_POST['update']));\n\t\t}\n\t}", "function auth()\n\t{\n\t\t$_aok_ = $_COOKIE['_aok_'];\n\t\tif (isset($_aok_))\n\t\t{\n\t\t\t$query = mysql_query(\"SELECT sessionId FROM auth WHERE sessionId = '$_aok_'\");\n\t\t\tif (mysql_num_rows($query) > 0)\n\t\t\t\treturn true;\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t}", "public function cookieExists(): bool\n {\n $result = true;\n if (empty($_COOKIE)) {\n $result = false;\n }\n return $result;\n }", "public function is_submit()\r\n {\r\n if( $this->taintedInputs->isAutogenerated()){\r\n return false;\r\n }\r\n else{\r\n return true;\r\n }\r\n }", "public function isLoggedIn() {\n $auth_cookie = Cookie::get(\"auth_cookie\"); //get hash from browser\n //check if cookie is valid\n if ($auth_cookie != '' && $this->cookieIsValid($auth_cookie)) {\n return true;\n } else {\n return false;\n }\n }", "function logged_in() \n {\n return isset($_SESSION['current_username']);\n }", "function hasValidPostUid()\n{\n $validState =\n isset($_POST[\"state\"]) && isUid($_POST[\"state\"]);\n \n $validSession =\n isset($_SESSION[\"state\"]) && isUid($_SESSION[\"state\"]);\n \n if($validState && $validSession)\n {\n return $_SESSION[\"state\"] == $_POST[\"state\"];\n }\n else\n {\n return false;\n }\n}", "public function loggedIn()\n {\n if ($this->userId) {\n return true;\n } else {\n return false;\n }\n }", "public function loggedIn()\n {\n return $this->user() != null;\n }", "public function is_remember_me() {\n\t\treturn ! empty( $this->data['remember_me'] );\n\t}", "public function cookieAction() {\n if($_COOKIE['tx_cookies_accepted'] && !$this->settings['showPermanent']) {\n return FALSE;\n }\n $this->view->assign('accepted', array_key_exists('tx_cookies_accepted', $_COOKIE) ? 1 : 0);\n $this->view->assign('disabled', array_key_exists('tx_cookies_disabled', $_COOKIE) ? 1 : 0);\n $this->view->assign('acceptedOrDisabled', ($_COOKIE['tx_cookies_accepted'] || $_COOKIE['tx_cookies_disabled']) ? 1 : 0);\n }", "public function isLoggedIn() {\n $cookie = $this->login();\n return $cookie != NULL;\n }", "public function isLoggedBack()\n {\n\t\t\n\t\t$cookie = Context::getInstance()->getCookie();\n\t\t$result = (\n\t\t\t$this->id && Validate::isUnsignedId($this->id) && $this->isAdmin() && self::checkPassword($this->id, $cookie->password, true) &&\n\t\t\t\t(!isset($cookie->remoteAddress) || ($cookie->remoteAddress == Tools::getNumericRemoteAddress()) || !Configuration::get('COOKIE_CHECKIP'))\n\t\t);\n\t\treturn $result;\n }", "public function logged_in() {\n return !empty($this->session->userdata('user_id'));\n }" ]
[ "0.72118604", "0.71154326", "0.7031866", "0.69686234", "0.6888283", "0.6815895", "0.6735054", "0.6731426", "0.67046565", "0.67029244", "0.67009705", "0.66374236", "0.66279674", "0.6625494", "0.66081625", "0.6590531", "0.6586224", "0.6576697", "0.65759504", "0.65754753", "0.65754753", "0.65453696", "0.6540743", "0.6539385", "0.65172166", "0.65155077", "0.65093714", "0.64719015", "0.6460001", "0.64464414", "0.64036936", "0.6402638", "0.6395564", "0.6388927", "0.637579", "0.6356278", "0.6349359", "0.63404155", "0.63379276", "0.63360447", "0.6334", "0.6331358", "0.63265514", "0.6313665", "0.6302329", "0.6300741", "0.62873596", "0.62771714", "0.626522", "0.6256145", "0.6249162", "0.62466234", "0.62335086", "0.62320226", "0.6229785", "0.6226947", "0.62260497", "0.62178755", "0.6206589", "0.6206522", "0.61999184", "0.6193662", "0.6189628", "0.61893994", "0.61780876", "0.6177652", "0.61740315", "0.6173204", "0.6166653", "0.6160297", "0.61563647", "0.61553526", "0.6154883", "0.61499643", "0.6149511", "0.61444205", "0.6132764", "0.6129534", "0.6122767", "0.6113802", "0.61121285", "0.61051804", "0.60994196", "0.6099413", "0.6098083", "0.6093687", "0.60881287", "0.60873014", "0.6082772", "0.6079386", "0.60689247", "0.60636365", "0.6063317", "0.60631335", "0.6061682", "0.6060914", "0.6056934", "0.605535", "0.6051984", "0.60513794" ]
0.7279888
0
Return current active promotion
public static function getActivePromotion() { $db = Denkmal_Db::get(); $id = $db->fetchOne('SELECT id FROM promotion p WHERE p.active=1 LIMIT 1'); if ($id) { return new Promotion ($id); } else { return false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getPromotion(){\n return $this->promotion;\n }", "public function firstActivePromotionByUserAndCode();", "public function promotional();", "public function promotion()\n {\n return $this->hasOne('App\\Entities\\Promotion', 'id_promotion', 'id_promotion');\n }", "public function getPromoted()\n {\n return $this->promoted;\n }", "public function getPromotioncode()\n {\n return $this->promotioncode;\n }", "public function getPromotionCode()\n {\n return $this->promotionCode;\n }", "public function getActive()\n {\n return $this->get(self::_ACTIVE);\n }", "public function getActive()\n {\n return $this->get('active', false);\n }", "public function promotional(bool $active = true)\n {\n $this->promotional = $active;\n\n return $this;\n }", "public function getPromotionCode()\r\n\t{\r\n\t\treturn $this->root->getAttribute('codepromo');\r\n\t}", "public function getActivo()\n {\n return $this->activo;\n }", "public function getActivo()\n {\n return $this->activo;\n }", "public function getActivo()\n {\n return $this->activo;\n }", "public function getActive()\n {\n return $this->active;\n }", "public function getActive()\n {\n return $this->active;\n }", "public function getActive()\n {\n return $this->active;\n }", "public function getActive()\n {\n return $this->active;\n }", "public function getActive()\n {\n return $this->active;\n }", "public function getActive()\n {\n return $this->active;\n }", "public function getActive()\n {\n return $this->active;\n }", "public function getActive()\n {\n return $this->active;\n }", "public function getActive()\n {\n return $this->active;\n }", "public function getActive()\n {\n return $this->active;\n }", "public function getActive()\n {\n return $this->active;\n }", "public function getActive()\n {\n return $this->active;\n }", "public function getActive()\n {\n return $this->active;\n }", "public function active($id){\n $active = Product::find($id)->active;\n return $active;\n }", "public function executePromotion(){\n if($this->isGotPromotion()){\n return $this->promotion->getPromotionPrice(); \n }\n }", "public function getActive()\n {\n return ($this->active === 1) ? __('Yes') : __('No');\n }", "public function getActive(){\n return $this->active;\n }", "public function getWgactive () {\n\t$preValue = $this->preGetValue(\"wgactive\"); \n\tif($preValue !== null && !\\Pimcore::inAdmin()) { \n\t\treturn $preValue;\n\t}\n\t$data = $this->wgactive;\n\treturn $data;\n}", "public function getActive() {\n\t\treturn $this->active;\n\t}", "public function getActive()\n {\n return $this->active;\n }", "public function getActive()\n {\n return $this->active;\n }", "public function get_current_interstitial() {\n\t\treturn $this->data['current'];\n\t}", "public function getActivo()\n {\n return $this->activo;\n }", "public function getActive() {\n return $this->_active;\n }", "public function getPromoText()\n {\n return isset($this->promo_text) ? $this->promo_text : '';\n }", "function getActive() { return $this->_active; }", "public function getPromotionAmount()\r\n\t{\r\n\t\treturn $this->root->getAttribute('mtpromo');\r\n\t}", "function getPromote()\n\t{\n\t\treturn $this->doPromote;\n\t}", "public function GetActive ();", "public function getTaggedPromoCode() {\n $id = $this->getAttribute('tagged_promocode', array());\n\n if (!empty($id)) {\n return Doctrine::getTable('PromoCode')->findOneBy('id', $id);\n }\n\n return false;\n }", "public function active()\n {\n return $this->get($this->theme);\n }", "public function getCurrentCharge()\n {\n return $this->current_charge;\n }", "function discount_active($discount_active=null)\n {\n if (isset($discount_active)) {\n $this->discount_active = (boolean)$discount_active;\n }\n return $this->discount_active;\n }", "public function getCurrent()\n\t{\n\t\treturn Mage::registry('current_product');\n\t}", "public function getProyectorActivo( ) {\n return $this->proyector_activo;\n\n }", "public function getIdPromocion()\n {\n return $this->id_promocion;\n }", "public function isGotPromotion()\n {\n return $this->promotion->checkCondition()?true:false;\n }", "public function getCurrentProduct()\n {\n return $this->_registry->registry('current_product');\n }", "public function getCurrentProduct()\n {\n return $this->_registry->registry('current_product');\n }", "public function getCurrentProduct()\n {\n return $this->_registry->registry('current_product');\n }", "function getActive() {\n\t\treturn $this->_Active;\n\t}", "public function isActive()\n {\n return $this->getActive();\n }", "function getActive() {return $this->_active;}", "public function getCurrent()\n {\n return $this->get(self::_CURRENT);\n }", "public function active() {\n return $this->hasOne('App\\Models\\Active');\n }", "public function actionPromotion(){\n $searchModel = new GoodsPromotionSearch();\n $dataProvider = $searchModel->search(ArrayHelper::merge(Yii::$app->request->queryParams, [$searchModel->formName() => [\n 'status' => GoodsPromotion::STATUS_ENABLE,\n ]]), 1);\n $pageSize = Yii::$app->request->get($dataProvider->Pagination->pageSizeParam);\n $dataProvider->Pagination->pageSize = $pageSize ? $pageSize : $dataProvider->Pagination->pageSize;\n \n $returnData = [\n 'data' => [],\n ];\n foreach ($dataProvider->getModels() as $model) {\n $returnData['data'] = $model->toArray();\n }\n \n if (isset($returnData['data']['json'])){\n $returnData['data'] = json_decode($returnData['data']['json']);\n }\n \n $returnData['page'] = [\n 'link' => $dataProvider->Pagination->getLinks(),\n 'totalCount' => $dataProvider->Pagination->totalCount,\n 'pageSize' => $dataProvider->Pagination->getPageSize(),\n 'pageCount' => $dataProvider->Pagination->getPageCount(),\n ];\n return $this->result(0,$returnData,'success');\n }", "public function getPromId()\n {\n return $this->prom_id;\n }", "public function activeCoupon($id)\n {\n $coupon = Coupon::where('cluster_id',$id)->where('is_expire','0')->first();\n if($coupon=='')\n {\n return 0;\n }\n else\n {\n return 1;\n }\n\n }", "public function demoActive()\n\t{\n\t\treturn $this->active;\n\t}", "public function isActive()\n {\n return $this->active;\n }", "public function getPromType()\n {\n return $this->prom_type;\n }", "public function getCurrentAmmo() {\n return $this->currentAmmo;\n }", "public function getSource()\n {\n return 'promo';\n }", "public function custompromotion() {\n\n $sessionstaff = $this->Session->read('staff');\n $options6['conditions'] = array('Promotion.clinic_id' => $sessionstaff['clinic_id'], 'Promotion.default' => 0, 'Promotion.is_lite' => 0,'Promotion.is_global'=>0);\n $Promotionlist = $this->Promotion->find('all', $options6);\n $this->set('Promotions', $Promotionlist);\n\n $checkaccess = $this->Api->accesscheck($sessionstaff['clinic_id'], 'Promotions');\n if ($checkaccess == 0) {\n $this->render('/Elements/access');\n }\n }", "public function isActive() {\n return $this->active;\n }", "public function getShowcase()\n {\n return $this->showcase;\n }", "public function getShowcase()\n {\n return $this->showcase;\n }", "function getActOn() {\n\t\treturn $this->_actOn;\n\t}", "public function active() {\n\n $data = array();\n $data['result'] = $this->property_model->fetchAll(getLoginUserId(), 1); // Approved\n $data['title'] = \"Active Properties\";\n \n $this->render('admin/property/active', $data);\n }", "static public function activated()\n {\n return self::$active;\n }", "public function userPromotion() {\n return $this->belongsTo(UserPromotion::class, 'promotion_id');\n }", "private function getCurrentPrimaryGoal() {\r\n $q = $this->db->select('collection_goal_id')\r\n ->from('collection_goals')\r\n ->where('landingpage_collectionid', $this->project)\r\n ->where('level', 1)\r\n ->where('status', 1)\r\n ->get();\r\n if ($q->num_rows() > 0) {\r\n $this->currentPrimaryGoalId = $q->row()->collection_goal_id;\r\n }\r\n }", "public function promoteAction()\n {\n return new ViewModel(array(\n \"pageTitle\" => \"Leetfeed | Promote and advertise your League of Legends videos\",\n \"noAds\" => true\n ));\n }", "public function getActivePresentationSummary()\n {\n if ($presentation = $this->getActivePresentation()) {\n return $presentation->getTitle();\n }\n\n return _t(__CLASS__ . '.NoActivePresentation', 'No presentation active');\n }", "public function current()\n {\n return $this->httpGet('cgi-bin/get_current_autoreply_info');\n }", "function htheme_promo_shortcode( $atts ) {\r\n\r\n\t\t#IF WOOCOMMERCE CLASS EXIST - ADD WOO VISUAL COMPOSER ELEMENTS\r\n\t\tif ( class_exists( 'WooCommerce' ) ){\r\n\t\t\t#SETUP WOO CONTENT CLASS\r\n\t\t\t$htheme_data = $this->htheme_woo_content->htheme_get_woo_promo($atts);\r\n\r\n\t\t\t#RETURN DATA/HTML\r\n\t\t\treturn $htheme_data;\r\n\t\t} else {\r\n\t\t\treturn 'WooCommerce required!';\r\n\t\t}\r\n\r\n\t}", "public function getActif()\n {\n return $this->actif;\n }", "public function getActif()\n {\n return $this->actif;\n }", "public function current()\n {\n return $this->parseJSON('get', [self::API_GET_CURRENT_SETTING]);\n }", "public function isActive()\n {\n return $this->active;\n }", "public function isActive()\n {\n return $this->active;\n }", "public function isActive()\n {\n return $this->active;\n }", "public function isActive()\n {\n return $this->active;\n }", "public function isActive()\n {\n return $this->active;\n }", "public function isActive()\n {\n return $this->active;\n }", "public function isActive()\n {\n return $this->active;\n }", "public function isActive()\n {\n return $this->active;\n }", "public function getIdCurrentApprover()\n {\n return $this->idCurrentApprover;\n }", "public function getActivite(): string\n {\n return (string) $this->activite;\n }", "public function getAllActivePromo($post)\n { \n\n $language = isset($post['language'])?$post['language']:'';\n $promo_type = isset($post['promo_type'])?$post['promo_type']:'';\n $device = isset($post['device'])?$post['device']:'1';\n $page = isset($post['page'])?$post['page']:'';\n $perPage = isset($post['perPage'])?$post['perPage']:'';\n $page = ((int)$page > 0 )? $page : 1;\n $perPage = ((int)$perPage > 0 )? $perPage : 0;\n $pageStart = ($page - 1) * $perPage;\n $time = time();\n\n \n $wherQuery = ' AND promo_list.status = 1 and promo_list.id = promo_list_display_language.promo_list_id and delete_status=0 and promo_list_display_language.language_code = \"'.$language.'\" ';\n\n if(!empty($device)){\n $wherQuery .= ' AND ( CASE WHEN promo_list.device != \"\" THEN FIND_IN_SET('.$device.',promo_list.device) ELSE 1 END ) ';\n }\n\n if(!empty($post['player_id'])){\n\n $player_id = $post['player_id'];\n\n $user = ( isset($post['user_info']) && !empty($post['user_info']) ) ? $post['user_info'] : $this->getUserInfo($player_id);\n\n $affiliate_id = $user['affiliate_id'] ?? 0;\n $player_id = $user['id'] ?? 0;\n $player_group_id = $user['player_group_id'] ?? 0;\n $mobile_verification_status = $user['mobile_verification_status'] ?? 0;\n $is__security_pin = $user['is__security_pin'] ?? 0;\n $is__bank = $user['is__bank'] ?? 0;\n $promo_block = $user['promo_block'] ?? 0;\n\n if(!empty($promo_block)){\n $wherQuery .= ' AND 0 ';\n }\n\n /*$wherQuery .= ' AND apply_type = 1 AND \n ( CASE \n WHEN promo_list.target_type = 2 THEN FIND_IN_SET(\\''.$affiliate_id.'\\', promo_list.target_list)\n WHEN promo_list.target_type = 3 THEN FIND_IN_SET(\\''.$player_id.'\\', promo_list.target_list) \n ELSE 1 END )';*/\n\n $wherQuery .= ' AND \n ( CASE \n WHEN promo_list.target_type = 2 THEN FIND_IN_SET(\\''.$affiliate_id.'\\', promo_list.target_list)\n WHEN promo_list.target_type = 3 THEN FIND_IN_SET(\\''.$player_id.'\\', promo_list.target_list) \n ELSE 1 END )';\n \n \n if(!empty($player_group_id)){\n $wherQuery .= ' AND \n ( CASE \n WHEN promo_list.member_level_list != \"\" THEN FIND_IN_SET(\\''.$player_group_id.'\\', promo_list.member_level_list)\n ELSE 1 END )\n ';\n }\n\n // $wherQuery .= ' AND \n // ( CASE \n // WHEN (promo_list.verify_details != \"\" AND FIND_IN_SET(1, promo_list.verify_details) AND '.$mobile_verification_status.' != 1 )\n // THEN 0 ELSE 1 \n // END )';\n\n // $wherQuery .= ' AND \n // ( CASE \n // WHEN (promo_list.verify_details != \"\" AND FIND_IN_SET(2, promo_list.verify_details) AND '.$is__security_pin.' = 0 )\n // THEN 0 ELSE 1 \n // END )';\n // $wherQuery .= ' AND \n // ( CASE \n // WHEN (promo_list.verify_details != \"\" AND FIND_IN_SET(3, promo_list.verify_details) AND '.$is__bank.' = 0)\n // THEN 0 ELSE 1 \n // END )';\n \n // $getAllAppliedPromos = $this->callSql(\"SELECT GROUP_CONCAT(DISTINCT promo_list_id SEPARATOR ',') FROM promo_activity_list WHERE player_id =\".$player_id.\" \", \"value\");\n // $wherFindSet = '';\n // if(!empty($getAllAppliedPromos)){\n // $explodeArr = explode(',',$getAllAppliedPromos);\n // $find_setCond = '';\n // foreach ($explodeArr as $key => $value) {\n // if(!empty($find_setCond)){\n // $find_setCond .= ' OR FIND_IN_SET('.$value.',promo_list.conflict_promos) ';\n\n // }\n // else{\n // $find_setCond .= ' FIND_IN_SET('.$value.',promo_list.conflict_promos) ';\n\n // }\n // }\n // if(count($explodeArr) > 1){\n // $wherFindSet .= ' AND ('.$find_setCond.')';\n // }\n // else{\n // $wherFindSet .= ' AND '.$find_setCond.'';\n // }\n // $wherQuery .= ' AND ( CASE \n // WHEN (promo_list.conflict_promos !=\"\" '.$wherFindSet.' ) THEN\n // 0 ELSE 1 \n // END ) ';\n // } \n \n }\n\n // if(!empty($game_type)){ \n // $wherQuery .= ' AND FIND_IN_SET(\"'.$game_type.'\",promo_list.game_types) ';\n // }\n if(!empty($promo_type)){ \n if(is_array($promo_type)) {\n $promo_type = join(\",\",$promo_type);\n }\n if($promo_type==9) {\n $wherQuery .= ' AND promo_list.promo_type =6 AND promo_list.promo_sub_type=1 '; \n }else{\n $wherQuery .= ' AND promo_list.promo_type IN ('.$promo_type.') '; \n }\n\n \n }\n \n // if(!empty($promo_text)){ \n // $wherQuery .= ' AND promo_list.promo_name LIKE \"%'.$promo_type.'%\" ';\n // }\n\n $query = 'SELECT ';\n $query .= ' promo_list.id,\n promo_list.promo_name,\n promo_list.promo_start_time,\n promo_list.promo_end_time,\n promo_list.promo_sub_type,\n promo_list.promo_type,\n promo_list.promo_name,\n promo_list.is_hot_promo,\n promo_list.apply_type,\n promo_list.game_selection_type,\n promo_list.game_vendors_wallet_id,\n promo_list_display_language.banner_1,\n promo_list_display_language.banner_2,\n promo_list_display_language.description_web,\n promo_list_display_language.description_h5,\n promo_list_display_language.description_app,\n promo_list_display_language.icon,\n CASE\n WHEN promo_list.display_type = 2 THEN promo_list.display_type_url\n ELSE \"\"\n END AS promo_url\n ';\n $query .= ' FROM promo_list,promo_list_display_language WHERE \n ( CASE \n WHEN (promo_list.display_time_type = 1) THEN \n ( CASE \n WHEN promo_list.promo_end_time != 0 THEN promo_list.promo_start_time <= '.$time.' AND (promo_list.promo_end_time) >= '.$time.' \n WHEN promo_list.promo_end_time = 0 THEN promo_list.promo_start_time <= '.$time.' \n ELSE 1\n END )\n WHEN promo_list.display_time_type = 2 THEN promo_list.manual_start_status = 1 \n WHEN promo_list.display_time_type = 3 THEN \n ( CASE \n WHEN promo_list.display_end_time != 0 THEN promo_list.display_start_time <= '.$time.' AND (promo_list.display_end_time) >= '.$time.' \n WHEN promo_list.display_end_time = 0 THEN promo_list.display_start_time <= '.$time.' \n ELSE 1\n END ) \n ELSE 1\n END ) '.$wherQuery.' ORDER BY promo_list.sort_order ASC ';\n\n if(!isset($post['limit']) && $perPage > 0)\n {\n $query .= ' LIMIT '.$pageStart.','.$perPage.''; \n \n } \n \n $this->query($query);\n\n $dataList = $this->resultset();\n \n return $dataList;\n }", "public function remove_promo()\n {\n $cart = $this->getService()->getSessionCart();\n\n return $this->getService()->removePromo($cart);\n }", "function pms_get_active_currency() {\r\n\r\n $settings = get_option( 'pms_payments_settings' );\r\n\r\n return !empty( $settings['currency'] ) ? $settings['currency'] : 'USD';\r\n\r\n }", "public function getApproved()\n {\n return $this->approved;\n }", "public function isActive()\n {\n return $this->getAttributeFromArray('active');\n }", "public function getIsActive()\n {\n if (array_key_exists(\"isActive\", $this->_propDict)) {\n return $this->_propDict[\"isActive\"];\n } else {\n return null;\n }\n }", "public function _getCurrentCompetition()\n {\n $competitions = Competition::all()->sortByDesc('created_at');\n\n foreach ($competitions as $competition) {\n if ($competition->status !== 'archived') {\n return $competition;\n }\n }\n return null;\n }" ]
[ "0.68302125", "0.67863417", "0.6392691", "0.6318216", "0.63011473", "0.61199224", "0.602108", "0.5939977", "0.5920957", "0.58922905", "0.58703107", "0.5864212", "0.5864212", "0.5864212", "0.5819607", "0.5819607", "0.5819607", "0.5819607", "0.5819607", "0.5819607", "0.5819607", "0.5819607", "0.5819607", "0.5819607", "0.5819607", "0.5819607", "0.5819607", "0.579551", "0.577724", "0.5763124", "0.5742955", "0.5727816", "0.5720712", "0.57187116", "0.57187116", "0.5715184", "0.5714634", "0.5662635", "0.56603587", "0.56428456", "0.5631972", "0.5606464", "0.5582267", "0.55721587", "0.55679864", "0.5567029", "0.55653256", "0.5556253", "0.5554251", "0.5547028", "0.55391127", "0.55390984", "0.55390984", "0.55390984", "0.55317754", "0.5488621", "0.54720235", "0.5461778", "0.5454977", "0.54335445", "0.5393063", "0.53914976", "0.5386961", "0.5363971", "0.53485984", "0.53406906", "0.5328345", "0.5320359", "0.53110915", "0.5310763", "0.5310763", "0.5307787", "0.53072214", "0.52971387", "0.5286134", "0.5274767", "0.5265795", "0.52504057", "0.52405435", "0.52358353", "0.523119", "0.523119", "0.5228329", "0.52255183", "0.52255183", "0.52255183", "0.52255183", "0.52255183", "0.52255183", "0.52255183", "0.52255183", "0.52254033", "0.522391", "0.5216382", "0.51941824", "0.51869404", "0.518683", "0.5186483", "0.51780456", "0.51620483" ]
0.8059824
0
Creates a new user.
public function actionCreate(string $username, string $name, string $email, string $password) { $user = new User(); $user->scenario = User::SCENARIO_CREATE; $user->username = $username; $user->password = $password; $user->name = $name; $user->email = $email; if ($user->save()) { return ExitCode::OK; } echo Console::errorSummary($user) . PHP_EOL; return ExitCode::UNSPECIFIED_ERROR; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function createUser();", "public function createUser();", "public function createUser();", "public function createUser();", "protected function _createUser()\n {\n $data = [\n 'email' => 'newuser@email.nl',\n 'password' => 'test',\n ];\n\n $user = $this->Users->newEntity($data);\n\n $user->set('active', true);\n $user->set('role_id', 1);\n\n $this->Users->save($user);\n }", "public function createUserAction() {\n $this->authService->createUser();\n die();\n }", "public function createUser()\n {\n\n $userCurrent = $this->userValidator->validate();\n $userCurrent['password'] = Hash::make($userCurrent['password']);\n $userCurrent = $this->user::create($userCurrent);\n $userCurrent->roles()->attach(Role::where('name', 'user')->first());\n return $this->successResponse('user', $userCurrent, 201);\n }", "public function createUser () {\n syslog( LOG_INFO, 'Create a Lineberty User \\n' );\n\n $url = '/users';\n\n return $this->runRequest($url, 'POST', null);\n }", "protected function createUser()\n {\n $this->question('Enter your details for the admin user.');\n\n $user = \\App\\User::create([\n 'name' => $this->ask('Name', 'Admin'),\n 'email' => $this->ask('Email address', 'noreply@'.str_replace(['http://', 'https://'], '', config('app.url'))),\n 'password' => Hash::make($this->ask('Password')),\n ]);\n \n $this->info(\"Admin user created successfully. You can log in with username {$user->email}\");\n }", "public function createAction()\r\n {\r\n $user = new User($_POST);\r\n\r\n if ($user->save()) {\r\n\t\t\t\r\n\t\t\tsession_regenerate_id(true);\r\n\r\n\t\t\t$_SESSION['user_id'] = User::getIdSavedUser($_POST['email']);\r\n\t\t\t\r\n\t\t\tIncome::saveDefaultIncomes($_SESSION['user_id']);\r\n\t\t\tExpense::saveDefaultExpenses($_SESSION['user_id']);\r\n\t\t\tPaymentMethod::saveDefaultPaymentMethods($_SESSION['user_id']);\r\n\t\t\t\r\n\t\t\t$user->sendActivationEmail();\r\n\r\n $this->redirect('/signup/success');\r\n\r\n } else {\r\n\r\n View::renderTemplate('Signup/new.html', [\r\n 'user' => $user\r\n ]);\r\n\r\n }\r\n }", "public function createUser()\n {\n }", "public function createUser()\n {\n $this->user = factory(Easel\\Models\\User::class)->create();\n }", "public function create()\n {\n return $this->userService->create();\n }", "public function createUser()\n {\n return User::factory()->create();\n }", "public function create()\n {\n $this->validate($this->request, User::createRules());\n\n $user = new User;\n $user->name = $this->request->name;\n $user->phone = $this->request->phone;\n $user->dob = $this->request->dob;\n $user->image = $this->request->image_path;\n $plainPassword = $this->request->password;\n $user->password = app('hash')->make($plainPassword);\n\n $user->save();\n\n //return successful response\n return $this->response(201,\"User\", $user);\n }", "public function create()\n\t{\n\t\tif (!isset($_POST) || empty($_POST))\n\t\t{\n\t\t\theader(\"Location: /myrecipe/users/registry\");\n\t\t\texit;\n\t\t}\n\t\t// TODO need to validate data\n\t\t$data = array('username' => $_POST['username'], 'password' => $_POST['password'], 'cpassword' => $_POST['cpassword'], 'email' => $_POST['email']);\n\t\t// validate the input data\n\t\t$errorArray = User::validates($data);\n\t\tif (count($errorArray))\n\t\t{\n\t\t\t// store errors in session and redirect\n\t\t\t$_SESSION['user'] = $data;\n\t\t\t$_SESSION['user']['errors'] = $errorArray;\n\t\t\theader(\"Location: /myrecipe/users/registry\");\n\t\t\texit;\n\t\t}\n\t\t// create a new user, assume all new users are not staff\n\t\t$values = array('username'=>$_POST['username'],'password'=>$_POST['password'],'email'=>$_POST['email'],'user_type'=>'1');\n\t\t$id = User::createUser($values);\n\t\t// log the user in\n\t\t$_SESSION['user']['id'] = $id;\n\t\t$_SESSION['user']['name'] = $_POST['username'];\n\t\t$_SESSION['user']['type'] = '1';\n\t\techo \"id = \" . $id;\n\t\theader(\"Location: /myrecipe/users/\" . $id);\n\t\texit;\n\t}", "public function createUser()\n {\n $this->user = factory(App\\Models\\User::class)->create();\n }", "public function createUser()\n {\n $this->user = factory(App\\Models\\User::class)->create();\n }", "public function store(UserCreateRequest $request)\n {\n\t\t\t$user = User::create([\n\t\t\t\t'name' \t\t\t\t=> $request->input('name'),\n\t\t\t\t'lastname' \t\t=> $request->input('lastname'),\n\t\t\t\t'idNumber'\t\t=> $request->input('idNumber'),\n\t\t\t\t'email' \t\t\t=> $request->input('email'),\n\t\t\t\t'phone' \t\t\t=> $request->input('phone'),\n\t\t\t\t'address' \t\t=> $request->input('address'),\n\t\t\t\t'birthdate' \t=> $request->input('birthdate'),\n\t\t\t\t'category_id' => $request->input('category_id'),\n\t\t\t\t'password'\t\t=> 'password', // I NEED TO ADD LOGIN FUNCTIONALITY\n\t\t\t\t'is_admin'\t\t=> 0,\n\t\t\t\t'status' \t\t\t=> 'non live' // As default in the db?\n\t\t\t]);\n\n\t\t\treturn redirect('/users')->with('success', 'User Registered');\n }", "public function create(User $user)\n {\n }", "public function create()\n\t{\n\t\t$user = new User;\n\n\t\t$user->username \t\t= Input::get('username');\n\t\t$user->password \t\t= Hash::make(Input::get('password'));\n\t\t$user->email \t\t \t= Input::get('email');\n\n\t\t$user->save();\n\n\t\treturn Redirect::to('user/add')->with('sukses', 'Data User Sudah Tersimpan');\n\t}", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "public function create(User $user)\n {\n //\n }", "private static function create()\n {\n getDb()->putUser(1, self::getDefaultAttributes());\n }", "public function test_it_creates_a_new_user()\n {\n $user = ['email' => 'me@andrewhook.uk', 'given_name' => 'Andrew', 'family_name' => 'Hook'];\n\n $this->json('POST', '/users', $user)\n ->seeJson($user);\n }", "public function newUser() {\n $this->checkValidUser();\n\n $this->db->sql = 'INSERT INTO '.$this->db->dbTbl['users'].' (username, salt, hash) VALUES (:username, :salt, :hash)';\n\n $salt = $this->getNewSalt();\n\n $res = $this->db->execute(array(\n ':username' => $this->getData('username'),\n ':salt' => $salt,\n ':hash' => md5($salt . $this->getData('password'))\n ));\n\n if($res === false) {\n $this->output = array(\n 'success' => false,\n 'key' => 'xxT5r'\n );\n } else {\n $this->output = array(\n 'success' => true,\n 'key' => 'dU4r5'\n );\n }\n\n $this->renderOutput();\n }", "public function create(User $user)\n {\n\n }", "protected function create()\n {\n// dd(request());\n // create new user in database\n $newUser = User::create([\n 'name' => \\request('name'),\n 'email' => \\request('email'),\n 'student_id' => \\request('student_id'),\n 'phone' => \\request('phone'),\n 'password' => bcrypt(\\request('password')),\n 'remember_token' => \\request('_token'),\n ]);\n\n\n //login the new user\n\n auth()->login($newUser);\n\n }", "public function create(UserCreateRequest $request): User\n {\n // TODO: Implement create() method.\n }", "protected function createUser()\n {\n $errors = $this->validate(['username','password','email','group_id']);\n\n if(count($errors) > 0)\n {\n $this->sendResponse([\n 'status' => 'failed',\n 'message' => 'Invalid data supplied',\n 'error' => $errors\n ]);\n }\n\n $arrUserData = [\n 'username' => $this->request->variable('username',''),\n 'user_password' => $this->request->variable('password',''), // already hashed by contao\n 'user_email' => $this->request->variable('email',''),\n 'group_id' => $this->request->variable('group_id',''),\n 'user_type' => USER_NORMAL\n ];\n\n // Create the user and get an ID\n $userID = user_add($arrUserData);\n\n // If user wasn't created, send failed response\n if(!$userID)\n {\n $this->sendResponse([\n 'status' => 'failed',\n 'message' => 'phpbb Could not create user',\n 'error' => ['Could not create phpBB user']\n ]);\n }\n\n // Send success response\n $this->sendResponse([\n 'status' => 'success',\n 'message' => 'phpBB user created',\n 'data' => [\n 'user_id' => $userID\n ]\n ]);\n }", "public function store(CreateUserRequest $request)\n {\n $data = $request->only('name', 'email', 'password');\n $data['password'] = Hash::make($data['password']);\n $data['user_type'] = $request->get('is_admin') ? User::$ADMIN : User::$DATAENTRANT;\n User::create($data);\n return redirect()->to('users')->withSuccess('User Account Created');\n }", "function createUser(){\n\t\t\tglobal $db;\n\t\t\tglobal $json;\n\t\t\t\n\t\t\t//Check if username meets minimum requirements\n\t\t\tif($this->username == \"\" || $this->username == null || strlen($this->username) < 6){\n\t\t\t\t$json->invalidMinimumRequirements(\"Username\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t\telse{\n\t\t\t//Check if username already exists\n\t\t\t\tif($db->query('SELECT * FROM user WHERE Username = \"'.$this->username.'\"')->rowCount() > 0){\n\t\t\t\t\t$json->exists(\"Username\");\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t//Check if password meets minimum requirements\n\t\t\tif($this->password == \"\" || $this->password == null || strlen($this->password) < 6){\n\t\t\t\t$json->invalidMinimumRequirements(\"Password\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$passHash = generatePassword($this->password);\n\t\t\t\t$this->password = $passHash;\n\t\t\t\t$apiHash = generateApiKey($this->username.\"\".date('Y-m-d'));\n\t\t\t}\n\t\t\t\n\t\t\t//Check if admin is empty or invalid, if so make user non-admin\n\t\t\tif($this->admin == \"\" || $this->admin == null || $this->admin < 0)\n\t\t\t\t$this->admin = 0;\n\t\t\t\n\t\t\tif($this->subject == \"\" || $this->subject == null || $this->subject < 0)\n\t\t\t\t$this->subject = 0;\n\t\t\t\t\n\t\t\t$insert = $db->prepare('INSERT INTO user VALUES (DEFAULT, :username, :password, :subject, :admin, :api)');\n\t\t\t$insert->bindParam(':username', $this->username);\n\t\t\t$insert->bindParam(':password', $this->password);\n\t\t\t$insert->bindParam(':subject', $this->subject);\n\t\t\t$insert->bindParam(':admin', $this->admin);\n\t\t\t$insert->bindParam(':api', $apiHash);\n\t\t\t\n\t\t\tif($insert->execute()){\n\t\t\t\t$json->created(\"User\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$json->server();\n\t\t\t\treturn;\n\t\t\t}\n\t\t}", "public function create ( Request $request )\n {\n\n\n if( $request->isMethod( 'post' ) )\n {\n\n try\n {\n\n $user = new User();\n $user->name = $request->input( 'name' );\n $user->email = $request->input( 'email' );\n $user->password = bcrypt( $request->input( 'password' ) );\n $user->save();\n\n }\n catch( Exception $ex ) \n {\n\n return(\n back()\n ->with(\n [\n 'flash_error' => 'Failed to create new user.',\n 'flash_exception' => $ex->getMessage()\n ]\n )\n );\n\n }\n\n return(\n back()\n ->with( [ 'flash_success' => 'New Users Added' ] )\n );\n\n }\n else\n {\n return(\n view('users.create')\n );\n }\n\n }", "public function createUser($name, $pass, $profile, array $extra = []);", "public function actionCreateUser()\n {\n $model = new User();\n if ($model->load(Yii::$app->request->post()) && $model->validate()) {\n\n $model->setPassword($model->password);\n $model->generateAuthKey();\n $model->generateEmailConfirmToken();\n if ($model->save()) {\n // нужно добавить следующие три строки:\n // $auth = Yii::$app->authManager;\n // $authorRole = $auth->getRole('superadmin');\n // $auth->assign($authorRole, $user->getId());\n return $this->redirect(['view-user', 'id' => $model->id]);\n }else{\n print_arr($model->errors);\n die('A');\n }\n } else {\n return $this->render('user/create', [\n 'model' => $model,\n ]);\n }\n }", "public function createUser()\n {\n $c = $this->getConnectionWithConfig('default');\n\n // First we create the record that we need to update\n $create = 'CREATE (u:User {name: $name, email: $email, username: $username})';\n // The bindings structure is a little weird, I know\n // but this is how they are collected internally\n // so bare with it =)\n $createCypher = $c->getCypherQuery($create, array(\n 'name' => $this->user['name'],\n 'email' => $this->user['email'],\n 'username' => $this->user['username'],\n ));\n\n return $this->client->run($createCypher['statement'], $createCypher['parameters']);\n }", "public function register( CreateUserRequest $request ) {\n // store the user in the database\n $credentials = $request->only( 'name', 'email', 'password');\n $credentials[ 'password' ] = bcrypt( $credentials[ 'password' ] );\n $user = User::create($credentials);\n\n // now wire up the provider account (e.g. facebook) to the user, if provided.\n if ( isset( $request['provider'] ) && isset( $request['provider_id'] ) && isset( $request['provider_token'] ) ) {\n $user->accounts()->save( new Account( [\n 'provider' => $request['provider'],\n 'provider_id' => $request['provider_id'],\n 'access_token' => $request['provider_token'],\n ] ) );\n }\n\n // return the JWT to the user\n $token = JWTAuth::fromUser( $user );\n return response( compact( 'token' ), 200 );\n }", "public function create(CreateUserRequest $request) {\n $user = $request->commit();\n\n //Trigger user edited event\n event(new UserCreated($user));\n\n //Reloads page\n return redirect()->action('Platform\\UserController@edit', $user)->with('alert', [\n 'type' => 'success',\n 'message' => 'User created'\n ]);\n }", "public function store(Requests\\CreateUserRequest $request)\n {\n $request->permission_id = $this->userRepository->getPermissionRepository()->getAll()->get(1)->id;\n $created = $this->userRepository\n ->create($request);\n\n if(!$created){\n return redirect('/users/systemusers')->withErrors('User creation failed.');\n }\n\n return redirect('/users/systemusers')->withMessage('New user has been created successfully.');\n }", "public function store(Requests\\CreateUserRequest $request)\n {\n $user = \\App\\User::create([\n 'name' => $request->name,\n 'email' => $request->email,\n 'bio' => $request->bio,\n 'password' => bcrypt($request->password)\n ])->attachRole($request->role);\n\n /**\n * Notifying user that he's account was created and that he can start using it\n */\n Notification::send([$user], new \\App\\Notifications\\AccountCreated());\n\n return redirect()->route('users.index')->with('success', 'User created successfully.');\n }", "public function creating(User $user)\n {\n\n }", "public function store(NewUserRequest $request)\n {\n $attribute = [\n 'name' => $request->name,\n 'email' => $request->email,\n 'password' => $request->password,\n 'address' => '',\n 'phone' => '',\n 'is_admin' => true,\n ];\n $users = $this->userRepository->create($attribute);\n\n Session::flash('success', @trans('message.success.user.create_user'));\n\n return redirect()->route('admin.user.index');\n }", "public function create(){\n \n $data = array();\n $data['login'] = $_POST['login'];\n $data['password'] = Hash::create('sha256', $_POST['password'], HASH_KEY);\n $data['role'] = $_POST['role'];\n \n //Do the Error checking\n \n $this->model->RunCreate($data);\n /*\n * After we Post the user info to create, the header is refereshed so that the data appears dynamically \n * below in the users list\n */\n header('location: ' . URL . 'users');\n }", "public function create() {\n\t\t$db = Database::getInstance();\n\t\t$stmt = $db->prepare(\"INSERT INTO users (id, mail, name, password, role, state) VALUES (?, ?, ?, ?, ?, ?)\");\n\t\t$stmt->execute(array($this->id, $this->mail, $this->name, $this->password, $this->role, $this->state));\n\t}" ]
[ "0.834464", "0.834464", "0.834464", "0.834464", "0.8189683", "0.797196", "0.7888541", "0.7783653", "0.7763519", "0.77421165", "0.768128", "0.7644952", "0.76059866", "0.7570852", "0.7568755", "0.7560788", "0.75462234", "0.75462234", "0.75300884", "0.75241375", "0.75212556", "0.74933445", "0.74933445", "0.74933445", "0.74933445", "0.74933445", "0.74933445", "0.74933445", "0.74933445", "0.74933445", "0.74933445", "0.74933445", "0.74933445", "0.74933445", "0.74933445", "0.74933445", "0.74933445", "0.74933445", "0.74933445", "0.74933445", "0.74933445", "0.74933445", "0.74933445", "0.74933445", "0.74933445", "0.74933445", "0.74933445", "0.74933445", "0.74933445", "0.74933445", "0.74933445", "0.74933445", "0.74933445", "0.74933445", "0.74933445", "0.74933445", "0.74933445", "0.74933445", "0.74933445", "0.74933445", "0.74933445", "0.74933445", "0.74933445", "0.74933445", "0.74933445", "0.74933445", "0.74933445", "0.74933445", "0.74933445", "0.74933445", "0.74933445", "0.74933445", "0.74933445", "0.74933445", "0.74933445", "0.74933445", "0.74933445", "0.74933445", "0.74933445", "0.74933445", "0.7492178", "0.74668205", "0.74635816", "0.7453401", "0.7442787", "0.7423845", "0.7402971", "0.7398871", "0.7391658", "0.7372502", "0.73702025", "0.7363175", "0.7354648", "0.73535013", "0.7338351", "0.7327443", "0.7301775", "0.7284163", "0.7277621", "0.7267093", "0.7259627" ]
0.0
-1
Renews password for an existing user.
public function actionPassword(string $username, string $password) { $user = User::findOne(['username' => $username]); if (empty($user)) { return ExitCode::NOUSER; } $user->scenario = User::SCENARIO_RENEW_PASSWORD; $user->password = $password; if ($user->save()) { return ExitCode::OK; } echo Console::errorSummary($user) . PHP_EOL; return ExitCode::UNSPECIFIED_ERROR; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function changePassword(User $user, string $newPassword): void;", "public function changeUserPassword($uid,$newPassword);", "public function changePassword(User $user){\n //username+emp-id+current-year\n $password = $user->username.$user->profile->emp_id.\\Carbon\\Carbon::now()->year;\n $user->update(['password' => $password]);\n return redirect()\n ->back()\n ->with('status','Password reseted');\n }", "function reset_password($user, $new_password = '') {\n // pr($user->salt,1)\n $this->db->set('password', $this->createPassword($new_password, $user->salt))->where('username', $user->username);\n return $this->db->update('cli_web_users');\n\n // return 1;\n }", "public function userPasswordUpdate() {\n $password = Hash::make($this->request->input(\"new_password\"));\n $updateArray = [\n \"password\" => $password\n ];\n $whereArray = [\n [\"user_id\", '=', $this->request->input(\"user_id\")]\n ];\n $this->usersModel->setTableName(\"cvd_users\");\n $this->usersModel->setInsertUpdateData($updateArray);\n $this->usersModel->setWhere($whereArray);\n $this->usersModel->updateData();\n }", "function reset_user_passwd($user_id) {\r\n\r\n //set the new password\r\n $new_passwd = \"newpasswod\";\r\n \r\n if ($new_passwd == false) {\r\n throw new Exception ('Could not generate the new password.');\r\n }\r\n \r\n //add numbers to the new passwd to increase the securtiy\r\n $rand_number = rand(0, 999);\r\n $new_passwd . $rand_number;\r\n \r\n //update the new passwd with db\r\n $conn = db_connect();\r\n\r\n $result = $conn->query(\"update users set user_passwd = sha1('\".$new_passwd.\"') where user_id = '\".$user_id.\"'\");\r\n if (!$result) {\r\n throw new Exception ('Could not reset the password.');\r\n }\r\n else {\r\n return true; \r\n }\r\n\r\n }", "public function testChangesAUsersPassword()\n {\n $user = factory(User::class)->create();\n $token = Password::createToken($user);\n $response = $this->post('/password/reset', [\n 'token' => $token,\n 'email' => $user->email,\n 'password' => 'password',\n 'password_confirmation' => 'password'\n ]);\n $this->assertTrue(Hash::check('password', $user->fresh()->password));\n }", "public function updatePassword(UserInterface $user);", "public function updatePassword()\n {\n $user = User::find(Database::connection(), $_SESSION['id']);\n\n // Update password\n return $user->updatePassword(Database::connection(), $_POST['password']);\n }", "function reset_password($username) {\n// return the new password or false on failure\n // get a random dictionary word b/w 6 and 13 chars in length\n $new_password = get_random_word(6, 13);\n\n if($new_password == false) {\n throw new Exception('Could not generate new password.');\n }\n\n // add a number between 0 and 999 to it\n // to make it a slightly better password\n $rand_number = rand(0, 999);\n $new_password .= $rand_number;\n\n // set user's password to this in database or return false\n $conn = db_connect();\n $result = $conn->query(\"update user\n set passwd = '\".$new_password.\"'\n where username = '\".$username.\"'\");\n if (!$result) {\n throw new Exception('Could not change password.'); // not changed\n } else {\n return $new_password; // changed successfully\n }\n}", "public function updatePassword(ExtendedUserInterface $user);", "public function activatenewpasswordAction()\n {\n $newKey = $this->getRequest()->getParam(self::ACTIVATION_KEY_PARAMNAME, null);\n $userId = $this->getRequest()->getParam(User::COLUMN_USERID, null);\n\n $user = $this->_getUserFromIdAndKey($userId, $newKey);\n if(!$user){\n Globals::getLogger()->info(\"New password activation: user retrieval failed - userId=$userId, key=$newKey\", Zend_Log::INFO );\n $this->_helper->redirectToRoute('usererror',array('errorCode'=>User::NO_SUCH_USER));\n }\n\n $user->{User::COLUMN_PASSWORD} = $user->newPassword;\n $user->newPassword = '';\n $user->activationKey = '';\n\n $id = $user->save();\n if($id != $user->{User::COLUMN_USERID}){\n $this->_helper->redirectToRoute('usererror',array('errorCode'=>User::NEWPASSWORD_ACTIVATION_FAILED));\n }\n\n Utils::deleteCookie(User::COOKIE_MD5);\n Utils::deleteCookie(User::COOKIE_USERNAME);\n Utils::deleteCookie(User::COOKIE_REMEMBER);\n\n $this->_savePendingUserIdentity($userId);\n\n $this->_helper->redirectToRoute('userupdate',array('newPassword'=>true));\n }", "protected function changePassword()\n {\n if (empty($this->password)) {\n return;\n }\n $this->validateOnly('password', ['password' => 'min:8|confirmed']);\n $this->user->update([\n 'password' => Hash::make($this->password),\n ]);\n $this->password = null;\n $this->password_confirmation = null;\n }", "public function changePasswordAction(){\n $data = $this->getRequestData();\n $user = Object_User::getById($this->getDeviceSession()->getUserId());\n if(isset($data['password']) && isset($data['repeat_password'])){\n if($data['password'] === $data['repeat_password']){\n $user->setPassword($data['password']);\n } else {\n $this->setErrorResponse('password and repeat_password should match!');\n }\n } else {\n $this->setErrorResponse('password and repeat_password is mandatory fields!');\n }\n $this->_helper->json(array('updated' => true));\n }", "public function changeAdminUserPassword() {\n\t\t$data = $this->request->data['User'];\n\n\t\t$this->User->id = $userId = $data['id'];\n\t\tif ($this->User->saveField('password', $data['new_password'])) {\n\t\t\t$isPasswordChanged = ($data['current_password'] !== $data['new_password']) ? true : false;\n\t\t\tif ($isPasswordChanged && ($userId !== $this->Auth->User('id'))) {\n\t\t\t\t$this->__sendPasswordChangedEmail($data);\n\t\t\t}\n\t\t\t$this->Session->setFlash(__('Password changed successfully.'), 'success');\n\t\t} else {\n\t\t\t$this->Session->setFlash(__('Could not change the password due a server problem, try again later.'), 'error');\n\t\t}\n\n\t\t$this->redirect('/admin/users/editAdmin/' . $userId);\n\t}", "protected function changePassword() {}", "function user_update_password($user, $newpassword) {\n $user = get_complete_user_data('id', $user->id);\n // This will also update the stored hash to the latest algorithm\n // if the existing hash is using an out-of-date algorithm (or the\n // legacy md5 algorithm).\n return update_internal_user_password($user, $newpassword);\n }", "public function setPassword($newPassword);", "private function resetPassword($user, $password)\n {\n $user->forceFill([\n 'password' => bcrypt($password)\n ])->save();\n }", "public function updatePassword($user){\n\t\tUser::where('id', $this->id)\n\t\t\t->update([\n\t\t\t\t'password' => bcrypt($user['password']),\n\t\t\t\t'updated_by' => $this->name,\n\t\t\t\t'updated_by' => Auth::user()->name\n\t\t]);\n\t}", "public function reset_password(User $user){\n $user->password = bcrypt('default');\n $user->save();\n return redirect()->back();\n }", "public function updatepassword()\n\t\t{\n\t\t\t$user = Session::get('loggedinuser');\n\t\t\t$userid = DB::table('users')->where('username', $user)->pluck('id');\n\t\t\t$updateduser = User::find($userid);\n\t\t\t$newpassword = Input::get('password');\n\t\t\tif($newpassword == Input::get('confirm')) {\n\t\t\t\t$updateduser->password = Hash::make($newpassword);\n\t\t\t\t$updateduser->save();\n\t\t\t\tSession::flash('successMessage', 'Password successfully updated');\n\t\t\t\treturn Redirect::action('UsersController@index');\n\t\t\t} else {\n\t\t\t\tSession::flash('errorMessage', 'Your passwords do not match!');\n\t\t\t\treturn Redirect::back();\n\t\t\t}\n\t\t}", "function user_changed_password($user_id, $new_password) {\n \n }", "protected function reset($user, $password)\n {\n // Change New Pass\n $user->password = $password;\n // We Reset Resent Count back to Zero\n $user->resent = 0;\n $user->save();\n }", "public function change()\r\n {\r\n// var_dump($this->validate());die;\r\n if ($this->validate()) {\r\n $user = $this->_user; \r\n $user->setPassword($this->newPwd);\r\n $user->removePasswordResetToken();\r\n return $user->save(false);\r\n }\r\n \r\n return false;\r\n }", "public function changePassword($user)\n {\n if (\\Gate::denies('create', 'user-respondent')) {\n return false;\n }\n\n $user->password = str_random(6);\n\n $user->save();\n\n $message = [\n 'flash_message'=> \\Lang::get('admin/users.new_password').'&nbsp;'\n .$user->password.'&nbsp;'.\\Lang::get('admin/users.successfully_created')\n ];\n\n return back()->with($message);\n }", "public function changePassword()\n {\n $this->validateOnly('password', [\n 'password' => 'bail|nullable|required_with:password_confirmation|string|confirmed',\n 'current_password' => 'bail|required',\n ]);\n\n if (!Hash::check($this->current_password, $this->user->password)) {\n $this->addError('current_password', 'Your current password is incorrect.');\n return;\n }\n\n $this->user->password = bcrypt($this->password);\n $this->user->save();\n $this->toast('Password has been changed!', 'success');\n $this->emit('password-updated');\n $this->reset(['password', 'password_confirmation', 'current_password']);\n }", "public function updatePassword(User $user) {\n if (UserController::isAuthorized() || $user->id == auth()->user()->id) {\n // form validation\n $this->validate(request(), [\n 'password' => 'required|min:8',\n ]);\n \n $user->password = bcrypt(request('password'));\n $user->updated_by = auth()->user()->id;\n $user->save();\n \n request()->session()->flash('success', 'Password updated!');\n return redirect()->back();\n }\n else {\n return view('unauthorized');\n }\n }", "function reset_password($user, $new_pass)\n {\n }", "public function modifpassword($user,$passwd){\n \n }", "public function doResetPassword()\n {\n // if user is logged in, do not let him access this page\n if( Session::isLoggedIn() )\n {\n SCMUtility::frontRedirectTo('?page=scmCourseModule&state=Front&action=myAccount');\n return;\n }\n\n $userID = SCMUtility::cleanText($_POST['userID']);\n $userNewPassword = SCMUtility::stripTags($_POST['new_reset_password']);\n\n // validate\n $validator = Validator::make(array('password'=>$userNewPassword),User::$rulesPasswordChange,User::$rulesMessages);\n\n if($validator->fails())\n {\n SCMUtility::setFlashMessage('Password reset failed. Error: '.$validator->messages()->first(),'danger');\n SCMUtility::frontRedirectTo('?page=scmCourseModule&state=Front&action=myAccount');\n return;\n }\n\n // update user password\n $user = User::find($userID);\n\n if( ! $user )\n {\n SCMUtility::setFlashMessage('Sorry, we cannot find any user associated with that email address.','danger');\n SCMUtility::frontRedirectTo('?page=scmCourseModule&state=Front&action=myAccount');\n return;\n }\n\n $user->password = $userNewPassword;\n $user->save();\n\n SCMUtility::setFlashMessage('Your password have been reset. You can now login using your new password.','success');\n SCMUtility::frontRedirectTo('?page=scmCourseModule&state=Front&action=myAccount');\n return;\n }", "public function password(){\r\n\r\n\t\t\t$user_info = Helper_User::get_user_by_id($this->user_id);\r\n\r\n\t\t\tif($_POST){\r\n\r\n\t\t\t\t$formdata = form_post_data(array(\"old_password\", \"new_password\", \"repeat_new_password\"));\r\n\t\t\t\t\r\n\t\t\t\t$old_password = trim($formdata[\"old_password\"]);\r\n\t\t\t\t$new_password = trim($formdata[\"new_password\"]);\r\n\t\t\t\t$repeat_new_password = trim($formdata[\"repeat_new_password\"]);\r\n\r\n\t\t\t\t$error_flag = false;\r\n\r\n\t\t\t\tif(strlen($old_password) <= 0){\r\n\t\t\t\t\t$error_flag = true;\r\n\t\t\t\t\tTemplate::notify(\"error\", \"Please enter the old password\");\r\n\t\t\t\t} else {\r\n\r\n\t\t\t\t\tif(strlen($new_password) > 0 && strlen($repeat_new_password) > 0){\r\n\t\t\t\t\t\t// if both fields are not empty\r\n\r\n\t\t\t\t\t\tif(strlen($new_password) < 6){\r\n\t\t\t\t\t\t\t// the password cannot be less than 6 characters\r\n\t\t\t\t\t\t\t$error_flag = true;\r\n\t\t\t\t\t\t\tTemplate::notify(\"error\", \"Too short password. Password must be at least 6 characters long.\");\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t// now compare the two new passwords\r\n\t\t\t\t\t\t\tif(strcmp($new_password, $repeat_new_password) !== 0){\r\n\t\t\t\t\t\t\t\t// both passwords are not same\r\n\t\t\t\t\t\t\t\t$error_flag = true;\r\n\t\t\t\t\t\t\t\tTemplate::notify(\"error\", \"New Passwords do not match. Please try again.\");\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tTemplate::notify(\"error\", \"Please enter the new password\");\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(!$error_flag){\r\n\t\t\t\t\t// means there are no any errors\r\n\t\t\t\t\t// get the current user account from the database\r\n\t\t\t\t\t// if the old password matches with the one that the user entered\r\n\t\t\t\t\t// change the password, else throw an error\r\n\r\n\t\t\t\t\t$old_password_hash = Config::hash($old_password);\r\n\r\n\t\t\t\t\tif(strcmp($old_password_hash, trim($user_info->password)) === 0){\r\n\r\n\t\t\t\t\t\t\tif($this->change_password($new_password, $user_info)){\r\n\t\t\t\t\t\t\t\tTemplate::notify(\"success\", \"Password changed successfully\");\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tredirect(Config::url(\"account\"));\r\n\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tTemplate::notify(\"error\", \"Wrong Old Password. Please try again\");\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tConfig::set(\"active_link\", \"password\");\r\n\t\t\tConfig::set(\"page_title\", \"Change Account Password\");\r\n\r\n\t\t\t$view_data[\"user_info\"] = $user_info;\r\n\r\n\t\t\tTemplate::setvar(\"page\", \"account/password\");\r\n\t\t\tTemplate::set(\"account/template\", $view_data);\r\n\t\t}", "public function actionChangePassword()\n {\n $username = $this->prompt(Console::convertEncoding(Yii::t('app', 'Username')) . ':', ['required' => true]);\n $model = $this->findModel($username);\n $model->setPassword($this->prompt(Console::convertEncoding(Yii::t('app', 'New password')) . ':', [\n 'required' => true,\n 'pattern' => '#^.{4,255}$#i',\n 'error' => Console::convertEncoding(Yii::t('app', 'More than {:number} symbols', [':number' => 4])),\n ]));\n $this->log($model->save());\n }", "function WP_update_user_password(WP_REST_Request $request){\n\n if ( !is_user_logged_in() )\n return new WP_Error( 'Not_Authorized', 'Invalid Token', array( 'status' => 404 ) );\n\n $oldPassword = $request['old_password'];\n $newPassword = $request['new_password'];\n $user = get_user_by( 'id', intval($request['user_id']) );\n\n if ( wp_check_password( $oldPassword, $user->user_pass, $request['id'] ) ) {\n wp_set_password( $newPassword, $request['id'] );\n return new WP_REST_Response([\n \"success\" => true,\n \"message\" => \"Password updated successfully.\"\n ]);\n }\n else\n return new WP_Error( \"wrong_old_password\", \"Old password doesn't match\", array( 'status' => 404 ) );\n\n }", "public function changePassword(){\n $user=User::find(auth()->id());\n $user->password=bcrypt(request('new_password'));\n $user->save();\n return response()->json('Password Updated Successfully');\n }", "protected function resetPassword($user, $password)\n {\n $user->password = bcrypt($password);\n $user->save();\n Auth::login($user);\n }", "protected function resetPassword($user, $password)\n {\n $user->password = bcrypt($password);\n $user->save();\n Auth::login($user);\n }", "protected function resetPassword($user, $password)\n {\n $user->password = bcrypt($password);\n $user->save();\n\n //Auth::login($user);\n }", "public function changePassword($username, $password);", "public function resetPassword()\n\t{\n\t\tif ($this->username) {\n\t\t\t$this->password = Util::generateRandomString(8);\n\t\t\t$user = User::model()->find('username=:user', array(':user' => $this->username));\n\t\t\tif (! $user ) return false;\n\t\t\t$user->password = $this->makePassword($this->username, $this->password); //a74895b303f1bd858fd5fd32d8904391\n\t\t\treturn $user->save();\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public function account_change_password()\n\t{\n\t\t$data = array('password' => $this->input->post('new_password'));\n\t\tif ($this->ion_auth->update($this->mUser->id, $data))\n\t\t{\n\t\t\t$messages = $this->ion_auth->messages();\n\t\t\t$this->system_message->set_success($messages);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$errors = $this->ion_auth->errors();\n\t\t\t$this->system_message->set_error($errors);\n\t\t}\n\n\t\tredirect('admin/panel/account');\n\t}", "function update_forgot_password($user, $token, $expires);", "function regiomino_user_change_password($account, $password) {\r\n\t//watchdog('pwdaction', '@password', array('@password' => $password));\r\n $edit['pass'] = $password;\r\n user_save($account, $edit);\r\n}", "function updatePassword($new_password, $user_id)\n {\n try {\n $pdo = parent::getPDO();\n $pdo->beginTransaction();\n $sql = \"UPDATE users SET password=? WHERE id=? ;\";\n $stmt = $pdo->prepare($sql);\n $stmt->execute(array($new_password, $user_id));\n\n $sql2 = \"DELETE FROM password_reset WHERE user_id = ? ;\";\n $stmt2 = $pdo->prepare($sql2);\n $stmt2->execute([$user_id]);\n\n $pdo->commit();\n return true;\n } catch (PDOException $e) {\n $pdo->rollBack();\n throw $e;\n }\n }", "public function changeUserPassword($request)\r\n {\r\n $user = $this->userRepo->where('id', '=', $request->get('user_id'))->first();\r\n if (!is_null($user)) {\r\n $current_password = $request->get('current_password');\r\n if (Hash::check($current_password, $user->password)) {\r\n try {\r\n if ($user->update(['password' => bcrypt($request->get('new_password'))])) {\r\n return $this->sendResponseMessage(200, \"Password Changed Successfully\");\r\n }\r\n } catch (\\Exception $e) {\r\n Log::error(\" Something went wrong while updating password\" . $e->getMessage());\r\n return $this->sendResponseMessage(500, \"Something went wrong. Please try again\");\r\n }\r\n }\r\n return $this->sendResponseMessage(406, \"User current password not match\");\r\n }\r\n return $this->sendResponseMessage(404, \"No User Found with such id\");\r\n }", "function mysql_auth_change_password($username,$password)\n{\n $encrypted = crypt($password,'$1$' . strgen(8).'$');\n return dbUpdate(array('password' => $encrypted), 'users', '`username` = ?', array($username));\n}", "public function autoUpdatePassword(int $userId, string $password): void\n {\n $user = $this->get($userId, ['fields' => ['id', 'password']]);\n $oldPassword = $user->get('password');\n $needsRehash = $this->getPasswordHasher()->needsRehash($oldPassword);\n if ($needsRehash) {\n $user->set('password', $password);\n $this->save($user);\n }\n }", "private function setEncryptPassword(){\n // Encode the new users password\n $encrpyt = $this->get('security.password_encoder');\n $password = $encrpyt->encodePassword($this->user, $this->user->getPassword());\n $this->user->setPassword($password);\n }", "public function setNewPassword($value) {\n\t\tif(!check($value)) throw new Exception(lang('error_92'));\n\t\tif(!Validator::AccountPassword($value)) throw new Exception(lang('error_92'));\n\t\t\n\t\t$this->_newPassword = $value;\n\t}", "public function resetAndUpdatePassword() {\n $this->validate ( $this->request, $this->getRules () );\n $user = User::where ( 'email', $this->request->email )->first ();\n \n if (!empty($user) && count ( $user->toArray() ) > 0) {\n $user->password = Hash::make ( (true) ? config()->get('app.user_password'): $this->generatePassword() );\n \n $user->save ();\n $this->email = $this->email->fetchEmailTemplate ( 'admin_forgot' );\n $this->email->subject = str_replace(['##SITE_NAME##'], [config ()->get ( 'settings.general-settings.site-settings.site_name' )], $this->email->subject);\n $this->email->content = str_replace (['##USERNAME##','##FORGOTPASSWORD##'],[$user->name,'admin123'],$this->email->content );\n $this->notification->email ( $user, $this->email->subject, $this->email->content );\n return true;\n } else {\n return false;\n }\n }", "public function changePassword($user, $password)\n {\n return $user->update(['password' => bcrypt($password)]);\n }", "public function account_change_password()\n\t{\n\t\t$user_session = $this->session->all_userdata();\n\t\t$user_id = $user_session['user_id'];\n\t\t\n\t\t// print_r($user_id);\n\t\t// die;\n\n\t\t$new_password = $this->input->post('new_password');\n\t\t$retype_password = $this->input->post('retype_password');\n\n\t\tif ($new_password != $retype_password)\n\t\t{\n\t\t\t$this->system_message->set_error(\"Password Miss Match\");\n\n\t\t}\n\t\telse{\n\t\t\t$data = array('password' => $this->input->post('new_password'));\n\t\t\tif (!empty($new_password) && !empty($retype_password))\n\t\t\t{\n\t\t\t\tif ($this->ion_auth->update($this->mUser->id, $data))\n\t\t\t\t{\n\t\t\t\t\t$this->custom_model->my_update(array('password_show'=>$new_password),array('id' => $user_id),'admin_users');\n\t\t\t\t\techo \"success\"; die;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\techo \"error\"; die;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\techo \"error\"; die;\n\t\t\t}\n\t\t}\n\t\t\n\t}", "public function changePassword(PasswordChangeForm $form, User $user);", "function wp_set_password( $password, $user_id ) {\n\t\tglobal $wpdb;\n\n\t\t$hash = wp_hash_password( $password );\n\n\t\t$wpdb->update(\n\t\t\t$wpdb->users,\n\t\t\t[\n\t\t\t\t'user_pass' => $hash,\n\t\t\t\t'user_activation_key' => '',\n\t\t\t],\n\t\t\t[\n\t\t\t\t'ID' => $user_id,\n\t\t\t]\n\t\t);\n\n\t\twp_cache_delete( $user_id, 'users' );\n\n\t\treturn $hash;\n\t}", "public function reset_password($user_id)\n\t{\n\t\t\n\t}", "private function update_password(User $user, UpdateUserRequest $request){\n if($request->input('password') != null){\n $user->update([\n 'password' => bcrypt($request->input('password'))\n ]);\n }\n }", "public function user_password_update(Request $request) {\n if ($request->password != $request->password_confirm) {\n return redirect()->back()->with('fail', 'Password does not match');\n }\n\n $user = User::where('id', $request->id)->first();\n $user->password = Hash::make($request->password);\n $user->save();\n return redirect()->route('user.dashboard')->with('success', 'Password Updated successfully');\n }", "public static function email_password_renew() {\n if ($u = static::check_record_existence()) {\n\n $m = auth_model();\n $u = $m::first(array('where' => 'id = \\'' . $u->id . '\\''));\n\n if ($u->emailPasswordRenew())\n flash('Email com as instruções para Renovação de senha enviado para ' . $u->email . '.');\n else\n flash('Algo ocorreu errado. Tente novamente mais tarde.', 'error');\n }\n\n go_paginate();\n }", "function reset(Request $request){\n $this->validate($request, [\n 'email' => 'required|email',\n 'password' => 'required|min:5',\n ]);\n\n $user = Auth::user();\n\n $checkoldpsswrd = array(\n 'email' => $request->get('email'),\n 'password' => $request->get('oldpassword'),\n );\n\n $newpass = array(\n 'password' => Hash::make($request->get('password')),\n );\n\n if(Auth::attempt($checkoldpsswrd)){\n $user->fill($newpass);\n $user->save();\n\n return redirect('login');\n }\n else{\n return back()->with('error', 'Wrong old password');\n }\n }", "public function changePassword()\n {\n if( ! Session::isLoggedIn() )\n {\n SCMUtility::frontRedirectTo('?page=scmCourseModule&state=Front&action=myAccount');\n return;\n }\n\n $user = User::find(Session::getCurrentUserID());\n\n View::make('templates/front/change-password.php',array());\n }", "public function resetPassword($user, $password)\n {\n require('../src/Service/PasswordService.php');\n $mysqlQuery = new mysqlQuery();\n $query = 'UPDATE users SET \n password = \\''.password_hash($password, PASSWORD_BCRYPT).'\\', \n passwordResetToken = \\'\\', \n passwordResetExpiration = \\'\\' \n WHERE username=\\''.$user.'\\'';\n $mysqlQuery->sqlQuery($query);\n }", "public function savePasswordToUser($user, $password);", "function update_password()\n {\n }", "public function Change_user_password() {\n\t\t$this->load->helper('pass');\n\t\t$user = $this->administration->getMyUser($this->user_id);\n\t\t//password\n\t\t$old_pass = $this->input->post('oldPassword');\n\t\t$newPass = $this->input->post('newPassword');\n\t\t$confirmNewPass = $this->input->post('confirmNewPassword');\n\t\tif($newPass == $confirmNewPass) {\n\t\t\t//check if old password is corrent\n\t\t\t$verify = $this->members->validateUser($user->Username,$old_pass);\n\t\t\tif($verify) {\n\t\t\t\t//validate if the password is in the correct format\n\t\t\t\t$valid_new_pass = checkPasswordCharacters($newPass);\n\t\t\t\tif($valid_new_pass) {\n\t\t\t\t\t$change_pass = $this->members->simple_pass_change($user->ID,$newPass);\n\t\t\t\t\tif($change_pass) {\n\t\t\t\t\t\techo '1';\n\t\t\t\t\t}else {\n\t\t\t\t\t\techo '6';\t\n\t\t\t\t\t}\n\t\t\t\t}else {\n\t\t\t\t\techo '7';\t\n\t\t\t\t}\n\t\t\t}else {\n\t\t\t\techo '8';\t\n\t\t\t}\n\t\t}else {\n\t\t\techo '9';\t\n\t\t}\n\t}", "public function setPassword($userid, $password);", "public function updateUserPassword( User $user ) {\n\t\t$this->passwordManager->hashPassword( $user );\n\t\t$user->setConfirmationToken( null );\n\t\t$user->setPasswordRequestedAt( null );\n\t}", "public function postChangedUserPassword(User $user)\n {\n $validatedData = request()->validate(User::$passResetRules);\n\n $user->update($validatedData);\n \n return redirect()->route('users.index')->with('form_success', 'User\\'s password has been successfully changed.');\n }", "function user_changed_password($user_id, $new_password)\n\t{\n\t}", "public function reset_password($id)\n\t{\n\t\t$new_password = \\Str::random('alnum', 8);\n\t\t$password_hash = $this->hash_password($new_password);\n\n\t\t$affected_rows = \\DB::update(\\Config::get('uniauth.table_name'))\n\t\t\t->set(array(static::_column('password') => $password_hash))\n\t\t\t->where(static::_column('id'), '=', $id)\n\t\t\t->where(static::_column('activated_at'), '!=', null)\n\t\t\t->where(static::_column('deleted_at'), '=', null)\n\t\t\t->execute(\\Config::get('uniauth.db_connection'));\n\n\t\tif ( ! $affected_rows)\n\t\t{\n\t\t\tthrow new \\UniUserUpdateException('Failed to reset password, user was invalid.', 8);\n\t\t}\n\n\t\treturn $new_password;\n\t}", "public function changePassword(ICrugeStoredUser $user, $newPassword)\r\n {\r\n $epwd = $newPassword;\r\n if (CrugeUtil::config()->useEncryptedPassword == true) {\r\n $epwd = CrugeUtil::hash($newPassword);\r\n }\r\n $user->password = $epwd;\r\n }", "public function updatepassword() {\n $request = Request::all();\n $rules = ['old_password' => 'required', 'password' => 'required|confirmed|min:6'];\n $v = Validator::make($request, $rules);\n if ($v->fails()) {\n return redirect()->back()->withErrors($v->errors());\n }\n $user = User::find(Auth::user()->id);\n if (!Hash::check($request['old_password'], $user->password)) {\n return redirect()->back()->withErrors([\"old_password\" => [0 => \"The old password does not match.\"]]);\n }\n\n $user->password = bcrypt($request['password']);\n $user->save();\n return redirect()->back()->with('status', 'Your password changed succesfully');\n }", "public function post_password()\n\t{\n\t\t$input = Input::all();\n\t\t$rules = array(\n\t\t\t'current_password' => array(\n\t\t\t\t'required',\n\t\t\t),\n\t\t\t'new_password' => array(\n\t\t\t\t'required',\n\t\t\t\t'different:current_password',\n\t\t\t),\n\t\t\t'confirm_password' => array(\n\t\t\t\t'same:new_password',\n\t\t\t),\n\t\t);\n\n\t\tif (Auth::user()->id !== $input['id']) return Response::error('500');\n\n\t\t$val = Validator::make($input, $rules);\n\n\t\tif ($val->fails())\n\t\t{\n\t\t\treturn Redirect::to(handles('orchestra::account/password'))\n\t\t\t\t\t->with_input()\n\t\t\t\t\t->with_errors($val);\n\t\t}\n\n\t\t$msg = Messages::make();\n\t\t$user = Auth::user();\n\n\t\tif (Hash::check($input['current_password'], $user->password))\n\t\t{\n\t\t\t$user->password = $input['new_password'];\n\n\t\t\ttry\n\t\t\t{\n\t\t\t\tDB::transaction(function () use ($user)\n\t\t\t\t{\n\t\t\t\t\t$user->save();\n\t\t\t\t});\n\n\t\t\t\t$msg->add('success', __('orchestra::response.account.password.update'));\n\t\t\t}\n\t\t\tcatch (Exception $e)\n\t\t\t{\n\t\t\t\t$msg->add('error', __('orchestra::response.db-failed'));\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$msg->add('error', __('orchestra::response.account.password.invalid'));\n\t\t}\n\n\t\treturn Redirect::to(handles('orchestra::account/password'));\n\t}", "public function password(UserRequest $request)\n {\n\t\t// Validate the request\n \t$request->validated();\n\n\n \t// Change the password\n\t\ttry {\n\n\t \t$request->user()->fill([\n\t 'password' => Hash::make($request->password)\n\t ])->save();\n\n\n // Send notification\n $request->user()->notify( new PasswordChangeConfirmation() );\n\n return response(['message' => 'Your account password has been successfully changed.'], 200);\n \n } catch (Exception $e) {\n return response(['message' => $e->getMessage()], 500);\n }\n }", "public function testUserPassword() {\n\t\t// make new User and save it to the database\n\t\t$newPassword = Generate::hash();\n\n\t\t// change the User password\n\t\t$this->visit('/home')\n\t\t\t->click('#user-update-button')\n\t\t\t->seePageIs('/user/update')\n\t\t\t->click('Change Password')\n\t\t\t->seePageIs('/user/password')\n\t\t\t->type($this->password, 'old_password')\n\t\t\t->type($newPassword, 'password')\n\t\t\t->type($newPassword, 'password_confirmation')\n\t\t\t->press('Change Password')\n\t\t\t->seePageIs('/home')\n\t\t\t->see('Your password was changed successfully!')\n\t\t\t->click('Logout')\n\t\t\t->seePageIs('/');\n\n\t\t// test a regular User's login with the new password\n\t\t// TODO: check the database instead of testing the login process\n\t\t$this->visit('/')\n\t\t\t->click('#login-button')\n\t\t\t->seePageIs('/login')\n\t\t\t->type($this->User->email, 'email')\n\t\t\t->type($newPassword, 'password')\n\t\t\t->press('Login')\n\t\t\t->seePageIs('/home')\n\t\t\t->within('#nav', function() {\n\t\t\t\t$this->see('Logout')\n\t\t\t\t\t->dontSee('Login')\n\t\t\t\t\t->dontSee('Admin');\n\t\t\t});\n\t}", "public function setNewPassword()\n {\n PasswordResetModel::setNewPassword(\n Request::post('user_name'), Request::post('user_password_reset_hash'),\n Request::post('user_password_new'), Request::post('user_password_repeat')\n );\n Redirect::to('index');\n }", "public function update_password($id, $password);", "public function action()\n {\n $user = $this->user();\n $data = $this->validated();\n \n $user->forceFill([\n 'password' => Hash::make($data['password']),\n ])->save();\n }", "public function resetPassword($userId) {\n $this->clearCache($userId);\n $password = hash('crc32', rand());\n\n $userInfo = $this->db->findOne(array('_id' => $this->_toMongoId($userId)));\n $this->db->update(array('_id' => $this->_toMongoId($userId)),\n array('$set' => array('password' => $this->hash($password, $userInfo['username']))));\n \n return $password;\n }", "Public Function changePassword($NewPassword)\n\t{\n\t\t$this->_db->exec(\"UPDATE bevomedia_user SET Password = md5('$NewPassword') WHERE ID = $this->id\");\n\t}", "function eventUpdatePassword(){\r\n\t\t$userid = util::getData(\"id\");\r\n\t\t$password1 = util::getData(\"password1\");\r\n\t\t$password2 = util::getData(\"password2\");\r\n\r\n\t\tif(!$this->canUpdateUser($userid))\r\n\t\t\treturn $this->setEventResult(false, \"You cannot update this account\");\r\n\r\n\t\t$result = dkpAccountUtil::SetOfficerAccountPassword($this->guild->id, $userid, $password1, $password2);\r\n\r\n\t\tif($result != dkpAccountUtil::UPDATE_OK)\r\n\t\t\t$this->setEventResult(false, dkpAccountUtil::GetErrorString($result));\r\n\t\telse\r\n\t\t\t$this->setEventResult(true,\"Password Changed!\");\r\n\r\n\t}", "public function update_passwords( $args = array(), $assoc_args = array() ) {\n\t\t$this->process_args(\n\t\t\tarray(\n\t\t\t\t0 => '' // New password.\n\t\t\t),\n\t\t\t$args,\n\t\t\tarray(\n\t\t\t\t'blog_id' => '',\n\t\t\t\t'role' => '',\n\t\t\t\t'exclude' => '',\n\t\t\t\t'include' => '',\n\t\t\t),\n\t\t\t$assoc_args\n\t\t);\n\n\t\t$new_password = $this->args[0];\n\n\t\t$reset_passwords = false;\n\n\t\tif ( isset( $this->assoc_args['reset'] ) ) {\n\t\t\t$reset_passwords = true;\n\t\t}\n\n\t\tif ( ! $reset_passwords && empty( $new_password ) ) {\n\t\t\tWP_CLI::error( __( 'Please, provide a new password for the users', 'mu-migration' ) );\n\t\t}\n\n\t\t$send_email = false;\n\n\t\tif ( isset( $this->assoc_args['send_email'] ) ) {\n\t\t\t$send_email = true;\n\t\t}\n\n\t\t$users_args = array(\n\t\t\t'fields' => 'all',\n\t\t\t'role' => $this->assoc_args['role'],\n\t\t\t'include' => ! empty( $this->assoc_args['include'] ) ? explode( ',', $this->assoc_args['include'] ) : array(),\n\t\t\t'exclude' => ! empty( $this->assoc_args['exclude'] ) ? explode( ',', $this->assoc_args['exclude'] ) : array(),\n\t\t);\n\n\t\tif ( ! empty( $this->assoc_args['blog_id'] ) ) {\n\t\t\t$users_args['blog_id'] = (int) $this->assoc_args['blog_id'];\n\t\t}\n\n\t\t$users = get_users( $users_args );\n\n\t\tforeach ( $users as $user ) {\n\n\t\t\tif ( $reset_passwords ) {\n\t\t\t\t$new_password = wp_generate_password( 12, false );\n\t\t\t}\n\n\t\t\twp_set_password( $new_password, $user->data->ID );\n\n\t\t\tWP_CLI::log( sprintf( __( 'Password updated for user #%d:%s', 'mu-migration' ), $user->data->ID, $user->data->user_login ) );\n\n\t\t\tif ( $send_email ) {\n\t\t\t\t$this->send_reset_link( $user->data );\n\t\t\t}\n\t\t}\n\t}", "public function actionChangepassword()\n\t{\n\t\t// using the default layout 'protected/views/layouts/main.php'\n\t\t\n\t\t\n\t\t$this->checkUser();\n\t\t\n\t\t$record = SiteUser::model()->findByAttributes(array('id'=> Yii::app()->user->id));\n\t\n\t\tif(isset($_POST['SiteUser']))\n\t\t{\t\n\t\t\tif(trim($_POST['SiteUser']['password']) != '') {\n\t\t\t\t$record->password = $_POST['SiteUser']['password'];\n\t\t\t\t\n\t\t\t} \t\t\n\t\t\tif(trim($_POST['SiteUser']['password']) == trim($_POST['SiteUser']['repeat_password'])) {\n\t\t\t\t$record->repeat_password = $record->password;\n\t\t\t}\t\n\t\t\t\n\t\t\tif($record->validate()) {\n\t\t\t\t$record->repeat_password = $record->password = crypt($record->password);\n\t\t\t\tif($record->save())\n\t\t\t\t\t$this->redirect(array('personal'));\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$record->repeat_password = $record->password = '';\n\t\t\t}\n\n\t\t}\t\n\n\t\t$this->render('changepassword',array('record'=>$record));\n\t}", "public function change_password() {\n\t\tif (!empty($this->request->data)) {\n\t\t\t$this->request->data['User']['id'] = $this->Auth->user('id');\n\t\t\tif ($this->User->changePassword($this->request->data)) {\n\t\t\t\t$this->Session->setFlash(__('Password changed.', true));\n\t\t\t\t$this->redirect('/');\n\t\t\t}\n\t\t}\n\t}", "function reset_password($username)\n// set password for username to a random value\n// return the new password or false on failure\n{\n $new_password = getRandomWord();\n if ($new_password == false)\n throw new Exception('Could not generate new password.');\n // add a number between 0 and 999 to it\n // to make it a slightly better password\n srand((float) microtime() * 1000000);\n $rand_number = rand(0, 999);\n $new_password .= $rand_number;\n // set users password to this in database or return false\n $conn = db_connect();\n $result = $conn->query(\"update user set passwd = sha1('$new_password')where username = '$username'\");\n if (!$result)\n throw new Exception('Could not change password.');\n // not changed\n else\n return $new_password;\n // changed successfully\n}", "protected function _updatePassword() {\n\t\tif(!check($this->_userid)) return;\n\t\tif(!check($this->_username)) return;\n\t\tif(!check($this->_newPassword)) return;\n\t\tif($this->_md5Enabled) {\n\t\t\t$data = array(\n\t\t\t\t'userid' => $this->_userid,\n\t\t\t\t'username' => $this->_username,\n\t\t\t\t'newpassword' => $this->_newPassword\n\t\t\t);\n\t\t\t$query = \"UPDATE \"._TBL_MI_.\" SET \"._CLMN_PASSWD_.\" = [dbo].[fn_md5](:newpassword, :username) WHERE \"._CLMN_MEMBID_.\" = :userid\";\n\t\t} else {\n\t\t\t$data = array(\n\t\t\t\t'userid' => $this->_userid,\n\t\t\t\t'newpassword' => $this->_newPassword\n\t\t\t);\n\t\t\t$query = \"UPDATE \"._TBL_MI_.\" SET \"._CLMN_PASSWD_.\" = :newpassword WHERE \"._CLMN_MEMBID_.\" = :userid\";\n\t\t}\n\t\t\n\t\t$result = $this->db->query($query, $data);\n\t\tif(!$result) return;\n\t\t\n\t\treturn true;\n\t}", "private function __changePassword() {\n\t\t$data = $this->request->data['User'];\n\t\t$this->User->id = $this->Auth->user('id');\n\t\tif ($this->User->saveField('password', $data['new_password'])) {\n\t\t\t$this->Session->setFlash(__('Your password changed successfully.'), 'success');\n\t\t\t$this->redirect($this->referer());\n\t\t} else {\n\t\t\t$this->Session->setFlash(__('Could not change your password due to a server problem, try again later.'), 'error');\n\t\t}\n\t}", "function change_passwd($Username, $old_Password, $new_Password){\n $new_Password = encrypt_pwd($new_Password);\n $SQL = \"UPDATE User SET Password = '$new_Password' WHERE Username='$Username'\";\n mysqli_query($this->db_link, $SQL);\n }", "protected function resetPassword($user, $password)\n {\n $user->setPassword($password);\n Auth::login($user);\n }", "public function setPassword($newPassword){\n\t}", "public static function reset_password( $user, $new_pass ) {\n\t\tdo_action( 'password_reset', $user, $new_pass );\n\t\twp_set_password( $new_pass, $user->ID );\n\t\tself::set_reset_password_cookie();\n\t\twp_password_change_notification( $user );\n\t}", "public function password_reset($user, $new_pass) {\n\t\tglobal $phpbbForum;\n\t\t\n\t\tif($this->get_setting('integrateLogin')) {\n\t\t\t$wpData = get_userdata($user->ID);\n\t\t\t\n\t\t\t//user phpBB password format for syncing\n\t\t\tset_var($phpbbPass, stripslashes($new_pass), 'string', true);\n\t\t\t$wpData->data->user_pass = wp_hash_password($phpbbPass);\n\t\t\t\n\t\t\t$phpbbID = wpu_get_integrated_phpbbuser($userID);\n\t\t\tif($phpbbID) {\n\t\t\t\twpu_sync_profiles($wpData, $phpbbForum->get_userdata('', $phpbbID), 'wp-update', false); \n\t\t\t}\n\t\t}\n\t}", "public function changePassword(Request $request, User $user)\n {\n $this->validate($request, [\n \"password\" => \"required|string|min:8|max:25|confirmed\",\n ]);\n $data = [\n \"password\" => bcrypt($request->password),\n ];\n\n if ($user->update($data)) {\n Toastr::success('Successfully Password Changed', \"Success\");\n } else {\n Toastr::error('Something Went Wrong!', \"Error\");\n }\n return redirect()->back();\n }", "public function updatePassword(Request $request, User $user){\n \n $this->validate($request, [\n 'current_password' => 'required|min:8',\n 'new_password' => 'required|min:8|same:new_password_confirmation',\n 'new_password_confirmation' => 'required|min:8'\n ]);\n\n if(app('hash')->check($request->current_password, $user->password)){\n\n $user->password = bcrypt($request->new_password);\n $user->save();\n\n session()->flash('success','Palavra-passe actualizada com sucesso!');\n\n }else{\n\n session()->flash('warning','Palavra-passe actual nao coincide!');\n \n }\n\n return redirect()->back();\n }", "public function testUpdatePasswordNotGiven(): void { }", "public function changePassword(Request $request)\n\t {\n $validatedData = $request->validate([\n 'password' => 'min:8|required',\n 'new_password' => 'min:8|required'\n ]);\n\n $user = User::where('email', $request->user()->email )->first();\n\n if (!$user || !Hash::check($request->password, $user->password)) {\n return response([\n 'message' => ['These credentials do not match our records.']\n ], 404);\n }\n\n $user->password = $request->new_password;\n $user->save();\n return new UserResource($user);\n }", "public function changepassAction()\n {\n $user_service = $this->getServiceLocator()->get('user');\n\n $token = $this->params()->fromRoute('token');\n $em = EntityManagerSingleton::getInstance();\n $user = null;\n\n if ($this->getRequest()->isPost())\n {\n $data = $this->getRequest()->getPost()->toArray();\n $user = $em->getRepository('Library\\Model\\User\\User')->findOneByToken($token);\n\n if (!($user instanceof User))\n {\n throw new \\Exception(\"The user cannot be found by the incoming token\");\n }\n\n $user_service->changePassword($data, $user);\n $em->flush();\n }\n\n return ['user' => $user];\n }", "public function setPassword(Request $request, User $user)\n {\n $request->validate([\n 'current_password' => ['required',new MatchOldPassword],\n 'new_password' => ['required'],\n 'new_confirm_password' => ['same:new_password'],\n ]);\n\n //$user->roles()->sync($request->roles);\n $user->password = Hash::make($request->new_password);\n $user->save();\n return redirect()->back()->with('success',\"Password change successfully.\");\n }", "public function generate_new_passwords() {\n // all users added with \"password\" will be automatically sent a welcome message\n // and new password\n $resetpassword = 'password'; \n // get users\n $user_list = $this->get_user->get_all_users();\n // go through users \n foreach($user_list as $user) {\n // check if password is \"password\"\n $user_id = $user->user_id;\n if ($this->get_user->check_password($user_id, $resetpassword) == 1) {\n // generate simple random password\n $newpassword = uniqid();\n // write new password to database\n $data = array(\n 'password' => $newpassword\n );\n $this->get_user->update('user_id', $user_id, $data);\n // email user new password \n $this->send_password_mail($user_id, $newpassword);\n }\n \n }\n \n \n }", "public function selfChangePassword()\n\t{\n\t\tif (!$this->userService->changePassword(Input::all()))\n\t\t{\n\t\t\treturn Redirect::route('user-profile', array('tab' => 'account'))->withErrors($this->userService->errors())->withInput();\n\t\t}\n\n\t\tAlert::success('Your password has been successfully changed.')->flash();\n\n\t\treturn Redirect::route('user-profile', array('tab' => 'account'));\n\t}", "public function update()\n {\n /** @var Form $form */\n $form = FormBuilder::create(UserSettingsForm::class);\n\n if (!$form->isValid()){\n return redirect()->back()->withErrors($form->getErrors())->withInput();\n }\n\n $data = $form->getFieldValues();\n $data['password'] = bcrypt($data['password']);\n Auth::user()->update($data);\n\n flash('Password changed with success!')->success()->important();\n return redirect()->route('admin.users.settings.edit');\n }", "public function regeneratePassword(string $email): void;" ]
[ "0.71134096", "0.69108707", "0.6904912", "0.687639", "0.6865967", "0.6852503", "0.67404926", "0.67286545", "0.67117757", "0.6689554", "0.66810983", "0.6667867", "0.6595945", "0.6581763", "0.6575257", "0.6574538", "0.657442", "0.65486795", "0.6535549", "0.65301645", "0.6522917", "0.65041983", "0.64837164", "0.6479522", "0.6478339", "0.6439847", "0.6437416", "0.6436072", "0.64267844", "0.6425482", "0.6413034", "0.6412811", "0.64071125", "0.6402649", "0.6393474", "0.63855827", "0.63855827", "0.6384434", "0.6367084", "0.63653517", "0.6362977", "0.6355536", "0.6352242", "0.6349756", "0.63493514", "0.63330716", "0.6319586", "0.6318654", "0.63184047", "0.63178945", "0.6316272", "0.6315862", "0.63135064", "0.63077986", "0.6307014", "0.6285134", "0.6283365", "0.6272055", "0.6263663", "0.62615", "0.62563807", "0.625147", "0.6249847", "0.6238487", "0.62250066", "0.62162626", "0.6213095", "0.62097347", "0.6206757", "0.6205102", "0.61991656", "0.6197263", "0.619164", "0.6189915", "0.6185527", "0.61855173", "0.6177389", "0.6169582", "0.6161272", "0.6160722", "0.61451626", "0.61434644", "0.6142911", "0.61415285", "0.61384344", "0.6135545", "0.6129673", "0.6128939", "0.61222374", "0.6107359", "0.6099718", "0.6093932", "0.6093452", "0.6092075", "0.60913885", "0.60855913", "0.6074808", "0.6074691", "0.6071749", "0.60639596", "0.60614216" ]
0.0
-1
if not fully qualified, prepend base_url, strip slashes
protected function call($method, $uri, $data = null, $params = array()) { if(0 !== strpos(strtolower($uri), 'http') && $this->base_url) { $uri = rtrim($this->base_url."/".ltrim($uri, "/"), "/"); } //encode data if any if($data !== null) { if(!$data = @json_encode($data)) { $data = http_build_query($data); } } //build query string parameters if specified $queryParams = array_merge($this->queryParams, $params); $q = (!empty($queryParams)) ? http_build_query($queryParams) : null; $uri .= $q; //build curl object $ch = curl_init($uri); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); //set http request method curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method); //send encoded data if exists if(null !== $data) { curl_setopt($ch, CURLOPT_POSTFIELDS, $data); } //execute, store query data, and return response $startTime = microtime(true); $content = curl_exec($ch); $this->last_uri = $uri; $this->query_time = (microtime(true)-$startTime) * 1000; $this->last_code = curl_getinfo($ch, CURLINFO_HTTP_CODE); $this->last_type = curl_getinfo($ch, CURLINFO_CONTENT_TYPE); $this->last_result = $content; //return result, json_decoding if possible return ($data = @json_decode($content)) ? $data : $content; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function stripBaseUrl($url);", "function get_base_url() {\n $fin_string = '';\n $parts = explode('/', $this->request_uri);\n if (count($parts) > 2) {\n $subparts = array_slice($parts, 2);\n foreach ($subparts as $p)\n $fin_string .= $p . '/';\n return substr($fin_string, 0, -1);\n }\n return $fin_string;\n }", "protected function determineBaseUrl() {}", "private static function base_url($path=NULL)\n {\n\t\tglobal $url;\n $fullurl=$url.$path;\n return $fullurl;\n\t}", "protected static function generate_base_url()\n\t{\n\t\t$base_url = parent::generate_base_url();\n\t\treturn str_replace('htdocs/novius-os/', '', $base_url);\n\t}", "private function detectBaseUrl() {\n $this->baseurl = empty($this->subdir) ? '/' : \"/{$this->subdir}/\";\n }", "function return_base_URL(){\n\t$current_url = \"http://\" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];\n\n\t$current_url = explode('/', $current_url);\n\tunset($current_url[count($current_url) - 1]);\n\t$current_url = implode('/', $current_url);\n\n\treturn $current_url . '/';\n}", "function get_base()\n\t{\n\t\t$site_url = get_site_option('siteurl');\n\t\t$base = trim(preg_replace('#https?://[^/]+#ui', '', $site_url), '/');\n\n\t\t// @since 1.3.0 - guess min dir to check for any dir that we have to\n\t\t// remove from the base\n\t\t$this->_guess_min_dir();\n\n\t\t$this->base = !empty($this->remove_from_base)\n\t\t\t? preg_replace('#^' . $this->remove_from_base . '/?#ui', '', $base, 1)\n\t\t\t: $base;\n\t}", "private function getPreparedUrlString()\n {\n $urlstring = $this->url->getRawUrl();\n\n // Remove schem if its set\n\n $urlstring = preg_replace('/^([a-z]+:\\/\\/)/i', '', $urlstring);\n\n // Remove double slashes\n\n $urlstring = preg_replace('/(\\/\\/)/i', '/', $urlstring);\n\n // Remove everything before the fist slash and the the slash too.\n\n $slashpos = strpos($urlstring, '/');\n\n if ($slashpos !== false) {\n $urlstring = substr($urlstring, $slashpos +1);\n }\n\n // Check if the last sign a slash to\n\n if (substr($urlstring, -1) == '/') {\n $urlstring = substr($urlstring, 0, strlen($urlstring) -1);\n }\n\n return $urlstring;\n }", "private function buildBaseUrl()\n {\n return $this->scheme() . $this->host;\n }", "public function base($path = null)\n\t{\n\t\treturn ($this->baseUrl ? rtrim($this->baseUrl, '/' ).'/' : '/').($path ? trim($path, '/') : '');\n\t}", "function set_base_url($url) {\n if($url[strlen($url)-1] != '/') {\n $url .= '/'; \n }\n \n $this->base_url = $url;\n }", "function bu($url=null)\n{\n static $baseUrl;\n if ($baseUrl===null)\n $baseUrl=Yii::app()->getRequest()->getBaseUrl();\n return $url===null ? $baseUrl : $baseUrl.'/'.ltrim($url,'/');\n}", "private function getBaseUrl() : string\n {\n return preg_replace(\"/(?<=\\/api\\/v\\d)(.*)/\", '', $this->request->getFullUrl());\n }", "function build_url($base,$url) {\n $base_parts=url_parts($base);\n\n # https://code.google.com/p/add-mvc-framework/issues/detail?id=81\n if (preg_match('/^javascript\\:/',$url)) {\n return $url;\n }\n\n if ($url[0]==='/') {\n return rtrim($base_parts['protocol_domain'],'/').$url;\n }\n if ($url[0]==='?') {\n if (!$base_parts['pathname'])\n $base_parts['pathname']='/';\n return $base_parts['protocol_domain'].$base_parts['pathname'].$url;\n }\n if ($url[0]==='#') {\n\n }\n if (preg_match('/^https?\\:\\/+/',$url)) {\n return $url;\n }\n\n return rtrim($base_parts['protocol_domain'],\"/\").$base_parts['path'].$url;\n}", "protected function _prependBase($url)\n {\n if ($this->getPrependBase()) {\n $request = $this->getRequest();\n if ($request instanceof Zend_Controller_Request_Http) {\n $base = rtrim($request->getBaseUrl(), '/');\n if (!empty($base) && ('/' != $base)) {\n $url = $base . '/' . ltrim($url, '/');\n } else {\n $url = '/' . ltrim($url, '/');\n }\n }\n }\n\n return $url;\n }", "protected function prepareUrl()\n {\n $address = rtrim($this->config['url'], '/');\n\n if (substr_compare($address, static::API_PATH, -strlen(static::API_PATH)) !== 0) {\n $address .= static::API_PATH;\n }\n\n return $address;\n }", "protected static function makeBaseURL(...$base_url_components): string { // phpcs:ignore\n return self::makePath(...$base_url_components) . '/';\n }", "function bu($url=null)\n{\n static $baseUrl;\n if ($baseUrl===null)\n $baseUrl=Yii::app()->getRequest()->getBaseUrl();\n return $url===null ? $baseUrl : $baseUrl.'/'.ltrim($url,'/');\n}", "function bu($url=null) \n{\n static $baseUrl;\n if ($baseUrl===null)\n $baseUrl=Yii::app()->getRequest()->getBaseUrl();\n return $url===null ? $baseUrl : $baseUrl.'/'.ltrim($url,'/');\n}", "function get_base_url()\n{\n $url = explode('/',$_SERVER['REQUEST_URI']);\n $segmentOne = isset($url[0]) ? $url[0] : '';\n $segmentTwo = isset($url[1]) ? $url[1] : '';\n $url = 'http://localhost/' . ($segmentOne ? $segmentOne . '/' : '') . ($segmentTwo ? $segmentTwo : '') . '/';\n return $url;\n}", "protected static function baseurl($path=NULL)\n {\n\t\t$res=self::base_url($path);\n\t\treturn $res;\n }", "protected function getBaseUrl(): string\n {\n return \"\";\n }", "public function getBaseURL(){\n\t\tif($this->htaccess){\n\t\t\treturn \"/\";\n\t\t}\n\t\treturn \"\";\n\t}", "public function getBaseUrl(){\n $uri = self::getCurrentUri();\n $url = self::getCurrentPage();\n\n if ($uri !== '/') {\n $url = trim(str_replace($uri, '', $url), '/');\n }\n\n return self::addBackSlash($url);\n }", "public function domainLink($base = null) \n\t{\n $config = Zend_Registry::get ( 'app_config' );\n\t\tif ($base == null)\n\t\t{\n\t\t\t$configModule = Zend_Registry::get ( 'config' );\n\t\t\tif (self::$_httpPath === null) {\n\t\t\t\tself::$_httpPath = $config['baseHttpPath'] \n\t\t\t\t\t. $configModule['httpPath'];\n\t\t\t}\n\t\t\t\n\t\t\treturn self::$_httpPath;\n\t\t}\n\t\telse if ($base == 1)\n\t\t{\n\t\t\tif (self::$_baseHttpPath === null) {\n\t\t\t\tself::$_baseHttpPath = $config['baseHttpPath'];\n\t\t\t}\n\t\t\treturn self::$_baseHttpPath;\n\t\t}\n else if ($base == 2)\n {\n return $config['baseHttpPath'] . $config['textEditorPrefix'];\n }\n else if ($base == 3)\n {\n return $config['baseHttpPath'] . $config['tableFridPrefix'];\n }\n\t}", "function prefix_path( $url ) {\n\t$scheme = wp_parse_url( $url, PHP_URL_SCHEME );\n\n\t// If it's just a path, prepend the base URL to validate.\n\tif ( is_null( $scheme ) ) {\n\t\treturn home_url( $url );\n\t}\n\n\treturn $url;\n}", "public function baseUrl($parts = \"\") {\n return UrlHelper::getBaseUrl($parts);\n }", "private static function getUrlBase() {\n\t\tif(!isset(self::$usrBbase)) {\n\t\t\tself::$urlBase =\n\t\t\t\tself::getScheme()\n\t\t\t\t. '://'\n\t\t\t\t. self::getHost()\n\t\t\t\t. ((self::getPort() == 80 || self::getPort() == 443)\n\t\t\t\t\t? ''\n\t\t\t\t\t: ':'.self::getPort())\n\t\t\t\t. self::getBasePath();\n\t\t}\n\t\treturn self::$urlBase;\n\t}", "public static function fullBaseUrl($base = null)\n {\n if ($base !== null) {\n static::$_fullBaseUrl = $base;\n Configure::write('App.fullBaseUrl', $base);\n }\n if (empty(static::$_fullBaseUrl)) {\n static::$_fullBaseUrl = Configure::read('App.fullBaseUrl');\n }\n\n return static::$_fullBaseUrl;\n }", "public function base_url()\n {\n if (isset($_SERVER['HTTP_HOST']) && preg_match('/^((\\[[0-9a-f:]+\\])|(\\d{1,3}(\\.\\d{1,3}){3})|[a-z0-9\\-\\.]+)(:\\d+)?$/i', $_SERVER['HTTP_HOST']))\n {\n $protocol = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' || $_SERVER['SERVER_PORT'] == 443) ? \"https://\" : \"http://\";\n $baseurl = $protocol.$_SERVER['HTTP_HOST'].substr($_SERVER['SCRIPT_NAME'], 0, strpos($_SERVER['SCRIPT_NAME'], basename($_SERVER['SCRIPT_FILENAME'])));\n }\n else\n {\n $baseurl = 'http://localhost/';\n }\n\n return $baseurl;\n }", "function url($path = null, $full = false) {\n\t\tif (!$path = $this->webroot($path)) {\n\t\t\treturn null;\n\t\t}\n\t\tif ($full && strpos($path, '://') === false) {\n\t\t\t$path = FULL_BASE_URL . $path;\n\t\t}\n\t\treturn $path;\n\t}", "private function getBaseURL() {\n $pageURL = 'http';\n if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on') {\n $pageURL .= 's';\n }\n $pageURL .= '://';\n if ($_SERVER['SERVER_PORT'] !== '80') {\n $pageURL .= $_SERVER['SERVER_NAME'] . ':' . $_SERVER['SERVER_PORT'] . $_SERVER['REQUEST_URI'];\n } else {\n $pageURL .= $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'];\n }\n $splitted = explode('?', $pageURL);\n if (substr($splitted[0], -1) === '/') {\n return $splitted[0];\n }\n\n return $splitted[0] . '/';\n }", "public function base_url($uri = '')\n\t{\n\t\treturn $this->slash_item('base_url').ltrim($this->_uri_string($uri),'/');\n\t}", "function base_url($uri=null){\n\t$base_url = 'http://localhost/KoperasiSimpanPinjam/';\n\tif($uri == null){\n\t\treturn $base_url;\n\t}else{\n\t\treturn $base_url.$uri;\n\t}\n}", "public function determineBaseUrl()\n {\n // why this works at all :)\n return dirname($_SERVER['SCRIPT_NAME']);\n }", "protected function baseUrl(string $url): string\n {\n return rtrim($this->base_url, '/') . '/' . ltrim($url, '/');\n }", "public function get_base_url()\r\n\t\t{\r\n\t\t\t$url = \"http\";\r\n \t\t\tif ( isset( $_SERVER[ 'HTTPS' ] ) && $_SERVER[ 'HTTPS' ] == \"on\" ) $url .= \"s\";\r\n\t\t\t$url .= \"://\";\r\n \t\t\tif ( $_SERVER[ 'SERVER_PORT' ] != \"80\" )\r\n\t\t\t\t$url .= $_SERVER[ 'SERVER_NAME' ]. \":\" . $_SERVER[ 'SERVER_PORT' ] . $_SERVER[ 'REQUEST_URI' ];\r\n\t\t\telse\r\n\t\t\t\t$url .= $_SERVER[ 'SERVER_NAME' ] . \"/\";\r\n\t\t\t\r\n\t\t\treturn $url . self::HOME_DIR;\r\n\t\t}", "function get_base_url() {\n return $this->base_url;\n }", "function base_url() {\r\necho \"<base href=\" . get_site_url() . \">\";\r\n}", "public function base_url() {\n\t\t$protocol = ( ! empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' || $_SERVER['SERVER_PORT'] == 443) ? 'https' : 'http';\n\t\t$host = $_SERVER['HTTP_HOST'];\n\t\t$script = dirname($_SERVER['SCRIPT_NAME']);\n\t\treturn $protocol . '://' . $host . $script . '/';\n\t}", "public static function stripBase($url, $base = BASE_URL)\n {\n $pattern = '/^(' . preg_quote($base, '/') . '|\\\\/)/i';\n return preg_replace($pattern, '', $url);\n }", "private function base_url( $path = null ) {\n\t\t$parts = wp_parse_url( get_option( 'home' ) );\n\t\t$base_url = trailingslashit( $parts['scheme'] . '://' . $parts['host'] );\n\n\t\tif ( ! is_null( $path ) ) {\n\t\t\t$base_url .= ltrim( $path, '/' );\n\t\t}\n\n\t\treturn $base_url;\n\t}", "function urlfor($path) {\n return basepath() . $path;\n}", "protected function getAbsoluteBasePath() {}", "function base_url(){\n return BASE_URL;\n }", "private static function base_relative($path = null)\n\t{\n\t\t$test\t= self::getProtocol().$_SERVER['HTTP_HOST'].\"/\".apps::getGlobal(\"router\")->getBasePath();\n\t\treturn concat_path($test,$path);\n\t}", "function base_url(){\n $url = BASE_URL;\n return $url;\n }", "function GetMainBaseFromURL()\n{\n\t$url = (!empty($_SERVER['HTTPS'])) ? \"https://\".$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI'] : \"http://\".$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI'];\n\n\t$chars = preg_split('//', $url, -1, PREG_SPLIT_NO_EMPTY);\n\t$slash = 3; // 3rd slash\n\t$i = 0;\n\tforeach($chars as $key => $char)\n\t{\n\t\tif($char == '/')\n\t\t{\n\t\t $j = $i++;\n\t\t}\n\t\n\t\tif($i == 3)\n\t\t{\n\t\t $pos = $key; break;\n\t\t}\n\t}\n\tif($_REQUEST['CFSystem']['url_friendly'])\n\t{\n\t\t$url = (!empty($_SERVER['HTTPS'])) ? \"https://\".$_SERVER['SERVER_NAME']: \"http://\".$_SERVER['SERVER_NAME'];\n\t\t$main_base = rtrim($url.'/'.basename($_REQUEST['CFSystem']['baseurl']),'/');\n\t}\n\telse\n\t{\n\t\t$main_base = substr($url, 0, $pos);\n\t}\n\treturn $main_base.'/';\t\n}", "private static function setUristr() {\n $uri_request = HttpHelper::getUri();\n if(WEB_DIR != \"/\") {\n self::$uri = str_replace(WEB_DIR, \"\", $uri_request);\n } else {\n self::$uri = substr($uri_request, 1);\n }\n }", "private function basePath(): string\n\t{\n\t\treturn rtrim((new RequestFactory)\n\t\t\t->fromGlobals()->url->basePath, '/');\n\t}", "public function getBaseUrl($parts = \"\") {\n\t\treturn UrlHelper::getBaseUrl($parts);\n\t}", "protected function urlBase()\n {\n return \"/bibs/{$this->bib->mms_id}/representations/{$this->representation_id}\";\n }", "function FullLink($link, $url_base) {\n if (trim($link)==\"\") return \"\";\n if (substr($link, 0, 4)==\"http\") return $link;\n if (substr($link, 0, 2)==\"//\" ) return \"http:\".$link;\n if (substr($link, 0, 1)==\"/\" ) return $url_base.$link;\n return $url_base.\"/\".$link;\n}", "protected function detectBaseUrl()\n {\n $filename = $this->request->getServerParams()['SCRIPT_FILENAME'];\n $phpSelf = $this->request->getServerParams()['PHP_SELF'];\n $baseUrl = '/';\n\n $basename = basename($filename);\n if ($basename) {\n $path = ($phpSelf ? trim($phpSelf, '/') : '');\n $basePos = strpos($path, $basename) ?: 0;\n $baseUrl .= substr($path, 0, $basePos) . $basename;\n }\n\n return$baseUrl;\n }", "public function baseRelPath()\n {\n if($this instanceof Layout)\n {\n $class = Application::getApp();\n }\n else\n {\n $class = \\get_class($this);\n }\n $reflector = new \\ReflectionClass($class);\n $parts = \\explode('\\\\', $reflector->getName());\n $parts = \\array_chunk($parts, 3, false);\n return \\strtolower(\\implode('/', $parts[0])) . '/';\n }", "public function getBaseUri(): string;", "private function fixUri(){\n\t\t$this->uri = rtrim($this->uri,'/');\n\t}", "public function base_url()\n\t{\n\t\treturn URL::base();\n\t}", "private static function absolutize( $path, $base ) {\n\t\tif ( ! empty( $path ) && ! \\WP_CLI\\Utils\\is_path_absolute( $path ) ) {\n\t\t\t$path = $base . DIRECTORY_SEPARATOR . $path;\n\t\t}\n\t\treturn $path;\n\t}", "private function baseName(){\n \n if ($this->baseName===null) {\n $this->baseName= implode('/', array_slice(explode('/', $_SERVER['SCRIPT_NAME']), 0, -1)) . '/';\n }\n return $this->baseName;\n\n }", "function getBaseUrl() {\n if(isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on')\n $link = \"https\";\n else\n $link = \"http\";\n\n // Here append the common URL characters.\n $link .= \"://\";\n\n // Append the host(domain name, ip) to the URL.\n $link .= $_SERVER['HTTP_HOST'];\n\n // Append the requested resource location to the URL\n $link .= $_SERVER['REQUEST_URI'];\n\n // Print the link\n echo substr($link, 0, strrpos($link, '/') + 1);\n}", "function getBaseUrl()\n{\n $doc_root_folders = utf8_explode(\"/\", $_SERVER['DOCUMENT_ROOT']);\n $cwd__folders = utf8_explode(\"/\", getcwd());\n //the difference between those is the path from doc root to the folder where\n //all files for this URI reside\n $path_from_doc_root = implode(\"/\", array_diff($cwd__folders, $doc_root_folders));\n return $_SERVER['HTTP_HOST'].'/'.$path_from_doc_root;\n}", "public function setBaseUrl($value)\n\t{\n\t\t$this->baseUrl = rtrim($value, '/');\n\t}", "protected function get_normalized_rest_base() {\n\t\treturn preg_replace( '/\\(.*\\)\\//i', '', $this->rest_base );\n\t}", "function base_url($url = NULL){\n\t\tif ($url != NULL)\n\t\t{\n\t\t\t$baseurl = 'http://localhost/pkl/'.$url;\n\t\t}\n\t\telse\t\n\t\t{\n\t\t\t$baseurl = 'http://localhost/pkl/';\n\t\t}\n\t\t\n\t\treturn $baseurl;\n\t}", "public function getRealUrlAliasBase(): string;", "public function get_base_uri()\r\n\t{\r\n\t\tif($this->base_uri != null)\r\n\t\t\treturn $this->base_uri;\r\n\t\t\r\n\t\treturn htmlentities(dirname($_SERVER['PHP_SELF']), ENT_QUOTES | ENT_IGNORE, \"UTF-8\") . '/';\r\n\t}", "private function urlWrapper() {\n return $this->baseURL;\n }", "function router_base_url($with_scheme = false)\n{\n static $url;\n if (!is_null($url)) {\n return $with_scheme ? router_scheme() . $url : $url;\n }\n\n $domain = request_host();\n $dir = superglobal('server')['SCRIPT_NAME'];\n if (router_use_rewriting()) {\n $dir = dirname($dir);\n }\n if (strpos($dir, '/') !== 0) {\n $dir = '/'.$dir;\n }\n if (substr($dir, -1) !=='/') {\n $dir .= '/';\n }\n $url = '//'.$domain.$dir;\n return $with_scheme ? router_scheme() . $url : $url;\n}", "public function getBaseUrl() : string\n {\n return $this->base;\n }", "public function getBaseUrl() {}", "public function getBaseUrl();", "public function getBaseUrl();", "public function getBaseUrl();", "public function getBaseUrl();", "public function getBaseUrl();", "function Twiloop_url_base()\n{\n $url_base = '';\n $url_base = strrpos($_SERVER['PHP_SELF'], '/', -4)+1;\n $url_base = substr($_SERVER['PHP_SELF'], 0, $url_base);\n $url_base = $_SERVER['REQUEST_SCHEME'].'://'.$_SERVER['HTTP_HOST'].$url_base;\n return $url_base;\n}", "protected function getBaseUrl()\n {\n $baseUrl = '';\n\n if ($this->container->isScopeActive('request')) {\n $baseUrl = $this->container->get('templating.helper.assets')->getUrl('');\n\n // Remove ?version from the end of the base URL\n if (($pos = strpos($baseUrl, '?')) !== false) {\n $baseUrl = substr($baseUrl, 0, $pos);\n }\n }\n\n // Remove trailing slash, if there is one\n return rtrim($baseUrl, '/');\n }", "public static function setFullUrl(): void\n\t{\n\t\t$requestUri = urldecode(Server::get('REQUEST_URI'));\n\t\tstatic::$fullUrl = rtrim(preg_replace('#^' . static::$scriptDirectory . '#', '', $requestUri), '/');\n\t}", "protected function getBaseUrl()\n {\n if (!empty($this->baseApiUrl)) {\n return $this->baseApiUrl;\n }\n\n return parent::getBaseUrl();\n }", "function baseUrl(){\n return sprintf(\n \"%s://%s\",\n isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off' ? 'https' : 'http',\n $_SERVER['SERVER_NAME']\n );\n }", "public static function base(): string\n\t{\n\t\treturn sprintf(\n\t\t\t'%s://%s/%s',\n\t\t\tisset($_SERVER['SERVER_PROTOCOL']) && strpos($_SERVER['SERVER_PROTOCOL'], 'HTTPS') !== false ? 'https' : 'http',\n\t\t\t$_SERVER['SERVER_NAME'] ?? 'apache',\n\t\t\tself::PUBLIC_PATH\n\t\t);\n\t}", "function cap_make_path_relative_to ($path, $base)\n{\n $base = rtrim ($base, '/') . '/';\n if (strncmp ($path, $base, strlen ($base)) == 0) {\n return substr ($path, strlen ($base));\n }\n return $path;\n}", "private function get_base_url() : string {\n return plugin_dir_url( dirname( __FILE__, 2 ) );\n }", "public function base_url(){\n return $this->plugin_url() . 'base/';\n }", "function _trimendslashurl ($url)\r\r\n{\r\r\n while(substr($url, -1) == \"/\") {\r\r\n $url = substr($url, 0, -1);\r\r\n }\r\r\n return $url;\r\r\n}", "public function getBaseUrl() {\r\n\t\treturn home_url();\r\n\t}", "public function getUrlWithPrefix()\n {\n if (substr($this->url, 0, 1) === '/') {\n return '/' . $this->resourcePrefix . ltrim($this->url, '/');\n }\n return $this->resourcePrefix . $this->url;\n }", "public function getBaseUrl() {\n if ($pos = strpos ( $this->url, '?' )) {\n return substr ( $this->url, 0, $pos );\n }\n return $this->url;\n }", "protected function urlBase()\n {\n return sprintf('/users/%s', rawurlencode($this->id));\n }", "function set_base_url( $url = '' )\n {\n if ( empty($url) ) {\n $this->url = 'http://' . $_SERVER['HTTP_HOST'];\n } else {\n // Strip any trailing slashes for consistency (relative\n // URLs may already start with a slash like \"/file.html\")\n if ( substr($url, -1) == '/' ) {\n $url = substr($url, 0, -1);\n }\n $this->url = $url;\n }\n }", "function base_path($path = '')\n {\n return str_replace('//' ,'/',str_ireplace('/' . SYSTEMPATHS['core'], '/', __DIR__) . '/' . $path);\n }", "static function base()\n {\n return trim(App::router()->getBase(), '/');\n }", "public static function getBasePath()\n {\n\n $baseUrl = trim(_PS_BASE_URL_, '/') . '/';\n\n $baseUri = trim(__PS_BASE_URI__, '/');\n\n // Do some check on subfolder.\n if(!empty($baseUri)) {\n\n $baseUri = $baseUri . '/';\n\n }\n\n return $baseUrl . $baseUri;\n }", "protected function getStrippedUrl()\n {\n return str_replace(parse_url($url = app('request')->url(), PHP_URL_SCHEME) . '://', '', $url);\n }", "function format_url($url)\n{\n return '/' . trim($url, '/');\n}", "function base_path($uri = '', $protocol = NULL)\n\t{\n\t\treturn get_instance()->config->base_path($uri, $protocol);\n\t}", "public function testBaseUrl()\n\t{\n \t$this->assertEquals(Util::base('foo'), 'http://localhost/www/foo');\n \t$this->assertEquals(Util::css('foo.css'), 'http://localhost/www/public/css/foo.css');\n \t$this->assertEquals(Util::js('foo.js'), 'http://localhost/www/public/js/foo.js');\n \t$this->assertEquals(Util::img('foo.png'), 'http://localhost/www/public/images/foo.png');\n // Test cached\n $this->assertEquals(Util::base('foo'), 'http://localhost/www/foo');\n\t}", "function base_path() {\n\treturn str_replace('index.php','',$_SERVER['SCRIPT_NAME']);\n}", "private function base_uri( $localizable = TRUE ) {\r\n\t\treturn implode ( '/', array (\r\n\t\t\t\t$this->host,\r\n\t\t\t\tself::API_VERSION \r\n\t\t) );\r\n\t}" ]
[ "0.74222666", "0.7307614", "0.7111286", "0.7061753", "0.69847053", "0.6942366", "0.6875483", "0.6872593", "0.6847586", "0.68199885", "0.6798192", "0.67972416", "0.6779094", "0.67715764", "0.67321825", "0.6731453", "0.67173344", "0.67171466", "0.6708627", "0.67056036", "0.6693247", "0.6681891", "0.66567445", "0.66515535", "0.66424894", "0.66292423", "0.66173625", "0.66071194", "0.659898", "0.6568498", "0.6543977", "0.65373564", "0.65295947", "0.6526454", "0.65261555", "0.6511659", "0.65088123", "0.64999515", "0.6488726", "0.6478378", "0.64722604", "0.6462929", "0.64591104", "0.6445114", "0.64438385", "0.6421108", "0.6417804", "0.641328", "0.6412105", "0.64059305", "0.64057404", "0.6396948", "0.6391121", "0.63800377", "0.6377169", "0.6359423", "0.63541543", "0.634499", "0.63440716", "0.6341864", "0.63385093", "0.63177216", "0.63177055", "0.6317164", "0.6310245", "0.6309403", "0.6307214", "0.6305877", "0.63003874", "0.6297251", "0.6290086", "0.6277361", "0.62725186", "0.62725186", "0.62725186", "0.62725186", "0.62725186", "0.6271863", "0.62701744", "0.62692225", "0.6264131", "0.6262743", "0.6260765", "0.62587553", "0.625737", "0.6255802", "0.6250977", "0.6243291", "0.62422186", "0.6238704", "0.623643", "0.62354857", "0.6233139", "0.62321347", "0.6225962", "0.6222686", "0.6221783", "0.62152475", "0.62049097", "0.6186482", "0.6185108" ]
0.0
-1
Bootstrap any application services.
public function boot() { if (config('app.db_log_sql', false)) { // @codeCoverageIgnoreStart /* @noinspection PhpUndefinedClassInspection */ DB::listen(function ($query) { /* @noinspection PhpUndefinedClassInspection */ Log::info($query->sql, $query->bindings, $query->time); }); // @codeCoverageIgnoreEnd } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function bootstrap(): void\n {\n if (! $this->app->hasBeenBootstrapped()) {\n $this->app->bootstrapWith($this->bootstrappers());\n }\n\n $this->app->loadDeferredProviders();\n }", "public function boot()\n {\n // Boot here application\n }", "public function bootstrap()\n {\n if (!$this->app->hasBeenBootstrapped()) {\n $this->app->bootstrapWith($this->bootstrapperList);\n }\n\n $this->app->loadDeferredProviders();\n }", "public function boot()\r\n {\r\n // Publishing is only necessary when using the CLI.\r\n if ($this->app->runningInConsole()) {\r\n $this->bootForConsole();\r\n }\r\n }", "public function boot()\n {\n $this->app->bind(IUserService::class, UserService::class);\n $this->app->bind(ISeminarService::class, SeminarService::class);\n $this->app->bind(IOrganizationService::class, OrganizationService::class);\n $this->app->bind(ISocialActivityService::class, SocialActivityService::class);\n }", "public function boot()\n {\n if ($this->booted) {\n return;\n }\n\n array_walk($this->loadedServices, function ($s) {\n $this->bootService($s);\n });\n\n $this->booted = true;\n }", "public function boot()\n {\n\n $this->app->bind(FileUploaderServiceInterface::class,FileUploaderService::class);\n $this->app->bind(ShopServiceInterface::class,ShopService::class);\n $this->app->bind(CategoryServiceInterface::class,CategoryService::class);\n $this->app->bind(ProductServiceInterface::class,ProductService::class);\n $this->app->bind(ShopSettingsServiceInterface::class,ShopSettingsService::class);\n $this->app->bind(FeedbackServiceInterface::class,FeedbackService::class);\n $this->app->bind(UserServiceInterface::class,UserService::class);\n $this->app->bind(ShoppingCartServiceInterface::class,ShoppingCartService::class);\n $this->app->bind(WishlistServiceInterface::class,WishlistService::class);\n $this->app->bind(NewPostApiServiceInterface::class,NewPostApiService::class);\n $this->app->bind(DeliveryAddressServiceInterface::class,DeliveryAddressService::class);\n $this->app->bind(StripeServiceInterface::class,StripeService::class);\n $this->app->bind(OrderServiceInterface::class,OrderService::class);\n $this->app->bind(MailSenderServiceInterface::class,MailSenderSenderService::class);\n }", "public function boot()\n {\n $this->setupConfig('delta_service');\n $this->setupMigrations();\n $this->setupConnection('delta_service', 'delta_service.connection');\n }", "public function boot()\n {\n $configuration = [];\n\n if (file_exists($file = getcwd() . '/kaleo.config.php')) {\n $configuration = include_once $file;\n }\n\n $this->app->singleton('kaleo', function () use ($configuration) {\n return new KaleoService($configuration);\n });\n }", "public function boot()\n {\n $this->shareResources();\n $this->mergeConfigFrom(self::CONFIG_PATH, 'amocrm-api');\n }", "public function boot(): void\n {\n if ($this->app->runningInConsole()) {\n $this->bootForConsole();\n }\n }", "public function boot()\n {\n // Ports\n $this->app->bind(\n IAuthenticationService::class,\n AuthenticationService::class\n );\n $this->app->bind(\n IBeerService::class,\n BeerService::class\n );\n\n // Adapters\n $this->app->bind(\n IUserRepository::class,\n UserEloquentRepository::class\n );\n $this->app->bind(\n IBeerRepository::class,\n BeerEloquentRepository::class\n );\n }", "public function boot()\n {\n $this->setupConfig($this->app);\n }", "public function boot()\n {\n if ($this->app->runningInConsole()) {\n $this->loadMigrations();\n }\n if(config($this->vendorNamespace. '::config.enabled')){\n Livewire::component($this->vendorNamespace . '::login-form', LoginForm::class);\n $this->loadRoutes();\n $this->loadViews();\n $this->loadMiddlewares();\n $this->loadTranslations();\n }\n }", "public function boot()\n {\n $source = dirname(__DIR__, 3) . '/config/config.php';\n\n if ($this->app instanceof LaravelApplication && $this->app->runningInConsole()) {\n $this->publishes([$source => config_path('dubbo_cli.php')]);\n } elseif ($this->app instanceof LumenApplication) {\n $this->app->configure('dubbo_cli');\n }\n\n $this->mergeConfigFrom($source, 'dubbo_cli');\n }", "public function boot()\n {\n $this->package('domain/app');\n\n $this->setApplication();\n }", "public function boot()\n {\n $this->setUpConfig();\n $this->setUpConsoleCommands();\n }", "public function boot()\n {\n $this->strapRoutes();\n $this->strapViews();\n $this->strapMigrations();\n $this->strapCommands();\n\n $this->registerPolicies();\n }", "public function boot()\n {\n $this->app->singleton('LaraCurlService', function ($app) {\n return new LaraCurlService();\n });\n\n $this->loadRoutesFrom(__DIR__.'/routes/web.php');\n }", "public function boot()\n {\n $providers = $this->make('config')->get('app.console_providers', array());\n foreach ($providers as $provider) {\n $provider = $this->make($provider);\n if ($provider && method_exists($provider, 'boot')) {\n $provider->boot();\n }\n }\n }", "public function boot()\n {\n foreach (glob(app_path('/Api/config/*.php')) as $path) {\n $path = realpath($path);\n $this->mergeConfigFrom($path, basename($path, '.php'));\n }\n\n // 引入自定义函数\n foreach (glob(app_path('/Helpers/*.php')) as $helper) {\n require_once $helper;\n }\n // 引入 api 版本路由\n $this->loadRoutesFrom(app_path('/Api/Routes/base.php'));\n\n }", "public function bootstrap()\n {\n if (!$this->app->hasBeenBootstrapped()) {\n $this->app->bootstrapWith($this->bootstrappers());\n }\n\n //$this->app->loadDeferredProviders();\n\n if (!$this->commandsLoaded) {\n //$this->commands();\n\n $this->commandsLoaded = true;\n }\n }", "protected function boot()\n\t{\n\t\tforeach ($this->serviceProviders as $provider)\n\t\t{\n\t\t\t$provider->boot($this);\n\t\t}\n\n\t\t$this->booted = true;\n\t}", "public function boot()\n {\n $this->setupConfig();\n //register rotating daily monolog provider\n $this->app->register(MonologProvider::class);\n $this->app->register(CircuitBreakerServiceProvider::class);\n $this->app->register(CurlServiceProvider::class);\n }", "public function boot(): void\n {\n if ($this->booted) {\n return;\n }\n\n array_walk($this->services, function ($service) {\n $this->bootServices($service);\n });\n\n $this->booted = true;\n }", "public static function boot() {\n\t\tstatic::container()->boot();\n\t}", "public function boot()\n {\n include_once('ComposerDependancies\\Global.php');\n //---------------------------------------------\n include_once('ComposerDependancies\\League.php');\n include_once('ComposerDependancies\\Team.php');\n include_once('ComposerDependancies\\Matchup.php');\n include_once('ComposerDependancies\\Player.php');\n include_once('ComposerDependancies\\Trade.php');\n include_once('ComposerDependancies\\Draft.php');\n include_once('ComposerDependancies\\Message.php');\n include_once('ComposerDependancies\\Poll.php');\n include_once('ComposerDependancies\\Chat.php');\n include_once('ComposerDependancies\\Rule.php');\n\n \n include_once('ComposerDependancies\\Admin\\Users.php');\n\n }", "public function boot()\n {\n $this->bootEvents();\n\n $this->bootPublishes();\n\n $this->bootTypes();\n\n $this->bootSchemas();\n\n $this->bootRouter();\n\n $this->bootViews();\n \n $this->bootSecurity();\n }", "public function boot()\n {\n if ($this->app->runningInConsole()) {\n if ($this->app instanceof LaravelApplication) {\n $this->publishes([\n __DIR__.'/../config/state-machine.php' => config_path('state-machine.php'),\n ], 'config');\n } elseif ($this->app instanceof LumenApplication) {\n $this->app->configure('state-machine');\n }\n }\n }", "public function boot()\n {\n //\n Configuration::environment(\"sandbox\");\n Configuration::merchantId(\"cmpss9trsxsr4538\");\n Configuration::publicKey(\"zy3x5mb5jwkcrxgr\");\n Configuration::privateKey(\"4d63c8b2c340daaa353be453b46f6ac2\");\n\n\n $modules = Directory::listDirectories(app_path('Modules'));\n\n foreach ($modules as $module)\n {\n $routesPath = app_path('Modules/' . $module . '/routes.php');\n $viewsPath = app_path('Modules/' . $module . '/Views');\n\n if (file_exists($routesPath))\n {\n require $routesPath;\n }\n\n if (file_exists($viewsPath))\n {\n $this->app->view->addLocation($viewsPath);\n }\n }\n }", "public function boot()\n {\n resolve(EngineManager::class)->extend('elastic', function () {\n return new ElasticScoutEngine(\n ElasticBuilder::create()\n ->setHosts(config('scout.elastic.hosts'))\n ->build()\n );\n });\n }", "public function boot(): void\n {\n try {\n // Just check if we have DB connection! This is to avoid\n // exceptions on new projects before configuring database options\n // @TODO: refcator the whole accessareas retrieval to be file-based, instead of db based\n DB::connection()->getPdo();\n\n if (Schema::hasTable(config('cortex.foundation.tables.accessareas'))) {\n // Register accessareas into service container, early before booting any module service providers!\n $this->app->singleton('accessareas', fn () => app('cortex.foundation.accessarea')->where('is_active', true)->get());\n }\n } catch (Exception $e) {\n // Be quiet! Do not do or say anything!!\n }\n\n $this->bootstrapModules();\n }", "public function boot()\n {\n Schema::defaultStringLength(191);\n\n $this->app->bindMethod([SendMailPasswordReset::class, 'handle'], function ($job, $app) {\n return $job->handle($app->make(MailService::class));\n });\n\n $this->app->bindMethod([ClearTokenPasswordReset::class, 'handle'], function ($job, $app) {\n return $job->handle($app->make(PasswordResetRepository::class));\n });\n\n $this->app->bind(AuthService::class, function ($app) {\n return new AuthService($app->make(HttpService::class));\n });\n }", "public function boot()\n {\n $this->app->register(UserServiceProvider::class);\n $this->app->register(DashboardServiceProvider::class);\n $this->app->register(CoreServiceProvider::class);\n $this->app->register(InstitutionalVideoServiceProvider::class);\n $this->app->register(InstitutionalServiceProvider::class);\n $this->app->register(TrainingServiceProvider::class);\n $this->app->register(CompanyServiceProvider::class);\n $this->app->register(LearningUnitServiceProvider::class);\n $this->app->register(PublicationServiceProvider::class);\n }", "public function boot()\n {\n $this->makeRepositories();\n }", "public function boot(): void\n {\n $this->loadMiddlewares();\n }", "public function boot()\n {\n $this->app->when(ChatAPIChannel::class)\n ->needs(ChatAPI::class)\n ->give(function () {\n $config = config('services.chatapi');\n return new ChatAPI(\n $config['token'],\n $config['api_url']\n );\n });\n }", "public function boot() {\r\n\t\t$hosting_service = HostResolver::get_host_service();\r\n\r\n\t\tif ( ! empty( $hosting_service ) ) {\r\n\t\t\t$this->provides[] = $hosting_service;\r\n\t\t}\r\n\t}", "public function boot()\n {\n if ($this->app->runningInConsole()) {\n require(__DIR__ . '/../routes/console.php');\n } else {\n // Menus for BPM are done through middleware. \n Route::pushMiddlewareToGroup('web', AddToMenus::class);\n \n // Assigning to the web middleware will ensure all other middleware assigned to 'web'\n // will execute. If you wish to extend the user interface, you'll use the web middleware\n Route::middleware('web')\n ->namespace($this->namespace)\n ->group(__DIR__ . '/../routes/web.php');\n \n // If you wish to extend the api, be sure to utilize the api middleware. In your api \n // Routes file, you should prefix your routes with api/1.0\n Route::middleware('api')\n ->namespace($this->namespace)\n ->prefix('api/1.0')\n ->group(__DIR__ . '/../routes/api.php');\n \n Event::listen(ScreenBuilderStarting::class, function($event) {\n $event->manager->addScript(mix('js/screen-builder-extend.js', 'vendor/api-connector'));\n $event->manager->addScript(mix('js/screen-renderer-extend.js', 'vendor/api-connector'));\n });\n }\n\n // load migrations\n $this->loadMigrationsFrom(__DIR__.'/../database/migrations');\n\n // Load our views\n $this->loadViewsFrom(__DIR__.'/../resources/views/', 'api-connector');\n\n // Load our translations\n $this->loadTranslationsFrom(__DIR__.'/../lang', 'api-connector');\n\n $this->publishes([\n __DIR__.'/../public' => public_path('vendor/api-connector'),\n ], 'api-connector');\n\n $this->publishes([\n __DIR__ . '/../database/seeds' => database_path('seeds'),\n ], 'api-connector');\n\n $this->app['events']->listen(PackageEvent::class, PackageListener::class);\n }", "public function boot()\n {\n if ($this->app->runningInConsole()) {\n $this->bindCommands();\n $this->registerCommands();\n $this->app->bind(InstallerContract::class, Installer::class);\n\n $this->publishes([\n __DIR__.'/../config/exceptionlive.php' => base_path('config/exceptionlive.php'),\n ], 'config');\n }\n\n $this->registerMacros();\n }", "public function boot(){\r\n $this->app->configure('sdk');\r\n $this->publishes([\r\n __DIR__.'/../../resources/config/sdk.php' => config_path('sdk.php')\r\n ]);\r\n $this->mergeConfigFrom(__DIR__.'/../../resources/config/sdk.php','sdk');\r\n\r\n $api = config('sdk.api');\r\n foreach($api as $key => $value){\r\n $this->app->singleton($key,$value);\r\n }\r\n }", "public function boot()\n {\n if ($this->app->runningInConsole()) {\n $this->commands([\n EnvironmentCommand::class,\n EventGenerateCommand::class,\n EventMakeCommand::class,\n JobMakeCommand::class,\n KeyGenerateCommand::class,\n MailMakeCommand::class,\n ModelMakeCommand::class,\n NotificationMakeCommand::class,\n PolicyMakeCommand::class,\n ProviderMakeCommand::class,\n RequestMakeCommand::class,\n ResourceMakeCommand::class,\n RuleMakeCommand::class,\n ServeCommand::class,\n StorageLinkCommand::class,\n TestMakeCommand::class,\n ]);\n }\n }", "public function boot()\n {\n $this->app->bind(WeatherInterface::class, OpenWeatherMapService::class);\n $this->app->bind(OrderRepositoryInterface::class, EloquentOrderRepository::class);\n $this->app->bind(NotifyInterface::class, EmailNotifyService::class);\n }", "public function boot()\n {\n $this->app->bind(DateService::class,DateServiceImpl::class);\n $this->app->bind(DisasterEventQueryBuilder::class,DisasterEventQueryBuilderImpl::class);\n $this->app->bind(MedicalFacilityQueryBuilder::class,MedicalFacilityQueryBuilderImpl::class);\n $this->app->bind(RefugeCampQueryBuilder::class,RefugeCampQueryBuilderImpl::class);\n $this->app->bind(VictimQueryBuilder::class,VictimQueryBuilderImpl::class);\n $this->app->bind(VillageQueryBuilder::class,VillageQueryBuilderImpl::class);\n }", "public function boot()\n {\n\t\tif ( $this->app->runningInConsole() ) {\n\t\t\t$this->loadMigrationsFrom(__DIR__.'/migrations');\n\n//\t\t\t$this->publishes([\n//\t\t\t\t__DIR__.'/config/scheduler.php' => config_path('scheduler.php'),\n//\t\t\t\t__DIR__.'/console/CronTasksList.php' => app_path('Console/CronTasksList.php'),\n//\t\t\t\t__DIR__.'/views' => resource_path('views/vendor/scheduler'),\n//\t\t\t]);\n\n//\t\t\tapp('Revolta77\\ScheduleMonitor\\Conntroller\\CreateController')->index();\n\n//\t\t\t$this->commands([\n//\t\t\t\tConsole\\Commands\\CreateController::class,\n//\t\t\t]);\n\t\t}\n\t\t$this->loadRoutesFrom(__DIR__.'/routes/web.php');\n }", "public function boot()\n {\n $this->bootPackages();\n }", "public function boot(): void\n {\n if ($this->app->runningInConsole()) {\n $this->commands($this->load(__DIR__.'/../Console', Command::class));\n }\n }", "public function boot(): void\n {\n $this->publishes(\n [\n __DIR__ . '/../config/laravel_entity_services.php' =>\n $this->app->make('path.config') . DIRECTORY_SEPARATOR . 'laravel_entity_services.php',\n ],\n 'laravel_repositories'\n );\n $this->mergeConfigFrom(__DIR__ . '/../config/laravel_entity_services.php', 'laravel_entity_services');\n\n $this->registerCustomBindings();\n }", "public function boot()\n {\n // DEFAULT STRING LENGTH\n Schema::defaultStringLength(191);\n\n // PASSPORT\n Passport::routes(function (RouteRegistrar $router)\n {\n $router->forAccessTokens();\n });\n Passport::tokensExpireIn(now()->addDays(1));\n\n // SERVICES, REPOSITORIES, CONTRACTS BINDING\n $this->app->bind('App\\Contracts\\IUser', 'App\\Repositories\\UserRepository');\n $this->app->bind('App\\Contracts\\IUserType', 'App\\Repositories\\UserTypeRepository');\n $this->app->bind('App\\Contracts\\IApiToken', 'App\\Services\\ApiTokenService');\n $this->app->bind('App\\Contracts\\IModule', 'App\\Repositories\\ModuleRepository');\n $this->app->bind('App\\Contracts\\IModuleAction', 'App\\Repositories\\ModuleActionRepository');\n }", "public function bootstrap(): void\n {\n $globalConfigurationBuilder = (new GlobalConfigurationBuilder())->withEnvironmentVariables()\n ->withPhpFileConfigurationSource(__DIR__ . '/../config.php');\n (new BootstrapperCollection())->addMany([\n new DotEnvBootstrapper(__DIR__ . '/../.env'),\n new ConfigurationBootstrapper($globalConfigurationBuilder),\n new GlobalExceptionHandlerBootstrapper($this->container)\n ])->bootstrapAll();\n }", "public function boot()\n {\n // $this->loadTranslationsFrom(__DIR__.'/../resources/lang', 'deniskisel');\n // $this->loadViewsFrom(__DIR__.'/../resources/views', 'deniskisel');\n// $this->loadMigrationsFrom(__DIR__ . '/../database/migrations');\n // $this->loadRoutesFrom(__DIR__.'/routes.php');\n\n // Publishing is only necessary when using the CLI.\n if ($this->app->runningInConsole()) {\n $this->bootForConsole();\n }\n }", "public function boot()\n {\n $this->bootingDomain();\n\n $this->registerCommands();\n $this->registerListeners();\n $this->registerPolicies();\n $this->registerRoutes();\n $this->registerBladeComponents();\n $this->registerLivewireComponents();\n $this->registerSpotlightCommands();\n\n $this->bootedDomain();\n }", "public function boot()\n {\n if ($this->app->runningInConsole()) {\n $this->registerMigrations();\n $this->registerMigrationFolder();\n $this->registerConfig();\n }\n }", "public function boot()\n {\n $this->bootModulesMenu();\n $this->bootSkinComposer();\n $this->bootCustomBladeDirectives();\n }", "public function boot(): void\n {\n $this->app->bind(Telegram::class, static function () {\n return new Telegram(\n config('services.telegram-bot-api.token'),\n new HttpClient()\n );\n });\n }", "public function boot()\n {\n\n if (! config('app.installed')) {\n return;\n }\n\n $this->loadRoutesFrom(__DIR__ . '/Routes/admin.php');\n $this->loadRoutesFrom(__DIR__ . '/Routes/public.php');\n\n $this->loadMigrationsFrom(__DIR__ . '/Database/Migrations');\n\n// $this->loadViewsFrom(__DIR__ . '/Resources/Views', 'portfolio');\n\n $this->loadTranslationsFrom(__DIR__ . '/Resources/Lang/', 'contact');\n\n //Add menu to admin panel\n $this->adminMenu();\n\n }", "public function boot()\n {\n if (! config('app.installed')) {\n return;\n }\n\n $this->app['config']->set([\n 'scout' => [\n 'driver' => setting('search_engine', 'mysql'),\n 'algolia' => [\n 'id' => setting('algolia_app_id'),\n 'secret' => setting('algolia_secret'),\n ],\n ],\n ]);\n }", "protected function bootServiceProviders()\n {\n foreach($this->activeProviders as $provider)\n {\n // check if the service provider has a boot method.\n if (method_exists($provider, 'boot')) {\n $provider->boot();\n }\n }\n }", "public function boot(): void\n {\n // $this->loadTranslationsFrom(__DIR__.'/../resources/lang', 'imc');\n $this->loadMigrationsFrom(__DIR__.'/../database/migrations');\n $this->loadViewsFrom(__DIR__.'/../resources/views', 'imc');\n $this->registerPackageRoutes();\n\n // Publishing is only necessary when using the CLI.\n if ($this->app->runningInConsole()) {\n $this->bootForConsole();\n }\n }", "public function boot()\n {\n // Larapex Livewire\n $this->mergeConfigFrom(__DIR__ . '/../configs/larapex-livewire.php', 'larapex-livewire');\n\n $this->loadViewsFrom(__DIR__ . '/../resources/views', 'larapex-livewire');\n\n $this->registerBladeDirectives();\n\n if ($this->app->runningInConsole()) {\n $this->registerCommands();\n $this->publishResources();\n }\n }", "public function boot()\n {\n // Bootstrap code here.\n $this->app->singleton(L9SmsApiChannel::class, function () {\n $config = config('l9smsapi');\n if (empty($config['token']) || empty($config['service'])) {\n throw new \\Exception('L9SmsApi missing token and service in config');\n }\n\n return new L9SmsApiChannel($config['token'], $config['service']);\n });\n\n if ($this->app->runningInConsole()) {\n $this->publishes([\n __DIR__.'/../config/l9smsapi.php' => config_path('l9smsapi.php'),\n ], 'config');\n }\n }", "public function boot()\n\t{\n\t\t$this->bindRepositories();\n\t}", "public function boot()\n {\n if (!$this->app->runningInConsole()) {\n return;\n }\n\n $this->commands([\n ListenCommand::class,\n InstallCommand::class,\n EventsListCommand::class,\n ObserverMakeCommand::class,\n ]);\n\n foreach ($this->listen as $event => $listeners) {\n foreach ($listeners as $listener) {\n RabbitEvents::listen($event, $listener);\n }\n }\n }", "public function boot()\n {\n if ($this->app->runningInConsole()) {\n $this->commands([\n MultiAuthInstallCommand::class,\n ]);\n }\n }", "public function boot() {\n\n\t\t$this->registerProviders();\n\t\t$this->bootProviders();\n\t\t$this->registerProxies();\n\t}", "public function boot(): void\n {\n // routes\n $this->loadRoutes();\n // assets\n $this->loadAssets('assets');\n // configuration\n $this->loadConfig('configs');\n // views\n $this->loadViews('views');\n // view extends\n $this->extendViews();\n // translations\n $this->loadTranslates('views');\n // adminer\n $this->loadAdminer('adminer');\n // commands\n $this->loadCommands();\n // gates\n $this->registerGates();\n // listeners\n $this->registerListeners();\n // settings\n $this->applySettings();\n }", "public function boot()\n {\n $this->setupFacades();\n $this->setupViews();\n $this->setupBlades();\n }", "public function boot()\n {\n\n $this->app->translate_manager->addTranslateProvider(TranslateMenu::class);\n\n\n\n $this->loadRoutesFrom(__DIR__ . '/../routes/api.php');\n $this->loadMigrationsFrom(__DIR__ . '/../migrations/');\n\n\n\n }", "public function boot()\n {\n if ($this->app->runningInConsole()) {\n $this->publishes([\n __DIR__ . '/../config/larkeauth-rbac-model.conf' => config_path('larkeauth-rbac-model.conf.larkeauth'),\n __DIR__ . '/../config/larkeauth.php' => config_path('larkeauth.php.larkeauth')\n ], 'larke-auth-config');\n\n $this->commands([\n Commands\\Install::class,\n Commands\\GroupAdd::class,\n Commands\\PolicyAdd::class,\n Commands\\RoleAssign::class,\n ]);\n }\n\n $this->mergeConfigFrom(__DIR__ . '/../config/larkeauth.php', 'larkeauth');\n\n $this->bootObserver();\n }", "public function boot(): void\n {\n $this->app\n ->when(RocketChatWebhookChannel::class)\n ->needs(RocketChat::class)\n ->give(function () {\n return new RocketChat(\n new HttpClient(),\n Config::get('services.rocketchat.url'),\n Config::get('services.rocketchat.token'),\n Config::get('services.rocketchat.channel')\n );\n });\n }", "public function boot()\n {\n if ($this->booted) {\n return;\n }\n\n $this->app->registerConfiguredProvidersInRequest();\n\n $this->fireAppCallbacks($this->bootingCallbacks);\n\n /** array_walk\n * If when a provider booting, it reg some other providers,\n * then the new providers added to $this->serviceProviders\n * then array_walk will loop the new ones and boot them. // pingpong/modules 2.0 use this feature\n */\n array_walk($this->serviceProviders, function ($p) {\n $this->bootProvider($p);\n });\n\n $this->booted = true;\n\n $this->fireAppCallbacks($this->bootedCallbacks);\n }", "public function boot()\n {\n $this->loadMigrationsFrom(__DIR__ . '/../database/migrations');\n\n if ($this->app->runningInConsole()) {\n $this->bootForConsole();\n }\n }", "public function boot()\n {\n $this->app->booted(function () {\n $this->callMethodIfExists('jobs');\n });\n }", "public function boot()\n\t{\n\t\t$this->package('atlantis/admin');\n\n\t\t#i: Set the locale\n\t\t$this->setLocale();\n\n $this->registerServiceAdminValidator();\n $this->registerServiceAdminFactory();\n $this->registerServiceAdminDataTable();\n $this->registerServiceModules();\n\n\t\t#i: Include our filters, view composers, and routes\n\t\tinclude __DIR__.'/../../filters.php';\n\t\tinclude __DIR__.'/../../views.php';\n\t\tinclude __DIR__.'/../../routes.php';\n\n\t\t$this->app['events']->fire('admin.ready');\n\t}", "public function boot()\n {\n $this->bootSetTimeLocale();\n $this->bootBladeHotelRole();\n $this->bootBladeHotelGuest();\n $this->bootBladeIcon();\n }", "public function boot(): void\n {\n $this->registerRoutes();\n $this->registerResources();\n $this->registerMixins();\n\n if ($this->app->runningInConsole()) {\n $this->offerPublishing();\n $this->registerMigrations();\n }\n }", "public function boot()\n {\n $this->dispatch(new SetCoreConnection());\n $this->dispatch(new ConfigureCommandBus());\n $this->dispatch(new ConfigureTranslator());\n $this->dispatch(new LoadStreamsConfiguration());\n\n $this->dispatch(new InitializeApplication());\n $this->dispatch(new AutoloadEntryModels());\n $this->dispatch(new AddAssetNamespaces());\n $this->dispatch(new AddImageNamespaces());\n $this->dispatch(new AddViewNamespaces());\n $this->dispatch(new AddTwigExtensions());\n $this->dispatch(new RegisterAddons());\n }", "public function boot(): void\n {\n $this->loadViews();\n $this->loadTranslations();\n\n if ($this->app->runningInConsole()) {\n $this->publishMultipleConfig();\n $this->publishViews(false);\n $this->publishTranslations(false);\n }\n }", "public function boot()\n {\n $this->bootForConsole();\n $this->loadRoutesFrom(__DIR__ . '/routes/web.php');\n $this->loadViewsFrom(__DIR__ . '/./../resources/views', 'bakerysoft');\n }", "public function boot()\n {\n $this->app->booted(function () {\n $this->defineRoutes();\n });\n $this->defineResources();\n $this->registerDependencies();\n }", "public function boot()\n {\n $this->app->bind(CustomersRepositoryInterface::class, CustomersRepository::class);\n $this->app->bind(CountryToCodeMapperInterface::class, CountryToCodeMapper::class);\n $this->app->bind(PhoneNumbersValidatorInterface::class, PhoneNumbersRegexValidator::class);\n $this->app->bind(CustomersFilterServiceInterface::class, CustomersFilterService::class);\n $this->app->bind(CacheInterface::class, CacheAdapter::class);\n\n }", "public function boot()\n {\n if ($this->app->runningInConsole()) {\n $this->publishes([$this->configPath() => config_path('oauth.php')], 'oauth');\n }\n\n app()->bind(ClientToken::class, function () {\n return new ClientToken();\n });\n\n app()->bind(TokenParser::class, function () {\n return new TokenParser(\n app()->get(Request::class)\n );\n });\n\n app()->bind(OAuthClient::class, function () {\n return new OAuthClient(\n app()->get(Request::class),\n app()->get(ClientToken::class)\n );\n });\n\n app()->bind(AccountService::class, function () {\n return new AccountService(app()->get(OAuthClient::class));\n });\n }", "public function boot()\n {\n Client::observe(ClientObserver::class);\n $this->app->bind(ClientRepositoryInterface::class, function ($app) {\n return new ClientRepository(Client::class);\n });\n $this->app->bind(UserRepositoryInterface::class, function ($app) {\n return new UserRepository(User::class);\n });\n }", "public function boot()\n {\n $this->setupFacades(); \n //$this->setupConfigs(); \n }", "public function boot()\n {\n if ($this->app->runningInConsole()) {\n //\n }\n\n $this->loadRoutesFrom(__DIR__ . '/routes.php');\n }", "public function boot()\n {\n $path = __DIR__.'/../..';\n\n $this->package('clumsy/cms', 'clumsy', $path);\n\n $this->registerAuthRoutes();\n $this->registerBackEndRoutes();\n\n require $path.'/helpers.php';\n require $path.'/errors.php';\n require $path.'/filters.php';\n\n if ($this->app->runningInConsole()) {\n $this->app->make('Clumsy\\CMS\\Clumsy');\n }\n\n }", "public function boot()\n {\n $this->mergeConfigFrom(__DIR__ . '/../../config/bs4.php', 'bs4');\n $this->loadViewsFrom(__DIR__ . '/../../resources/views', 'bs');\n $this->loadTranslationsFrom(__DIR__ . '/../../resources/lang', 'bs');\n\n if ($this->app->runningInConsole())\n {\n $this->publishes([\n __DIR__ . '/../../resources/views' => resource_path('views/vendor/bs'),\n ], 'views');\n\n $this->publishes([\n __DIR__ . '/../../resources/lang' => resource_path('lang/vendor/bs'),\n ], 'lang');\n\n $this->publishes([\n __DIR__ . '/../../config' => config_path(),\n ], 'config');\n }\n }", "public function boot()\n {\n $this->client = new HttpClient([\n 'base_uri' => 'https://api.ipfinder.io/v1/',\n 'headers' => [\n 'User-Agent' => 'Laravel-GeoIP-Torann',\n ],\n 'query' => [\n 'token' => $this->config('key'),\n ],\n ]);\n }", "public function boot()\n {\n if ($this->app->runningInConsole()) {\n $this->commands([\n Check::class,\n Clear::class,\n Fix::class,\n Fresh::class,\n Foo::class,\n Ide::class,\n MakeDatabase::class,\n Ping::class,\n Version::class,\n ]);\n }\n }", "public function boot()\n {\n $app = $this->app;\n\n if (!$app->runningInConsole()) {\n return;\n }\n\n $source = realpath(__DIR__ . '/config/config.php');\n\n if (class_exists('Illuminate\\Foundation\\Application', false)) {\n // L5\n $this->publishes([$source => config_path('sniffer-rules.php')]);\n $this->mergeConfigFrom($source, 'sniffer-rules');\n } elseif (class_exists('Laravel\\Lumen\\Application', false)) {\n // Lumen\n $app->configure('sniffer-rules');\n $this->mergeConfigFrom($source, 'sniffer-rules');\n } else {\n // L4\n $this->package('chefsplate/sniffer-rules', null, __DIR__);\n }\n }", "public function boot()\r\n\t{\r\n\t\t$this->package('estey/hipsupport');\r\n\t\t$this->registerHipSupport();\r\n\t\t$this->registerHipSupportOnlineCommand();\r\n\t\t$this->registerHipSupportOfflineCommand();\r\n\r\n\t\t$this->registerCommands();\r\n\t}", "public function boot()\n {\n if ($this->app->runningInConsole()) {\n $this->commands([\n ControllerMakeCommand::class,\n ServiceMakeCommand::class,\n RepositoryMakeCommand::class,\n ModelMakeCommand::class,\n RequestRuleMakeCommand::class,\n ]);\n }\n }", "public function boot() {\n $srcDir = __DIR__ . '/../';\n \n $this->package('baseline/baseline', 'baseline', $srcDir);\n \n include $srcDir . 'Http/routes.php';\n include $srcDir . 'Http/filters.php';\n }", "public function boot()\n {\n $this->app->bind('App\\Services\\ProviderAccountService', function() {\n return new ProviderAccountService;\n });\n }", "public function boot()\n {\n $this->loadViewsFrom(__DIR__ . '/resources/views', 'Counters');\n\n $this->loadTranslationsFrom(__DIR__ . '/resources/lang', 'Counters');\n\n\n //To load migration files directly from the package\n// $this->loadMigrationsFrom(__DIR__ . '/../database/migrations');\n\n\n $this->app->booted(function () {\n $loader = AliasLoader::getInstance();\n $loader->alias('Counters', Counters::class);\n\n });\n\n $this->publishes([\n __DIR__ . '/../config/counter.php' => config_path('counter.php'),\n ], 'config');\n\n\n\n $this->publishes([\n __DIR__.'/../database/migrations/0000_00_00_000000_create_counters_tables.php' => $this->app->databasePath().\"/migrations/0000_00_00_000000_create_counters_tables.php\",\n ], 'migrations');\n\n\n if ($this->app->runningInConsole()) {\n $this->commands([\\Maher\\Counters\\Commands\\MakeCounter::class]);\n }\n\n\n }", "public function boot()\n {\n }", "public function boot()\n {\n }", "public function boot()\n {\n }", "public function boot()\n {\n }", "public function boot()\n {\n }", "public function boot()\n {\n }" ]
[ "0.73453546", "0.72135556", "0.72081316", "0.71238816", "0.7109842", "0.7083001", "0.70769954", "0.70724523", "0.7052233", "0.70260507", "0.7012621", "0.7004558", "0.695625", "0.69327486", "0.69320077", "0.6927346", "0.6911998", "0.6907486", "0.6899025", "0.68989617", "0.6896813", "0.68906784", "0.68873936", "0.6880893", "0.68767315", "0.68758136", "0.6870463", "0.6864928", "0.68644834", "0.6863535", "0.68603486", "0.6858409", "0.6855674", "0.68555903", "0.68527544", "0.6840107", "0.6832753", "0.68318903", "0.6827725", "0.6825416", "0.6824869", "0.68187785", "0.6813465", "0.68123096", "0.6812119", "0.68092316", "0.680718", "0.6801984", "0.68007284", "0.6800064", "0.67972654", "0.6791802", "0.67889494", "0.678636", "0.678597", "0.67841345", "0.67786235", "0.67742354", "0.67670685", "0.6766518", "0.67619574", "0.67617434", "0.6759516", "0.67570204", "0.67552006", "0.6752493", "0.67480195", "0.6745495", "0.67447144", "0.6744081", "0.67406017", "0.6739802", "0.6738829", "0.67386866", "0.6732356", "0.6731271", "0.6729832", "0.6726879", "0.6726465", "0.6719583", "0.6716927", "0.6716388", "0.6714778", "0.671367", "0.67029744", "0.6699302", "0.66918015", "0.6690485", "0.6686836", "0.6684275", "0.6683349", "0.6682057", "0.6680957", "0.6676536", "0.6676006", "0.66734093", "0.66734093", "0.66734093", "0.66734093", "0.66734093", "0.66734093" ]
0.0
-1
Register any application services.
public function register() { $this->app->singleton(Image\ImageHandlerInterface::class, function ($app) { $compressionQuality = Configs::get_value('compression_quality', 90); return new ImageHandler($compressionQuality); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function register()\n {\n $this->registerServices();\n }", "public function register()\n {\n $this->registerAssets();\n $this->registerServices();\n }", "public function register()\n\t{\n\n $this->registerUserService();\n $this->registerCountryService();\n $this->registerMetaService();\n $this->registerLabelService();\n $this->registerTypeService();\n $this->registerGroupeService();\n $this->registerActiviteService();\n $this->registerRiiinglinkService();\n $this->registerInviteService();\n $this->registerTagService();\n $this->registerAuthService();\n $this->registerChangeService();\n $this->registerRevisionService();\n $this->registerUploadService();\n //$this->registerTransformerService();\n }", "public function register()\n { \n // User Repository\n $this->app->bind('App\\Contracts\\Repository\\User', 'App\\Repositories\\User');\n \n // JWT Token Repository\n $this->app->bind('App\\Contracts\\Repository\\JSONWebToken', 'App\\Repositories\\JSONWebToken');\n \n $this->registerClearSettleApiLogin();\n \n $this->registerClearSettleApiClients();\n \n \n }", "public function register()\n {\n $this->registerRequestHandler();\n $this->registerAuthorizationService();\n $this->registerServices();\n }", "public function register()\n {\n $this->app->bind(\n PegawaiServiceContract::class,\n PegawaiService::class \n );\n\n $this->app->bind(\n RiwayatPendidikanServiceContract::class,\n RiwayatPendidikanService::class \n );\n\n $this->app->bind(\n ProductionHouseServiceContract::class,\n ProductionHouseService::class\n );\n\n $this->app->bind(\n MovieServiceContract::class,\n MovieService::class\n );\n\n $this->app->bind(\n PangkatServiceContract::class,\n PangkatService::class \n );\n\n }", "public function register()\n {\n // $this->app->bind('AuthService', AuthService::class);\n }", "public function register()\n {\n $this->registerServiceProviders();\n $this->registerSettingsService();\n $this->registerHelpers();\n }", "public function register()\n {\n $this->registerAccountService();\n\n $this->registerCurrentAccount();\n\n //$this->registerMenuService();\n\n //$this->registerReplyService();\n }", "public function register()\n {\n $this->registerRepositories();\n }", "public function register()\n {\n $this->registerFacades();\n $this->registerRespository();\n }", "public function register()\n {\n $this->app->bind('App\\Services\\UserService');\n $this->app->bind('App\\Services\\PostService');\n $this->app->bind('App\\Services\\MyPickService');\n $this->app->bind('App\\Services\\FacebookService');\n $this->app->bind('App\\Services\\LikeService');\n }", "public function register()\n {\n // service 由各个应用在 AppServiceProvider 单独绑定对应实现\n }", "public function register()\n {\n //\n if ($this->app->environment() !== 'production') {\n $this->app->register(\\Barryvdh\\LaravelIdeHelper\\IdeHelperServiceProvider::class);\n }\n\n\n\n\n $this->app->register(ResponseMacroServiceProvider::class);\n $this->app->register(TwitterServiceProvider::class);\n }", "public function register()\n {\n $this->registerGraphQL();\n\n $this->registerConsole();\n }", "public function register()\n {\n $this->app->register(RouteServiceProvider::class);\n\n $this->registerCommand();\n $this->registerSchedule();\n $this->registerDev();\n\n }", "public function register()\n {\n $this->mergeConfigFrom(\n __DIR__.'/../config/telescope-error-service-client.php', 'telescope-error-service-client'\n );\n\n $this->registerStorageDriver();\n\n $this->commands([\n Console\\InstallCommand::class,\n Console\\PublishCommand::class,\n ]);\n }", "public function register()\n\t{\n\t\t$this->registerPasswordBroker();\n\n\t\t$this->registerTokenRepository();\n\t}", "public function register()\n {\n $this->registerConfig();\n\n $this->app->register('Arcanedev\\\\LogViewer\\\\Providers\\\\UtilitiesServiceProvider');\n $this->registerLogViewer();\n $this->app->register('Arcanedev\\\\LogViewer\\\\Providers\\\\CommandsServiceProvider');\n }", "public function register() {\n $this->registerProviders();\n $this->registerFacades();\n }", "public function register()\n {\n // $this->app->make('CheckStructureService');\n }", "public function register()\n\t{\n\t\t$this->app->bind(\n\t\t\t'Illuminate\\Contracts\\Auth\\Registrar',\n\t\t\t'APIcoLAB\\Services\\Registrar'\n\t\t);\n\n $this->app->bind(\n 'APIcoLAB\\Repositories\\Flight\\FlightRepository',\n 'APIcoLAB\\Repositories\\Flight\\SkyScannerFlightRepository'\n );\n\n $this->app->bind(\n 'APIcoLAB\\Repositories\\Place\\PlaceRepository',\n 'APIcoLAB\\Repositories\\Place\\SkyScannerPlaceRepository'\n );\n\t}", "public function register()\n {\n $this->app->register(\\Maatwebsite\\Excel\\ExcelServiceProvider::class);\n $this->app->register(\\Intervention\\Image\\ImageServiceProvider::class);\n $this->app->register(\\Rap2hpoutre\\LaravelLogViewer\\LaravelLogViewerServiceProvider::class);\n $this->app->register(\\Yajra\\Datatables\\DatatablesServiceProvider::class);\n $this->app->register(\\Yajra\\Datatables\\ButtonsServiceProvider::class);\n\n $loader = null;\n if (class_exists('Illuminate\\Foundation\\AliasLoader')) {\n $loader = \\Illuminate\\Foundation\\AliasLoader::getInstance();\n }\n\n // Facades\n if ($loader != null) {\n $loader->alias('Image', \\Intervention\\Image\\Facades\\Image::class);\n $loader->alias('Excel', \\Maatwebsite\\Excel\\Facades\\Excel::class);\n\n }\n\n if (app()->environment() != 'production') {\n // Service Providers\n $this->app->register(\\Barryvdh\\LaravelIdeHelper\\IdeHelperServiceProvider::class);\n $this->app->register(\\Barryvdh\\Debugbar\\ServiceProvider::class);\n\n // Facades\n if ($loader != null) {\n $loader->alias('Debugbar', \\Barryvdh\\Debugbar\\Facade::class);\n }\n }\n\n if ($this->app->environment('local', 'testing')) {\n $this->app->register(\\Laravel\\Dusk\\DuskServiceProvider::class);\n }\n }", "public function register()\n {\n $this->registerInertia();\n $this->registerLengthAwarePaginator();\n }", "public function register()\n {\n $this->registerFlareFacade();\n $this->registerServiceProviders();\n $this->registerBindings();\n }", "public function register()\n {\n $this->app->bind(\n 'Toyopecas\\Repositories\\TopoRepository',\n 'Toyopecas\\Repositories\\TopoRepositoryEloquent'\n );\n\n $this->app->bind(\n 'Toyopecas\\Repositories\\ServicesRepository',\n 'Toyopecas\\Repositories\\ServicesRepositoryEloquent'\n );\n\n $this->app->bind(\n 'Toyopecas\\Repositories\\SobreRepository',\n 'Toyopecas\\Repositories\\SobreRepositoryEloquent'\n );\n\n $this->app->bind(\n 'Toyopecas\\Repositories\\ProdutosRepository',\n 'Toyopecas\\Repositories\\ProdutosRepositoryEloquent'\n );\n }", "public function register()\r\n {\r\n Passport::ignoreMigrations();\r\n\r\n $this->app->singleton(\r\n CityRepositoryInterface::class,\r\n CityRepository::class\r\n );\r\n\r\n $this->app->singleton(\r\n BarangayRepositoryInterface::class,\r\n BarangayRepository::class\r\n );\r\n }", "public function register()\n {\n $this->registerRepositories();\n\n $this->pushMiddleware();\n }", "public function register()\r\n {\r\n $this->mergeConfigFrom(__DIR__ . '/../config/laravel-base.php', 'laravel-base');\r\n\r\n $this->app->bind(UuidGenerator::class, UuidGeneratorService::class);\r\n\r\n }", "public function register()\n {\n\n $this->app->register(RepositoryServiceProvider::class);\n }", "public function register()\n {\n $this->app->bind(\n 'Uhmane\\Repositories\\ContatosRepository', \n 'Uhmane\\Repositories\\ContatosRepositoryEloquent'\n );\n }", "public function register()\r\n {\r\n $this->app->bind(\r\n ViberServiceInterface::class,\r\n ViberService::class\r\n );\r\n\r\n $this->app->bind(\r\n ApplicantServiceInterface::class,\r\n ApplicantService::class\r\n );\r\n }", "public function register()\n {\n $this->app->register('ProAI\\Datamapper\\Providers\\MetadataServiceProvider');\n\n $this->app->register('ProAI\\Datamapper\\Presenter\\Providers\\MetadataServiceProvider');\n\n $this->registerScanner();\n\n $this->registerCommands();\n }", "public function register()\n {\n $this->app->bind(\n 'Larafolio\\Http\\HttpValidator\\HttpValidator',\n 'Larafolio\\Http\\HttpValidator\\CurlValidator'\n );\n\n $this->app->register(ImageServiceProvider::class);\n }", "public function register()\n {\n // Register all repositories\n foreach ($this->repositories as $repository) {\n $this->app->bind(\"App\\Repository\\Contracts\\I{$repository}\",\n \"App\\Repository\\Repositories\\\\{$repository}\");\n }\n\n // Register all services\n foreach ($this->services as $service) {\n $this->app->bind(\"App\\Service\\Contracts\\I{$service}\", \n \"App\\Service\\Modules\\\\{$service}\");\n }\n }", "public function register()\n {\n $this->registerAdapterFactory();\n $this->registerDigitalOceanFactory();\n $this->registerManager();\n $this->registerBindings();\n }", "public function register()\n {\n // Only Environment local\n if ($this->app->environment() !== 'production') {\n foreach ($this->services as $serviceClass) {\n $this->registerClass($serviceClass);\n }\n }\n\n // Register Aliases\n $this->registerAliases();\n }", "public function register()\n {\n $this->app->bind(\n 'App\\Contracts\\UsersInterface',\n 'App\\Services\\UsersService'\n );\n $this->app->bind(\n 'App\\Contracts\\CallsInterface',\n 'App\\Services\\CallsService'\n );\n $this->app->bind(\n 'App\\Contracts\\ContactsInterface',\n 'App\\Services\\ContactsService'\n );\n $this->app->bind(\n 'App\\Contracts\\EmailsInterface',\n 'App\\Services\\EmailsService'\n );\n $this->app->bind(\n 'App\\Contracts\\PhoneNumbersInterface',\n 'App\\Services\\PhoneNumbersService'\n );\n $this->app->bind(\n 'App\\Contracts\\NumbersInterface',\n 'App\\Services\\NumbersService'\n );\n $this->app->bind(\n 'App\\Contracts\\UserNumbersInterface',\n 'App\\Services\\UserNumbersService'\n );\n }", "public function register()\n {\n //\n if (env('APP_DEBUG', false) && $this->app->isLocal()) {\n $this->app->register(\\Laravel\\Telescope\\TelescopeServiceProvider::class);\n $this->app->register(TelescopeServiceProvider::class);\n }\n }", "public function register()\n {\n $this->registerBrowser();\n\n $this->registerViewFinder();\n }", "public function register()\n {\n $this->registerFriendsLog();\n $this->registerNotifications();\n $this->registerAPI();\n $this->registerMailChimpIntegration();\n }", "public function register()\n {\n $this->mergeConfigFrom(__DIR__.'/../config/awesio-auth.php', 'awesio-auth');\n\n $this->app->singleton(AuthContract::class, Auth::class);\n\n $this->registerRepositories();\n\n $this->registerServices();\n\n $this->registerHelpers();\n }", "public function register()\n {\n $this->registerRepository();\n $this->registerMigrator();\n $this->registerArtisanCommands();\n }", "public function register()\n {\n $this->mergeConfigFrom(\n __DIR__.'/../config/services.php', 'services'\n );\n }", "public function register()\n {\n $this->registerRateLimiting();\n\n $this->registerHttpValidation();\n\n $this->registerHttpParsers();\n\n $this->registerResponseFactory();\n\n $this->registerMiddleware();\n }", "public function register()\n {\n $this->registerConfig();\n $this->registerView();\n $this->registerMessage();\n $this->registerMenu();\n $this->registerOutput();\n $this->registerCommands();\n require __DIR__ . '/Service/ServiceProvider.php';\n require __DIR__ . '/Service/RegisterRepoInterface.php';\n require __DIR__ . '/Service/ErrorHandling.php';\n $this->registerExportDompdf();\n $this->registerExtjs();\n }", "public function register()\n {\n $this->registerRepository();\n $this->registerParser();\n }", "public function register()\n {\n $this->registerOtherProviders()->registerAliases();\n $this->loadViewsFrom(__DIR__.'/../../resources/views', 'jarvisPlatform');\n $this->app->bind('jarvis.auth.provider', AppAuthenticationProvider::class);\n $this->loadRoutes();\n }", "public function register()\n {\n $loader = \\Illuminate\\Foundation\\AliasLoader::getInstance();\n\n $loader->alias('Laratrust', 'Laratrust\\LaratrustFacade');\n $loader->alias('Form', 'Collective\\Html\\FormFacade');\n $loader->alias('Html', 'Collective\\Html\\HtmlFacade');\n $loader->alias('Markdown', 'BrianFaust\\Parsedown\\Facades\\Parsedown');\n\n $this->app->register('Baum\\Providers\\BaumServiceProvider');\n $this->app->register('BrianFaust\\Parsedown\\ServiceProvider');\n $this->app->register('Collective\\Html\\HtmlServiceProvider');\n $this->app->register('Laravel\\Scout\\ScoutServiceProvider');\n $this->app->register('Laratrust\\LaratrustServiceProvider');\n\n $this->app->register('Christhompsontldr\\Laraboard\\Providers\\AuthServiceProvider');\n $this->app->register('Christhompsontldr\\Laraboard\\Providers\\EventServiceProvider');\n $this->app->register('Christhompsontldr\\Laraboard\\Providers\\ViewServiceProvider');\n\n $this->registerCommands();\n }", "public function register()\n {\n $this->registerGuard();\n $this->registerBladeDirectives();\n }", "public function register()\n {\n $this->registerConfig();\n\n $this->app->register(Providers\\ManagerServiceProvider::class);\n $this->app->register(Providers\\ValidationServiceProvider::class);\n }", "public function register()\n {\n $this->app->bind(ReviewService::class, function ($app) {\n return new ReviewService();\n });\n }", "public function register()\n {\n $this->app->bind(\n Services\\UserService::class,\n Services\\Implementations\\UserServiceImplementation::class\n );\n $this->app->bind(\n Services\\FamilyCardService::class,\n Services\\Implementations\\FamilyCardServiceImplementation::class\n );\n }", "public function register()\n {\n // register its dependencies\n $this->app->register(\\Cviebrock\\EloquentSluggable\\ServiceProvider::class);\n }", "public function register()\n {\n $this->app->bind('gameService', 'App\\Service\\GameService');\n }", "public function register()\n {\n $this->app->bind(VehicleRepository::class, GuzzleVehicleRepository::class);\n }", "public function register()\n {\n $this->app->bindShared(ElasticsearchNedvizhimostsObserver::class, function($app){\n return new ElasticsearchNedvizhimostsObserver(new Client());\n });\n\n // $this->app->bindShared(ElasticsearchNedvizhimostsObserver::class, function()\n // {\n // return new ElasticsearchNedvizhimostsObserver(new Client());\n // });\n }", "public function register()\n {\n // Register the app\n $this->registerApp();\n\n // Register Commands\n $this->registerCommands();\n }", "public function register()\n {\n $this->registerGeography();\n\n $this->registerCommands();\n\n $this->mergeConfig();\n\n $this->countriesCache();\n }", "public function register()\n {\n $this->app->bind(CertificationService::class, function($app){\n return new CertificationService();\n });\n }", "public function register()\n\t{\n\t\t$this->app->bind(\n\t\t\t'Illuminate\\Contracts\\Auth\\Registrar',\n\t\t\t'App\\Services\\Registrar'\n\t\t);\n \n $this->app->bind(\"App\\\\Services\\\\ILoginService\",\"App\\\\Services\\\\LoginService\");\n \n $this->app->bind(\"App\\\\Repositories\\\\IItemRepository\",\"App\\\\Repositories\\\\ItemRepository\");\n $this->app->bind(\"App\\\\Repositories\\\\IOutletRepository\",\"App\\\\Repositories\\\\OutletRepository\");\n $this->app->bind(\"App\\\\Repositories\\\\IInventoryRepository\",\"App\\\\Repositories\\\\InventoryRepository\");\n\t}", "public function register()\n {\n $this->registerRollbar();\n }", "public function register()\n {\n $this->app->bind('activity', function () {\n return new ActivityService(\n $this->app->make(Activity::class),\n $this->app->make(PermissionService::class)\n );\n });\n\n $this->app->bind('views', function () {\n return new ViewService(\n $this->app->make(View::class),\n $this->app->make(PermissionService::class)\n );\n });\n\n $this->app->bind('setting', function () {\n return new SettingService(\n $this->app->make(Setting::class),\n $this->app->make(Repository::class)\n );\n });\n\n $this->app->bind('images', function () {\n return new ImageService(\n $this->app->make(Image::class),\n $this->app->make(ImageManager::class),\n $this->app->make(Factory::class),\n $this->app->make(Repository::class)\n );\n });\n }", "public function register()\n {\n App::bind('CreateTagService', function($app) {\n return new CreateTagService;\n });\n\n App::bind('UpdateTagService', function($app) {\n return new UpdateTagService;\n });\n }", "public function register()\n {\n $this->registerDomainLocalization();\n $this->registerDomainLocaleFilter();\n }", "public function register()\n {\n $this->app->register(RouteServiceProvider::class);\n $this->app->register(MailConfigServiceProvider::class);\n }", "public function register()\n {\n $this->registerUserProvider();\n $this->registerGroupProvider();\n $this->registerNeo();\n\n $this->registerCommands();\n\n $this->app->booting(function()\n {\n $loader = \\Illuminate\\Foundation\\AliasLoader::getInstance();\n $loader->alias('Neo', 'Wetcat\\Neo\\Facades\\Neo');\n });\n }", "public function register()\n {\n //\n $this->app->bind(\n 'App\\Repositories\\Interfaces\\CompanyInterface', \n 'App\\Repositories\\CompanyRepo'\n );\n $this->app->bind(\n 'App\\Repositories\\Interfaces\\UtilityInterface', \n 'App\\Repositories\\UtilityRepo'\n );\n }", "public function register()\n {\n $this->registerPayment();\n\n $this->app->alias('image', 'App\\Framework\\Image\\ImageService');\n }", "public function register()\n {\n $this->app->bind(AttributeServiceInterface::class,AttributeService::class);\n $this->app->bind(ProductServiceIntarface::class,ProductService::class);\n\n\n }", "public function register()\n {\n App::bind('App\\Repositories\\UserRepositoryInterface','App\\Repositories\\UserRepository');\n App::bind('App\\Repositories\\AnimalRepositoryInterface','App\\Repositories\\AnimalRepository');\n App::bind('App\\Repositories\\DonationTypeRepositoryInterface','App\\Repositories\\DonationTypeRepository');\n App::bind('App\\Repositories\\NewsAniRepositoryInterface','App\\Repositories\\NewsAniRepository');\n App::bind('App\\Repositories\\DonationRepositoryInterface','App\\Repositories\\DonationRepository');\n App::bind('App\\Repositories\\ProductRepositoryInterface','App\\Repositories\\ProductRepository');\n App::bind('App\\Repositories\\CategoryRepositoryInterface','App\\Repositories\\CategoryRepository');\n App::bind('App\\Repositories\\TransferMoneyRepositoryInterface','App\\Repositories\\TransferMoneyRepository');\n App::bind('App\\Repositories\\ShippingRepositoryInterface','App\\Repositories\\ShippingRepository');\n App::bind('App\\Repositories\\ReserveProductRepositoryInterface','App\\Repositories\\ReserveProductRepository');\n App::bind('App\\Repositories\\Product_reserveRepositoryInterface','App\\Repositories\\Product_reserveRepository');\n App::bind('App\\Repositories\\Ordering_productRepositoryInterface','App\\Repositories\\Ordering_productRepository');\n App::bind('App\\Repositories\\OrderingRepositoryInterface','App\\Repositories\\OrderingRepository');\n App::bind('App\\Repositories\\UserUpdateSlipRepositoryInterface','App\\Repositories\\UserUpdateSlipRepository');\n }", "public function register()\n {\n if ($this->app->runningInConsole()) {\n $this->registerPublishing();\n }\n }", "public function register()\n {\n $this->app->bind(HttpClient::class, function ($app) {\n return new HttpClient();\n });\n\n $this->app->bind(SeasonService::class, function ($app) {\n return new SeasonService($app->make(HttpClient::class));\n });\n\n $this->app->bind(MatchListingController::class, function ($app) {\n return new MatchListingController($app->make(SeasonService::class));\n });\n\n }", "public function register()\n {\n $this->setupConfig();\n\n $this->bindServices();\n }", "public function register()\n {\n if ($this->app->runningInConsole()) {\n $this->commands([\n Console\\MakeEndpointCommand::class,\n Console\\MakeControllerCommand::class,\n Console\\MakeRepositoryCommand::class,\n Console\\MakeTransformerCommand::class,\n Console\\MakeModelCommand::class,\n ]);\n }\n\n $this->registerFractal();\n }", "public function register()\n {\n $this->app->register(RouteServiceProvider::class);\n $this->app->register(AuthServiceProvider::class);\n }", "public function register()\n {\n\n $config = $this->app['config']['cors'];\n\n $this->app->bind('Yocome\\Cors\\CorsService', function() use ($config){\n return new CorsService($config);\n });\n\n }", "public function register()\n {\n // Bind facade\n\n $this->registerRepositoryBibdings();\n $this->registerFacades();\n $this->app->register(RouteServiceProvider::class);\n $this->app->register(\\Laravel\\Socialite\\SocialiteServiceProvider::class);\n }", "public function register()\n {\n\n\n\n $this->app->bind(\n 'Onlinecorrection\\Repositories\\UserRepository',\n 'Onlinecorrection\\Repositories\\UserRepositoryEloquent'\n );\n\n $this->app->bind(\n 'Onlinecorrection\\Repositories\\ClientRepository',\n 'Onlinecorrection\\Repositories\\ClientRepositoryEloquent'\n );\n\n $this->app->bind(\n 'Onlinecorrection\\Repositories\\ProjectRepository',\n 'Onlinecorrection\\Repositories\\ProjectRepositoryEloquent'\n );\n\n $this->app->bind(\n 'Onlinecorrection\\Repositories\\DocumentRepository',\n 'Onlinecorrection\\Repositories\\DocumentRepositoryEloquent'\n );\n\n $this->app->bind(\n 'Onlinecorrection\\Repositories\\OrderRepository',\n 'Onlinecorrection\\Repositories\\OrderRepositoryEloquent'\n );\n\n $this->app->bind(\n 'Onlinecorrection\\Repositories\\OrderItemRepository',\n 'Onlinecorrection\\Repositories\\OrderItemRepositoryEloquent'\n );\n\n $this->app->bind(\n 'Onlinecorrection\\Repositories\\DocumentImageRepository',\n 'Onlinecorrection\\Repositories\\DocumentImageRepositoryEloquent'\n );\n $this->app->bind(\n 'Onlinecorrection\\Repositories\\PackageRepository',\n 'Onlinecorrection\\Repositories\\PackageRepositoryEloquent'\n );\n $this->app->bind(\n 'Onlinecorrection\\Repositories\\StatusRepository',\n 'Onlinecorrection\\Repositories\\StatusRepositoryEloquent'\n );\n\n }", "public function register()\n {\n $this->registerConfig();\n\n $this->registerDataStore();\n\n $this->registerStorageFactory();\n\n $this->registerStorageManager();\n\n $this->registerSimplePhoto();\n }", "public function register()\n {\n // Default configuration file\n $this->mergeConfigFrom(\n __DIR__.'/Config/auzo_tools.php', 'auzoTools'\n );\n\n $this->registerModelBindings();\n $this->registerFacadesAliases();\n }", "public function register()\n {\n $this->app->bind(\\Cookiesoft\\Repositories\\CategoryRepository::class, \\Cookiesoft\\Repositories\\CategoryRepositoryEloquent::class);\n $this->app->bind(\\Cookiesoft\\Repositories\\BillpayRepository::class, \\Cookiesoft\\Repositories\\BillpayRepositoryEloquent::class);\n $this->app->bind(\\Cookiesoft\\Repositories\\UserRepository::class, \\Cookiesoft\\Repositories\\UserRepositoryEloquent::class);\n //:end-bindings:\n }", "public function register()\n {\n $this->app->singleton(ThirdPartyAuthService::class, function ($app) {\n return new ThirdPartyAuthService(\n config('settings.authentication_services'),\n $app['Laravel\\Socialite\\Contracts\\Factory'],\n $app['Illuminate\\Contracts\\Auth\\Factory']\n );\n });\n\n $this->app->singleton(ImageValidator::class, function ($app) {\n return new ImageValidator(\n config('settings.image.max_filesize'),\n config('settings.image.mime_types'),\n $app['Intervention\\Image\\ImageManager']\n );\n });\n\n $this->app->singleton(ImageService::class, function ($app) {\n return new ImageService(\n config('settings.image.max_width'),\n config('settings.image.max_height'),\n config('settings.image.folder')\n );\n });\n\n $this->app->singleton(RandomWordService::class, function ($app) {\n return new RandomWordService(\n $app['App\\Repositories\\WordRepository'],\n $app['Illuminate\\Session\\SessionManager'],\n config('settings.number_of_words_to_remember')\n );\n });\n\n $this->app->singleton(WordRepository::class, function ($app) {\n return new WordRepository(config('settings.min_number_of_chars_per_one_mistake_in_search'));\n });\n\n $this->app->singleton(CheckAnswerService::class, function ($app) {\n return new CheckAnswerService(\n $app['Illuminate\\Session\\SessionManager'],\n config('settings.min_number_of_chars_per_one_mistake')\n );\n });\n\n if ($this->app->environment() !== 'production') {\n $this->app->register(\\Barryvdh\\LaravelIdeHelper\\IdeHelperServiceProvider::class);\n }\n }", "public function register()\n {\n $this->registerJWT();\n $this->registerJWSProxy();\n $this->registerJWTAlgoFactory();\n $this->registerPayload();\n $this->registerPayloadValidator();\n $this->registerPayloadUtilities();\n\n // use this if your package has a config file\n // config([\n // 'config/JWT.php',\n // ]);\n }", "public function register()\n {\n $this->registerManager();\n $this->registerConnection();\n $this->registerWorker();\n $this->registerListener();\n $this->registerFailedJobServices();\n $this->registerOpisSecurityKey();\n }", "public function register()\n {\n $this->app->register(RouterServiceProvider::class);\n }", "public function register()\n {\n $this->app->bind('App\\Services\\TripService.php', function ($app) {\n return new TripService();\n });\n }", "public function register()\n {\n $this->registerUserComponent();\n $this->registerLocationComponent();\n\n }", "public function register()\n {\n $this->app->bind(\n \\App\\Services\\UserCertificate\\IUserCertificateService::class,\n \\App\\Services\\UserCertificate\\UserCertificateService::class\n );\n }", "public function register()\n {\n $this->app->bind(FacebookMarketingContract::class,FacebookMarketingService::class);\n }", "public function register()\n {\n /**\n * Register additional service\n * providers if they exist.\n */\n foreach ($this->providers as $provider) {\n if (class_exists($provider)) {\n $this->app->register($provider);\n }\n }\n }", "public function register()\n {\n $this->app->singleton('composer', function($app)\n {\n return new Composer($app['files'], $app['path.base']);\n });\n\n $this->app->singleton('forge', function($app)\n {\n return new Forge($app);\n });\n\n // Register the additional service providers.\n $this->app->register('Nova\\Console\\ScheduleServiceProvider');\n $this->app->register('Nova\\Queue\\ConsoleServiceProvider');\n }", "public function register()\n {\n\n\n\n $this->mergeConfigFrom(__DIR__ . '/../config/counter.php', 'counter');\n\n $this->app->register(RouteServiceProvider::class);\n\n\n }", "public function register()\r\n {\r\n $this->mergeConfigFrom(__DIR__.'/../config/colissimo.php', 'colissimo');\r\n $this->mergeConfigFrom(__DIR__.'/../config/rules.php', 'colissimo.rules');\r\n $this->mergeConfigFrom(__DIR__.'/../config/prices.php', 'colissimo.prices');\r\n $this->mergeConfigFrom(__DIR__.'/../config/zones.php', 'colissimo.zones');\r\n $this->mergeConfigFrom(__DIR__.'/../config/insurances.php', 'colissimo.insurances');\r\n $this->mergeConfigFrom(__DIR__.'/../config/supplements.php', 'colissimo.supplements');\r\n // Register the service the package provides.\r\n $this->app->singleton('colissimo', function ($app) {\r\n return new Colissimo;\r\n });\r\n }", "public function register(){\n $this->registerDependencies();\n $this->registerAlias();\n $this->registerServiceCommands();\n }", "public function register()\n {\n $this->app->bind(\n \\App\\Services\\Survey\\ISurveyService::class,\n \\App\\Services\\Survey\\SurveyService::class\n );\n $this->app->bind(\n \\App\\Services\\Survey\\ISurveyQuestionService::class,\n \\App\\Services\\Survey\\SurveyQuestionService::class\n );\n\n $this->app->bind(\n \\App\\Services\\Survey\\ISurveyAttemptService::class,\n \\App\\Services\\Survey\\SurveyAttemptService::class\n );\n\n $this->app->bind(\n \\App\\Services\\Survey\\ISurveyAttemptDataService::class,\n \\App\\Services\\Survey\\SurveyAttemptDataService::class\n );\n }", "public function register()\n {\n $this->mergeConfigFrom(\n __DIR__ . '/../config/atlas.php', 'atlas'\n );\n \n $this->app->singleton(CoreContract::class, Core::class);\n \n $this->registerFacades([\n 'Atlas' => 'Atlas\\Facades\\Atlas',\n ]);\n }", "public function register()\n {\n $this->app->bind(TelescopeRouteServiceContract::class, TelescopeRouteService::class);\n }", "public function register()\n {\n $this->registerRepositoryBindings();\n\n $this->registerInterfaceBindings();\n\n $this->registerAuthorizationServer();\n\n $this->registerResourceServer();\n\n $this->registerFilterBindings();\n\n $this->registerCommands();\n }", "public function register()\n {\n $this->mergeConfigFrom(__DIR__.'/../config/faithgen-events.php', 'faithgen-events');\n\n $this->app->singleton(EventsService::class);\n $this->app->singleton(GuestService::class);\n }", "public function register()\n {\n $this->registerAliases();\n $this->registerFormBuilder();\n\n // Register package commands\n $this->commands([\n 'CoreDbCommand',\n 'CoreSetupCommand',\n 'CoreSeedCommand',\n 'EventEndCommand',\n 'ArchiveMaxAttempts',\n 'CronCommand',\n 'ExpireInstructors',\n 'SetTestLock',\n 'StudentArchiveTraining',\n 'TestBuildCommand',\n 'TestPublishCommand',\n ]);\n\n // Merge package config with one in outer app \n // the app-level config will override the base package config\n $this->mergeConfigFrom(\n __DIR__.'/../config/core.php', 'core'\n );\n\n // Bind our 'Flash' class\n $this->app->bindShared('flash', function () {\n return $this->app->make('Hdmaster\\Core\\Notifications\\FlashNotifier');\n });\n\n // Register package dependencies\n $this->app->register('Collective\\Html\\HtmlServiceProvider');\n $this->app->register('Bootstrapper\\BootstrapperL5ServiceProvider');\n $this->app->register('Codesleeve\\LaravelStapler\\Providers\\L5ServiceProvider');\n $this->app->register('PragmaRX\\ZipCode\\Vendor\\Laravel\\ServiceProvider');\n $this->app->register('Rap2hpoutre\\LaravelLogViewer\\LaravelLogViewerServiceProvider');\n\n $this->app->register('Zizaco\\Confide\\ServiceProvider');\n $this->app->register('Zizaco\\Entrust\\EntrustServiceProvider');\n }" ]
[ "0.7879658", "0.7600202", "0.74930716", "0.73852855", "0.736794", "0.7306089", "0.7291359", "0.72896826", "0.72802424", "0.7268026", "0.7267702", "0.72658145", "0.7249053", "0.72171587", "0.7208486", "0.7198799", "0.7196415", "0.719478", "0.7176513", "0.7176227", "0.7164647", "0.71484524", "0.71337837", "0.7129424", "0.71231985", "0.7120174", "0.7103653", "0.71020955", "0.70977163", "0.7094701", "0.7092148", "0.70914364", "0.7088618", "0.7087278", "0.70827085", "0.70756096", "0.7075115", "0.70741326", "0.7071857", "0.707093", "0.7070619", "0.7067406", "0.7066438", "0.7061766", "0.70562875", "0.7051525", "0.7049684", "0.70467263", "0.7043264", "0.7043229", "0.70429426", "0.7042174", "0.7038729", "0.70384216", "0.70348704", "0.7034105", "0.70324445", "0.70282733", "0.7025024", "0.702349", "0.7023382", "0.702262", "0.7022583", "0.7022161", "0.702139", "0.7021084", "0.7020801", "0.7019928", "0.70180106", "0.7017351", "0.7011482", "0.7008627", "0.7007786", "0.70065045", "0.7006424", "0.70060986", "0.69992065", "0.699874", "0.69980377", "0.69980335", "0.6997871", "0.6996457", "0.69961494", "0.6994749", "0.6991596", "0.699025", "0.6988414", "0.6987274", "0.69865865", "0.69862866", "0.69848233", "0.6978736", "0.69779474", "0.6977697", "0.6976002", "0.69734764", "0.6972392", "0.69721776", "0.6970663", "0.6968296", "0.696758" ]
0.0
-1
/ / METODOS PRIVADOS / / / METODOS PUBLICOS /
public function index() { $dados = array(); $albuns = new Albuns(); $dados['albuns'] = $albuns->getListaAlbuns(); $this->loadTemplate('galeria', $dados); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function metodo_privado() {\n }", "public function testPrivs()\n {\n return true; ///< Every client sees only it's own information\n }", "public function privileges()\n {\n $this->privileges = $this->Acces->list($_SESSION['guild_id'],'privilege');\n }", "public function marcarPunto( ) {\n $this->addNumeroIP(\".\");\n\n }", "public function buscarUsuarios(){\n\t\t}", "function ShowAdministrar($peliculas, $generos){\n if (isset($_SESSION['email'])){\n $this->setUserBasicsToSmarty();\n $this->smarty->display('templates/admin.tpl');\n }else{\n $this->ReLocalizar(\"login\");\n }\n }", "function constroe_campo_administrar(){\n\n// globals\nglobal $idioma;\nglobal $pagina_href;\n\n// valida usuario administrador\nif(retorne_usuario_administrador() == false){\n\n// retorno nulo\nreturn null;\n\t\n};\n\n// titulo\n$titulo = $idioma[18];\n\n// links de administrador\n$links[] = \"<a href='$pagina_href[3]'>$idioma[19]</a>\";\n$links[] = \"<a href='$pagina_href[4]'>$idioma[47]</a>\";\n$links[] = \"<a href='$pagina_href[6]'>$idioma[22]</a>\";\n$links[] = \"<a href='$pagina_href[7]'>$idioma[23]</a>\";\n$links[] = \"<a href='$pagina_href[9]'>$idioma[25]</a>\";\n$links[] = \"<a href='$pagina_href[10]'>$idioma[26]</a>\";\n$links[] = \"<a href='$pagina_href[11]'>$idioma[27]</a>\";\n$links[] = \"<a href='$pagina_href[12]'>$idioma[28]</a>\";\n$links[] = \"<a href='$pagina_href[14]'>$idioma[30]</a>\";\n\n// conteudo\n$conteudo = constroe_links_menu_vertical($links);\n\n// codigo html\n$codigo_html = constroe_menu_navegacao_vertical($titulo, $conteudo);\n\n// retorno\nreturn $codigo_html;\n\n}", "function ssh2_publickey_list($pkey)\n{\n}", "public function truycapvao_private_cha(){\n }", "public function formRegistrazionePrivato() {\n $this->smarty->display('reg_privato.tpl');\n }", "function getAllAccess() {\n return ['download', 'remoteAccess', 'remoteService', 'enclave','notAvailable'];\n}", "public function perms()\n {\n static $perms = array();\n\n if (!empty($perms)) {\n return $perms;\n }\n\n require_once dirname(__FILE__) . '/base.php';\n\n $perms['title']['beatnik:domains'] = _(\"Domains\");\n\n // Run through every domain\n foreach ($GLOBALS['beatnik_driver']->getDomains() as $domain) {\n $perms['tree']['beatnik']['domains'][$domain['zonename']] = false;\n $perms['title']['beatnik:domains:' . $domain['zonename']] = $domain['zonename'];\n }\n\n return $perms;\n }", "function anadir_usuario(){\n // If $certificate is set, public key has been successfully received\n $certificate = get_certificate();\n if ($certificate != \"\") {\n // Check if certificate syntax is correct\n if(check_certificate($certificate)) {\n $name = get_remote_user();\n $response = doit($name, $certificate);\n // Check if command executed successfully\n if($response)\n return 1;\n else \n return -2;\n } else {\n return -1;\n }\n }\n else return -3;\n}", "public function __construct() {\n parent::__construct();\n $this->privileges = [\"page-all\", \"page-services-dhcpserver\"];\n\n }", "public function ctrRutaServidor(){\n\n return 'http://localhost:8088/anunciosahagun/confAdmin/';\n }", "function VisibleToAdminUser()\n {\n\tinclude (\"dom.php\");\n return $this->CheckPermission($pavad.' Use');\n }", "static function setPrivato($id){\n if(!CUtente::verificalogin())header('Location: /Progetto/Utente/homepagedef');\n else{\n session_start();\n if(!isset($_SESSION['location'])) header('Location: /Progetto/Utente/homepagedef');\n else{\n if(stripos($_SESSION['location'],'Watchlist')!==false && FPersistentManager::exist('id',$id,'FWatchlist')){\n $w=FPersistentManager::load('id',$id,'FWatchlist');\n $w=clone($w[0]);\n if($w->getProprietario()==$_SESSION['utente']->getUsername())\n FPersistentManager::update('pubblico',0,'id',$id,'FWatchlist');\n\n }\n\n header('Location: /Progetto'.$_SESSION['location']);\n\n }\n //header('Location: /Progetto/Utente/homepagedef');\n\n }\n\n}", "function cambiarClaveServSoc()\n {\n }", "public function publicaciones() //Lleva ID del proveedor para hacer carga de BD\r\n\t{\r\n\t\t//Paso a ser totalmente otro modulo para generar mejor el proceso de visualizacion y carga de datos en la vistas\r\n\r\n\t}", "function CreeKey () { // Creation de la cle pour ssh\n\tif (!file_exists('/var/remote_adm/.ssh')) {\n\t\tmkdir(\"/var/remote_adm/.ssh\",0744);\n\t}\n\tif (!file_exists('/var/remote_adm/.ssh/id_rsa.pub')) {\n\t\texec(\"/usr/bin/ssh-keygen -t rsa -N '' -f /var/remote_adm/.ssh/id_rsa\");\n\t}\n}", "function virustotalscan_admin_permissions(&$admin_permissions)\r\n{\r\n \tglobal $lang;\r\n // se incarca fisierul de limba\r\n \t$lang->load(\"virustotalscan\", false, true);\r\n // se seteaza textul permisiunii\r\n\t$admin_permissions['virustotalscan'] = $lang->virustotalscan_canmanage;\r\n}", "private function cargar_acceso_nodos($parametros){\r\n // echo $_SESSION[CookIdUsuario];\r\n //print_r($parametros);\r\n if (strlen($parametros[cod_link])>0){\r\n if(!class_exists('mos_acceso')){\r\n import(\"clases.mos_acceso.mos_acceso\");\r\n }\r\n $acceso = new mos_acceso(); \r\n if ($_SESSION[SuperUser]=='S')\r\n unset($parametros[terceros]); \r\n $data_ids_acceso = $acceso->obtenerNodosArbol($_SESSION[CookIdUsuario],$parametros[cod_link],$parametros[modo],$parametros[terceros]);\r\n //print_r($data_ids_acceso);\r\n foreach ($data_ids_acceso as $value) {\r\n $this->id_org_acceso[$value[id]] = $value;\r\n } \r\n }\r\n }", "private function mprofil() {\n\t\t\t$this->_ctrlAdmin = new ControleurAdmin();\n\t\t\t$this->_ctrlAdmin->userProfil();\n\t}", "function listarPerfilPrivilegios($url, $id = 0){\n\t\t$s = 'SELECT p.oid,p.nomb,prv.oid AS oidp,prv.id, prv.nomb AS bnom, COALESCE(upp.visi,0) AS visi\n\t\t\t\tFROM space.privilegio prv\n\t\t\t\tJOIN space.menu_accion ma ON prv.para=ma.url\n\t\t\t\tJOIN space.perfil_privilegio pp ON pp.oidpr=prv.oid\n\t\t\t\tJOIN space.perfil p ON p.oid=pp.oidp\n\t\t\t\tLEFT JOIN space.usuario_perfil up on p.oid=up.oidp\n\t\t\t\tLEFT JOIN space.usuario u ON u.id=up.oidu\n\t\t\t\tLEFT JOIN space.usuario_perfil_privilegio upp ON \n\t\t\t\tupp.oidu = u.id AND\n\t\t\t\tupp.oidp = p.oid AND\n\t\t\t\tupp.oidpr = prv.oid\n\t\t\t\tWHERE ma.url=\\'' . $url . '\\' AND u.id=' . $id;\n\n\t\t\n\t\t//echo $s;\n\t\t$obj = $this->DBSpace->consultar($s);\n\n\t\t$lst = array();\n\t\t$lstp = array();\n\t\tif($obj->cant == 0 ){\n\t\t\t$s = 'SELECT p.oid,p.nomb,prv.oid AS oidp,prv.id, prv.nomb AS bnom, prv.visi\n\t\t\t\tFROM space.privilegio prv\n\t\t\t\tJOIN space.menu_accion ma ON prv.para=ma.url\n\t\t\t\tJOIN space.perfil_privilegio pp ON pp.oidpr=prv.oid\n\t\t\t\tJOIN space.perfil p ON p.oid=pp.oidp\n\t\t\t\tWHERE ma.url=\\'' . $url . '\\'';\n\t\t\t$obj = $this->DBSpace->consultar($s);\n\t\t\tif($obj->cant == 0 )return $lst;\n\t\t}\n\t\t\n\t\t$perfil = $obj->rs[0]->nomb;\n\t\tforeach ($obj->rs as $clv => $v) {\n\t\t\tif($perfil != $v->nomb){\n\t\t\t\t$lst[$perfil] = $lstp;\n\t\t\t\t$perfil = $v->nomb;\n\t\t\t\t$lstp = null;\n\t\t\t}\n\t\t\t$lstp[] = array(\n\t\t\t\t'oidp' => $v->oid,\n\t\t\t\t'cod'=> $v->oidp,\n\t\t\t\t'nomb' => $v->bnom,\n\t\t\t\t'visi' => $v->visi\n\t\t\t);\n\t\t}\n\t\t$lst[$perfil] = $lstp;\n\t\t\n\t\treturn $lst;\n\t}", "function perms($file) {\n$perms = fileperms($file);\n\nif (($perms & 0xC000) == 0xC000) {\n // Socket\n $info = 's';\n} elseif (($perms & 0xA000) == 0xA000) {\n // Symbolic Link\n $info = 'l';\n} elseif (($perms & 0x8000) == 0x8000) {\n // Regular\n $info = '-';\n} elseif (($perms & 0x6000) == 0x6000) {\n // Block special\n $info = 'b';\n} elseif (($perms & 0x4000) == 0x4000) {\n // Directory\n $info = 'd';\n} elseif (($perms & 0x2000) == 0x2000) {\n // Character special\n $info = 'c';\n} elseif (($perms & 0x1000) == 0x1000) {\n // FIFO pipe\n $info = 'p';\n} else {\n // Unknown\n $info = 'u';\n}\n\n// Owner\n$info .= (($perms & 0x0100) ? 'r' : '-');\n$info .= (($perms & 0x0080) ? 'w' : '-');\n$info .= (($perms & 0x0040) ?\n (($perms & 0x0800) ? 's' : 'x' ) :\n (($perms & 0x0800) ? 'S' : '-'));\n\n// Group\n$info .= (($perms & 0x0020) ? 'r' : '-');\n$info .= (($perms & 0x0010) ? 'w' : '-');\n$info .= (($perms & 0x0008) ?\n (($perms & 0x0400) ? 's' : 'x' ) :\n (($perms & 0x0400) ? 'S' : '-'));\n\n// World\n$info .= (($perms & 0x0004) ? 'r' : '-');\n$info .= (($perms & 0x0002) ? 'w' : '-');\n$info .= (($perms & 0x0001) ?\n (($perms & 0x0200) ? 't' : 'x' ) :\n (($perms & 0x0200) ? 'T' : '-'));\n return $info;\n}", "function index_usuarios() {\n\t\t$conditions = array('Administrativo.perfil >' => '0'); \n\t\t$order = array('Administrativo.nombre' => 'ASC');\n\t\t$administrativos=$this->Administrativo->find('all', array ('conditions' => $conditions, 'order' => $order));\t\t\n\t\t$perfil=$this->Perfil->find('all');\n\t\tforeach ($perfil as $p){\n\t\t\t$perfiles[$p['Perfil']['id']]=$p['Perfil']['perfil'];\n\t\t}\n\t\t$perfiles[0]='SuperAdministrador';\n\t\t$this->set('perfiles', $perfiles);\n\t\t$this->set('administrativos', $administrativos);\n\t}", "public function PrintAuthInfo() \n {\n if($this->IsAuthenticated())\n echo \"Du är inloggad som: <b>\" . $this->GetAcronym() . \"</b> (\" . $this->GetName() . \")\";\n else\n echo \"Du är <b>UTLOGGAD</b>.\";\n }", "function _getHpsaFileOwner($server_ip, $server_port, $username, $password)\n{\n\t//\n\t// Inputs: hpsa access info\n\t//\t$server_ip\n\t//\t$server_port\n\t//\t$username\n\t//\t$password\n\t// Output: \n\t//\t$fileOwner - sa_user_name\n\t//\n\t_log(\"getHpsaFileOwner: Starting.\",\"info\");\n\tglobal $hpmid, $ostype, $cmd_exitcode;\n\n\t$filesRootDir = \"/opsw/.Server.ID/$hpmid/files/\";\n\t$files = _execHpsaCmd($server_ip, $server_port, $username, $password, \"ls $filesRootDir\");\n\tif ($cmd_exitcode <> 0)\n\t{\n\t\t_log(\"getHpsaFileOwner: unable to find SA files owner.\",\"debug\");\n\t}\n\telse\n\t{\n\t\t$files_array = preg_split('/\\s+/', $files);\n\t\t_log(\"getHpsaFileOwner: files: $files.\",\"debug\");\n\t\tforeach ($files_array as $file)\n\t\t{\n\t\t\tif (($ostype == 'windows') ||($ostype == 'x64.win'))\n\t\t\t{\n\t\t\t\t$filePath = \"$filesRootDir\" . $file . \"/C/\";\n\t\t\t\t_log(\"getHpsaFileOwner: ostype: $ostype (windows).\",\"debug\");\n\t\t\t}\n\t\t\telseif (($ostype =='linux') || ($ostype == 'x64.linux'))\n\t\t\t{\n\t\t\t\t$filePath = \"$filesRootDir\" . $file . \"/\";\n\t\t\t\t_log(\"getHpsaFileOwner: ostype: $ostype (linux).\",\"debug\");\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$filePath = \"$filesRootDir\";\n\t\t\t\t_log(\"getHpsaFileOwner: ostype: $ostype (other).\",\"debug\");\n\t\t\t}\n\t\t\t\n\t\t\t_log(\"getHpsaFileOwner: file: $file.\",\"debug\");\n\t\t\t$osFiles = _execHpsaCmd($server_ip, $server_port, $username, $password, \"ls $filePath\");\n\t\t\t_log(\"getHpsaFileOwner: osFiles: $osFiles.\",\"debug\");\n\t\t\t_log(\"getHpsaFileOwner: cmd_exitcode: $cmd_exitcode.\",\"debug\");\n\t\t\tif (!empty($osFiles) && $cmd_exitcode == 0)\n\t\t\t{\n\t\t\t\t$filesOwner = $file;\n\t\t\t\t_log(\"getHpsaFileOwner: filesOwner: $filesOwner.\",\"debug\");\n\t\t\t\tbreak 1;\n\t\t\t}\n\t\t}\n\t}\n\t_log(\"getHpsaFileOwner: Exiting.\",\"info\");\n\treturn $filesOwner;\n}", "public function guardarTop($punts){\n $path = storage_path('app/tops.txt');\n $file = fopen($path,\"a\");\n fputs($file, \"email=\".session('em').\"&pass=\".session('pw').\"&punts=\".$punts.\"\\n\");\n fclose($file);\n }", "public function getPerms($file){\n $permisos = fileperms($file);\n\n if (($permisos & 0xC000) == 0xC000) {\n // Socket\n $type = 's';\n } elseif (($permisos & 0xA000) == 0xA000) {\n // Symbolic link\n $type = 'l';\n } elseif (($permisos & 0x8000) == 0x8000) {\n // Regular\n $type = '-';\n } elseif (($permisos & 0x6000) == 0x6000) {\n // Special block\n $type = 'b';\n } elseif (($permisos & 0x4000) == 0x4000) {\n // Directory\n $type = 'd';\n } elseif (($permisos & 0x2000) == 0x2000) {\n // Especial Carácter\n $type = 'c';\n } elseif (($permisos & 0x1000) == 0x1000) {\n // FIFO Pipe\n $type = 'p';\n } else {\n // Unknown\n $type = 'u';\n }\n\n $owner = (($permisos & 0x0100) ? 'r' : '-');\n $owner .= (($permisos & 0x0080) ? 'w' : '-');\n $owner .= (($permisos & 0x0040) ?\n (($permisos & 0x0800) ? 's' : 'x' ) :\n (($permisos & 0x0800) ? 'S' : '-'));\n\n $group = (($permisos & 0x0020) ? 'r' : '-');\n $group .= (($permisos & 0x0010) ? 'w' : '-');\n $group .= (($permisos & 0x0008) ?\n (($permisos & 0x0400) ? 's' : 'x' ) :\n (($permisos & 0x0400) ? 'S' : '-'));\n\n $other = (($permisos & 0x0004) ? 'r' : '-');\n $other .= (($permisos & 0x0002) ? 'w' : '-');\n $other .= (($permisos & 0x0001) ? \n (($permisos & 0x0200) ? 't' : 'x' ) : \n (($permisos & 0x0200) ? 'T' : '-'));\n \n return array(\n 'name' => $file, \n 'type' => $type,\n 'owner' => $owner,\n 'group' => $group,\n 'other' => $other,\n );\n }", "private function getListaUsuarioAutorizado()\r\n\t {\r\n\t \treturn [\r\n\t \t\t'adminteq',\r\n\t \t\t'pfranco',\r\n\t \t\t'kperez',\r\n\t \t];\r\n\t }", "function path_PMS() {\n global $nome_cartella;\n $path = $nome_cartella;\n if(!empty($path)) $path = $nome_cartella .\"/\";\n return \"http://\" . $_SERVER['SERVER_NAME'] . \"/\".$path;\n}", "public function addToHosts()\n {\n $folders = ['backup', 'extract', 'zetsoft', 'zoftapp'];\n $currentdir = getcwd();\n chdir('C:/Windows/System32/drivers/etc/');\n $file = 'hosts';\n $lines = file($file);\n chmod($file, 0777);\n\n $content = \"\\n127.0.0.1\\t\\t$this->newName.uz\";\n foreach ($lines as $index => $line) {\n if (strpos($line, \"$this->newName.uz\")) {\n unset($lines[$index]);\n }\n }\n $lines[] = $content;\n file_put_contents($file, $lines);\n\n if ($this->domain) {\n $content = \"\\n127.0.0.1\\t\\t$this->domain\";\n foreach ($lines as $index => $line) {\n if (strpos($line, \"$this->domain\")) {\n unset($lines[$index]);\n }\n }\n $lines[] = $content;\n file_put_contents($file, $lines);\n }\n\n foreach ($folders as $folder) {\n $folder = $folder === \"zoftapp\" ? \"zoft\" : $folder;\n $content = \"\\n127.0.0.1\\t\\t$this->newName.$folder.uz\";\n foreach ($lines as $index => $line) {\n if (strpos($line, \"$this->newName.$folder.uz\")) {\n unset($lines[$index]);\n }\n }\n $lines[] = $content;\n file_put_contents($file, $lines);\n }\n\n chdir(\"$currentdir\");\n }", "public function membres()\n {\n $this->membres = $this->Member->list($_SESSION['guild_id']);\n }", "public function publicacioAction()\n {\n $idGal = (int) $this->getRequest()->getParam(\"id\",0);\n \n //passo page per quedarnos a la pàgina d'on venim\n $page = (int) $this->getRequest()->getParam(\"page\",0);\n //valor de publicar o despublicar\n $valor = (int) $this->getRequest()->getParam(\"val\",0);\n \n $controller = $this->getRequest()->getparam(\"c\",0);\n \n \n $this->_galeriaDoctrineDao->privacitat($idGal,$valor);\n \n if($controller ==='index'){\n $this->_redirect('/admin/index');\n }else{\n $this->_redirect('/admin/galeria/listado/page/'.$page);\n }\n }", "function ListNodos(){\n\t\t$clase=$this->nmclass;\n\t\t$nodosnum=count($this->nodos[$clase]);\n\t\techo(\"Lista de Nodos: <br>\");\n\t\tforeach ($this->nodos[$clase] as $key=>$value) {\n\t\t echo(\"Clave: $key; Valor: $value<br />\\n\");\n\t\t}\n\t}", "public function metodo_publico() {\n }", "function AjoutHosts($HostServer,$dhcp,$TypeServer) { // Ajoute une machine dans le fichier hosts, retourne 0 si probleme\n\t$filehost = '/etc/backuppc/hosts';\n\t$fp = fopen($filehost,\"a+\");\n\tif (!HostExist($HostServer)) {\n\t\t$ligne = \"$HostServer \\t $dhcp \\t backuppc \\t # $TypeServer\\n\";\n\t\tfwrite($fp, $ligne);\n//\t\tif (fwrite($fp,$ligne)== FALSE) {\n//\t\t\treturn 0;\n//\t\t}\n\t}\n\tfclose($fp);\n}", "function setPrivileges() {\n $this->Session->write('Privilege.User.id', $this->Session->read('Auth.User.id'));\n foreach(Configure::read('Privilege') as $entity => $privileges) {\n foreach($privileges as $key => $privilege) {\n $key = \"Club.\".Configure::read('Club.id').\".Privilege.$entity.$key\";\n $this->Session->write($key, $this->isAuthorized($privilege));\n }\n }\n }", "public function seta_permissoes()\n\t{\n\t\tif(!$this->auth->esta_autenticado())\n\t\t{\n\t\t\tredirect(URL_PREFIX, 'location');\n\t\t}else{\n\t\t\t$n_cod_user = $this->input->post('n_cod_user');\n\t\t\t$local = $this->input->post('local');\n\t\t\t$sessao = $this->input->post('sessao');\n\t\t\t$acao = $this->input->post('acao');\n\n\t\t\t$matriz = array('n_cod_user' => $n_cod_user,\n\t\t\t\t\t\t\t'c_sessao' => $local,\n\t\t\t\t\t\t\t'c_subsessao' => $sessao,\n\t\t\t\t\t\t\t'c_acao' => $acao);\n\t\t\t$valida = $this->gph_crud->buscar(DB_PREFIX.'permissoes', 'sql', $matriz);\n\t\t\tif($valida->num_rows() > 0)\n\t\t\t{\n\t\t\t\t$this->gph_crud->excluir(DB_PREFIX.'permissoes', $matriz);\n\t\t\t\techo '<img src=\"'.base_url('sites/admin/_images/botoes/auto_off.jpg').'\" width=\"66\" height=\"28\" />';\n\t\t\t}else{\n\t\t\t\t$this->gph_crud->adiciona(DB_PREFIX.'permissoes', $matriz);\n\t\t\t\techo '<img src=\"'.base_url('sites/admin/_images/botoes/auto_on.jpg').'\" width=\"66\" height=\"28\" />';\n\t\t\t}\n\t\t}\n\t}", "public function relatorio4(){\n $this->isAdmin();\n }", "function cl_rhconsignadomovimentoservidorrubrica() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"rhconsignadomovimentoservidorrubrica\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "public function principal()\n\t {\n\t\t require_once('../../site_media/html/asignar_cursos/ac_Admin.php');\n\t }", "private function compilar_metadatos_generales_puntos_control()\n\t{\n\t\t$this->manejador_interface->mensaje('Puntos de control', false);\n\t\tforeach( toba_info_editores::get_puntos_control() as $punto_control ) {\n\t\t\t$nombre_clase = 'toba_mc_gene__pcontrol_' . $punto_control['pto_control'];\n\t\t\t$archivo = $this->get_dir_generales_compilados() . '/'. $nombre_clase .'.php';\n\t\t\t$clase = new toba_clase_datos( $nombre_clase );\n\t\t\t//Cabecera\n\t\t\t$datos['cabecera'] = $punto_control;\n\t\t\t$datos['parametros'] = toba_proyecto_db::punto_control_parametros( $this->get_id(), $punto_control['pto_control'] );\n\t\t\t$datos['controles'] = toba_proyecto_db::punto_control_controles( $this->get_id(), $punto_control['pto_control'] );\n\t\t\t//Guardo el archivo\n\t\t\t$clase->agregar_metodo_datos('get_info', $datos );\n\t\t\t$clase->guardar( $archivo );\n\t\t\t$this->manejador_interface->progreso_avanzar();\n\t\t}\n\t\t$this->manejador_interface->progreso_fin();\n\t}", "public function pagePrivileges()\r\n\t{\r\n\t\t// Donnees\r\n\t\t$eventId = Bn::getValue('event_id');\r\n\t\t$oEvent = new Oevent($eventId);\r\n\r\n\t\t// Controle de l'autorisation\r\n\t\tif ( $oEvent->getVal('ownerid') != Bn::getValue('user_id') && !Oaccount::isLoginAdmin() ) return false;\r\n\r\n\t\t// Preparer les champs de saisie\r\n\t\t$body = new Body();\r\n\r\n\t\t// Titres\r\n\t\t$t = $body->addP('', '', 'bn-title-2');\r\n\t\t$t->addBalise('span', '', LOC_ITEM_PRIVILEGE);\r\n\t\t$div = $body->addDiv();\r\n\t\t$body->addLgdRight($div);\r\n\t\t$div->addBreak();\r\n\r\n\t\t$grid = $body->addGridview('gridUsers', BPREF_FILL_PRIVILEGE, 25);\r\n\t\t$col = $grid->addColumn('#', '#', false);\r\n\t\t$col->setLook(25, 'left', false);\r\n\t\t$col = $grid->addColumn(LOC_COLUMN_LOGIN, 'login', true);\r\n\t\t$col->setLook(150, 'left', false);\r\n\t\t$col->initSort();\r\n\t\t$col = $grid->addColumn(LOC_COLUMN_NAME, 'name', true);\r\n\t\t$col->setLook(180, 'left', false);\r\n\t\t$col = $grid->addColumn(LOC_COLUMN_PSEUDO, 'pseudo', true);\r\n\t\t$col->setLook(150, 'left', false);\r\n\t\t$col = $grid->addColumn(LOC_COLUMN_ACTION, 'action', false);\r\n\t\t$col->setLook(60, 'center', false);\r\n\t\t$grid->setLook(LOC_TITLE_PRIVILEGE, 0, \"'auto'\");\r\n\r\n\t\t// Liste des utilisateurs avec privilege\r\n\t\t$d = $body->addDiv('', 'bn-div-btn');\r\n\t\t$btn = $d->addButton('btnPriv', LOC_BTN_ADD_PRIVILEGE, BPREF_PAGE_NEW_PRIVILEGE, '', 'targetDlg');\r\n\t\t$btn->completeAttribute('class', 'bn-dlg');\r\n\t\t$btn->addMetaData('title', '\"' . LOC_TITLE_NEW_PRIVILEGE . '\"');\r\n\t\t$btn->addMetaData('width', 350);\r\n\t\t$btn->addMetaData('height', 200);\r\n\r\n\t\t// Envoi au navigateur\r\n\t\t$body->display();\r\n\t\treturn false;\r\n\t}", "public function getCorporativos() {\n $this->consulta = \"SELECT usuario.idUsuario, usuario.idCorporativo, \n corporativo.razonSocial, usuario.login, \n usuario.fechaHoraUltIN, usuario.estado \n FROM usuario \n INNER JOIN corporativo ON usuario.idCorporativo = corporativo.idCorporativo \n WHERE usuario.tipoUsuario = 'Cliente Corporativo'\";\n if ($this->consultarBD() > 0) {\n $this->mensaje = 'Seccion Usuarios Corporativos <br> Registros Encontrados: <b>' . count($this->registros) . '</b>';\n return true;\n } else {\n return false;\n }\n }", "public function apymd()\n {\n session_start();\n\n if (!isset($_SESSION[\"Apoyo_admin\"])) {\n\n header(\"Location:\" . RUTA_URL . \"/inicio\");\n\n } else {\n\n $this->vista('apoyoAdministrador/menu');\n\n }\n\n }", "private function _impersonate($arg0 = '', $arg1 = '', $arg2 = ''){\n\t\t\n\t\tKint::dump($this->vc_user);\n\t\t\n\t\t$this->load->model('model_app_data', 'app_data', true);\n\t\t$data['managers'] = $this->app_data->retrieve_all_managers();\n\t\t$data['promoters'] = $this->app_data->retrieve_all_promoters();\n\t\t$data['hosts'] = $this->app_data->retrieve_all_hosts();\n\t\t\n\t\t\t\n\t\t$this->load->view($this->view_dir . 'impersonate/view_super_admin_impersonate', $data);\n\t\t\n\t}", "static function access(){\n return onapp_has_permission(array('hypervisors', 'hypervisors.read'));\n }", "function archobjet_autoriser() {\n}", "function pdp_user_control($pseudo){\n \t$re = new DbManager();\n \t$info = $re -> pdp_user($pseudo);\n \treturn $info ;\n }", "function conf__cuadro_pasadas()\r\n\t{\r\n\t\treturn array($this->pasadas_por_solapa);\r\n\t}", "public function verRedThinkClientEnProyectorCentral( ) {\n $this->setComando(self::$PROYECTOR_CENTRAL, \"THINK_CLIENT\");\n }", "function conf(){\n $this->s__perfil = toba::manejador_sesiones()->get_perfiles_funcionales();\n // print_r($this->s__perfil); \n \n $p = array_search('autoridad_mesa', $this->s__perfil);\n if($p !== false){//Es autoridad de mesa\n //Cargar datos del usuario especifico\n //obtengo el nombre de usuario logueado\n $usr = toba::manejador_sesiones()->get_id_usuario_instancia();\n \n $id_mesa = $this->dep('datos')->tabla('mesa')->get_de_usr($usr);\n if(sizeof($id_mesa)>0){\n $this->s__id_mesa = $id_mesa[0]['id_mesa'];\n $datos['id_mesa'] = $this->s__id_mesa;\n $this->dep('datos')->tabla('mesa')->cargar($datos);\n $this->s__mesa = $this->dep('datos')->tabla('mesa')->get();\n \n if($this->s__mesa['estado'] >= 2){//Ya fue validado por la secretaria\n $this->controlador()->evento('procesar')->ocultar();\n $this->controlador()->evento('enviar')->ocultar();\n }\n }\n else//No se encuentra mesa asociada al usuario logueado\n toba::notificacion()->agregar(\"No se encuentra el usuario ingresado\",\"info\");\n }\n else{\n $this->s__id_mesa = toba::memoria()->get_parametro('c');//el parametro c tiene el id mesa\n \n $this->s__retorno = toba::memoria()->get_parametro('k');//el parametro k tiene la dir de retorno\n $this->s__retorno_estado = toba::memoria()->get_parametro('f');\n \n \n $datos['id_mesa'] = $this->s__id_mesa;\n $this->dep('datos')->tabla('mesa')->cargar($datos);\n $this->s__mesa = $this->dep('datos')->tabla('mesa')->get();\n \t\n $p = array_search('junta_electoral', $this->s__perfil);\n if($p !== false){//Es junta electoral\n $this->controlador()->evento('procesar')->set_etiqueta('Confirmar');\n $this->controlador()->evento('enviar')->ocultar();\n\n if($this->s__mesa['estado'] > 3){//Ya fue validado por la secretaria\n// $this->dep('form_ml_directivo')->set_solo_lectura('votos');\n// $this->dep('form_ml_superior')->set_solo_lectura('votos');\n// $this->dep('form_ml_extra')->set_solo_lectura('votos');\n $this->controlador()->evento('procesar')->ocultar();\n $this->controlador()->evento('enviar')->ocultar();\n }\n }\n else{\n $p = array_search('secretaria', $this->s__perfil);//print_r(isset($p)?'no es false':'es false');\n if($p !== false){//Es secretaria\n $this->controlador()->evento('procesar')->set_etiqueta('Validar');\n $this->controlador()->evento('enviar')->ocultar();\n\n }\n \n }\n }\n \n if(isset($this->s__id_mesa)){//Si el pedido viene de la operacion Confirmar/Cargar// \n $this->s__claustro = $this->s__mesa['id_claustro'];\n $this->s__id_nro_ue = $this->dep('datos')->tabla('sede')->get_unidad($this->s__mesa['id_sede']);\n $this->s__id_sede = $this->s__mesa['id_sede'];\n }\n }", "public function acessarRelatorios(){\n\n }", "function authorizedAdminOnly(){\n global $authenticatedUser;\n if(!$authenticatedUser['admin']){\n header(\"HTTP/1.1 403 Forbidden\");\n header(\"Location: https://eso.vse.cz/~frim00/marvelous-movies/error-403\");\n exit();\n }\n }", "function opciones_admin(){\n\tif ($_SESSION[\"tipo_user\"] === \"admin\"){\n\t\t$href = [\"miembros\", \"biografia\", \"discografia\", \"conciertos\", \"usuarios\", \"backup\",\"restore\",\"borrarBD\", \"log\", \"logout\"];\n\t\t$name = [\"Editar miembros Grupo\", \"Editar biografía\", \"Editar discografía\", \"Editar conciertos\", \"Editar usuarios\", \"BackUp\",\"Restore\",\"Borrar BD\",\"Ver log del servidor\", \"Desconectarse\"];\n\t\techo '<div id=\"panel_control\" align=\"center\">';\n\t\t\techo '<div class=\"login\">';\n\t\t\t\techo \"<ul>\";\n\t\t\t\tforeach($href as $i => $val){\n\t\t\t\t\techo \"<li><a href='dashboard.php?accion=$val#panel_control'>{$name[$i]}</a></li>\";\n\t\t\t\t}\n\t\t\t\techo \"</ul>\";\n\t\t\techo \"</div>\";\n\t\techo \"</div>\";\n\t\t\n\t\tacciones();\n\t}\n}", "public function show_admin_warning_onedrive() {\n\t\t$this->get_method_auth_link('onedrive');\n\t}", "public function privacidad()\n {\n return view('web.privacidad');\n }", "function getAdminLinks()\n {\n }", "function index_superusuarios() {\n\t\t$conditions = array('Administrativo.perfil' => '0'); \n\t\t$order = array('Administrativo.nombre' => 'ASC');\n\t\t$administrativos=$this->Administrativo->find('all', array ('conditions' => $conditions, 'order' => $order));\t\t\n\t\t$perfil=$this->Perfil->find('all');\n\t\tforeach ($perfil as $p){\n\t\t\t$perfiles[$p['Perfil']['id']]=$p['Perfil']['perfil'];\n\t\t}\n\t\t$perfiles[0]='SuperAdministrador';\n\t\t$this->set('perfiles', $perfiles);\n\t\t$this->set('administrativos', $administrativos);\n\t}", "function createAdminsManagement($pseudo, $lastname, $firstname, $mail, $pass){\n $AdminManagement = new \\Project\\Models\\ManagementAdminManager();\n\n $pseudoModelAdmin = $AdminManagement->voirPseudoExistAdmin($pseudo);\n $emailModelAdmin = $AdminManagement->voirEmailExistAdmin($mail);\n $pseudoExistAdmin = $pseudoModelAdmin->fetch();\n $emailExistAdmin = $emailModelAdmin->fetch();\n\n if($pseudoExistAdmin){\n echo 'Ce pseudo existe déjà';\n } else if($emailExistAdmin){\n echo 'Cette adresse email existe déjà';\n } else{\n $createAdminManag = $AdminManagement->createManagementAdmins($pseudo, $lastname, $firstname, $mail, $pass);\n header(\"Location: administration.php?action=managementAdmin&id=\" . $_SESSION[\"id\"]);\n }\n }", "function virustotalscan_check_permissions($groups_comma)\r\n{\r\n global $mybb;\r\n // daca nu a fost trimis niciun grup ca si parametru\r\n if ($groups_comma == '') return false;\r\n // se verifica posibilitatea ca nu cumva sa fie mai multe grupuri trimise ca parametru\r\n $groups = explode(\",\", $groups_comma);\r\n // se creaza vectori cu acestee grupuri\r\n $add_groups = explode(\",\", $mybb->user['additionalgroups']);\r\n // se fac teste de apartenenta\r\n if (!in_array($mybb->user['usergroup'], $groups)) { \r\n // in grupul primar nu este\r\n // verificam mai departe daca este in cel aditional, secundar\r\n if ($add_groups) {\r\n if (count(array_intersect($add_groups, $groups)) == 0)\r\n return false;\r\n else\r\n return true;\r\n }\r\n else \r\n return false;\r\n }\r\n else\r\n return true;\r\n}", "function compilar_metadatos_generales_grupos_acceso($limpiar_existentes=false)\n\t{\n\t\ttoba_proyecto_db::set_db( $this->db );\n\t\tif ($limpiar_existentes) {\n\t\t\t$archivos = toba_manejador_archivos::get_archivos_directorio($this->get_dir_generales_compilados(), '/toba_mc_gene__grupo/');\n\t\t\tforeach($archivos as $archivo) {\n\t\t\t\tunlink($archivo);\n\t\t\t}\n\t\t}\n\t\t$this->manejador_interface->mensaje('Perfiles funcionales', false);\n\t\tforeach( $this->get_indice_grupos_acceso() as $grupo_acceso ) {\n\t\t\t$nombre_clase = 'toba_mc_gene__grupo_' . $grupo_acceso;\n\t\t\t$archivo = $this->get_dir_generales_compilados() . '/' . $nombre_clase . '.php';\n\t\t\t$clase = new toba_clase_datos( $nombre_clase );\n\t\t\t//-- Menu -------------------------------\n\t\t\t$datos = toba_proyecto_db::get_items_menu( $this->get_id(), array($grupo_acceso) );\n\t\t\t$temp = array();\n\t\t\tforeach($datos as $dato) {\n\t\t\t\t$temp[$dato['proyecto'].'-'.$dato['item']] = $dato;\n\t\t\t}\n\t\t\t$clase->agregar_metodo_datos('get_items_menu', $temp );\n\t\t\t//-- Control acceso ---------------------\n\t\t\t$datos = toba_proyecto_db::get_items_accesibles( $this->get_id(), array($grupo_acceso) );\n\t\t\t$temp = array();\n\t\t\tforeach($datos as $dato) {\n\t\t\t\t$temp[$dato['proyecto'].'-'.$dato['item']] = $dato;\n\t\t\t}\n\t\t\t$clase->agregar_metodo_datos('get_items_accesibles', $temp );\n\t\t\t//-- Permisos ---------------------------\n\t\t\t$datos = toba_proyecto_db::get_lista_permisos( $this->get_id(), array($grupo_acceso) );\n\t\t\t$temp = array();\n\t\t\tforeach($datos as $dato) {\n\t\t\t\t$temp[$dato['nombre'].'-'] = $dato;//Se concatena un string porque asi el merge unifica si o si aunque el nombre sea un numero\n\t\t\t}\n\t\t\t$clase->agregar_metodo_datos('get_lista_permisos', $temp );\n\t\t\t//-- Acceso items zonas -----------------\n\t\t\tforeach( $this->get_indice_zonas() as $zona ) {\n\t\t\t\t$datos = toba_proyecto_db::get_items_zona( $this->get_id(), array($grupo_acceso), $zona );\n\t\t\t\t$temp = array();\n\t\t\t\tforeach($datos as $dato) {\n\t\t\t\t\t$temp[$dato['item_proyecto'].'-'.$dato['item']] = $dato;\n\t\t\t\t}\n\t\t\t\t$clase->agregar_metodo_datos('get_items_zona__'.$zona, $temp );\n\t\t\t}\n\t\t\t//-- Membresía -------------------\n\t\t\t$miembros = toba_proyecto_db::get_perfiles_funcionales_asociados($this->get_id(), $grupo_acceso);\n\t\t\t$clase->agregar_metodo_datos('get_membresia', $miembros);\n\n\t\t\t//Guardo el archivo\n\t\t\t$clase->guardar( $archivo );\n\t\t\t$this->manejador_interface->progreso_avanzar();\n\t\t}\n\n\t\t//-- Agrego los items publicos en un archivo aparte, para que el usuario no autentificado pueda navegarlos\n\t\t$nombre_clase = 'toba_mc_gene__items_publicos';\n\t\t$archivo = $this->get_dir_generales_compilados() . '/' . $nombre_clase . '.php';\n\t\t$clase = new toba_clase_datos( $nombre_clase );\n\t\t$datos = toba_proyecto_db::get_items_accesibles($this->get_id(), array());\n\t\t$temp = array();\n\t\tforeach($datos as $dato) {\n\t\t\t$temp[$dato['proyecto'].'-'.$dato['item']] = $dato;\n\t\t}\n\t\t$clase->agregar_metodo_datos('get_items_accesibles', $temp );\n\t\t$clase->guardar( $archivo );\n\t\t$this->manejador_interface->progreso_avanzar();\n\n\t\t$this->manejador_interface->progreso_fin();\n\t}", "function cmp_privkeys($a, $b) {\n\t$auser = strncmp(\"user-\", $a, 5);\n\t$buser = strncmp(\"user-\", $b, 5);\n\tif ($auser != $buser) {\n\t\treturn $auser - $buser;\n\t}\n\n\t/* name compare others */\n\treturn strcasecmp($a, $b);\n}", "public function isAdministrador(){ return false; }", "public function testPrivs()\n {\n return true;\n }", "function _hosts()\n{\n $c = \"# Generated with beatnik on \" . date('Y-m-d h:i:s') . \" by \" . $GLOBALS['username'] . \"\\n\\n\";\n foreach ($GLOBALS['domains'] as $domain) {\n\n $zonename = $domain['zonename'];\n $tld = substr($zonename, strrpos($zonename, '.')+1);\n $domain = substr($zonename, 0, strrpos($zonename, '.'));\n\n foreach ($zonedata['cname'] as $id => $values) {\n extract($values);\n if (!empty($hostname)) {\n $hostname .= '.';\n }\n $c .= \"$pointer $hostname.$domain.$tld\\n\";\n }\n }\n\n return $c;\n}", "public function ListarUsuarios()\n{\n\tself::SetNames();\n\t$sql = \" select * from usuarios \";\n\tforeach ($this->dbh->query($sql) as $row)\n\t{\n\t\t$this->p[] = $row;\n\t}\n\treturn $this->p;\n\t$this->dbh=null;\n}", "function amap_ma_not_permit_public_access() {\n \n return false;\n}", "function vm_used_by_myOrg(){\n $reply = array('nordita');\n return $reply;\n}", "function userAdmin(){\r\n if(userConnect() && $_SESSION['user']['privilege']==1) return TRUE; else return FALSE;\r\n }", "public function verAtrilEnProyectorCentral( ) {\n $this->setComando(self::$PROYECTOR_CENTRAL, \"ATRIL\");\n }", "function ListarPermiso()\n\t{\n\t\t$sql = \"SELECT * FROM permiso\";\n\t\treturn EjecutarConsulta($sql);\n\t}", "public function enviarContactos(){\n $this->enviarPeticion(\"VIDEOCONFERENCIA:CONTACTOS:LISTA:DIOCE=0,LOOPBACK\n1=0,LOOPBACK 2=0,MIGUEL ALTUNA=1,POLYCOM AUSTIN STEREO=0,POLYCOM AUSTIN\nSTEREO=0,POLYCOM AUSTIN USA=0,POLYCOM AUSTIN USA IP=0,POLYCOM\nAUSTRALIA=0,POLYCOM BRAZIL=0,POLYCOM EUROPE=0,POLYCOM HONG\nKONG=0,POLYCOM JAPAN=0,POLYCOM JAPAN=0,POLYCOM MEXICO=0,POLYCOM MILPITAS\nLOBBY=0,POLYCOM PERU=0,POLYCOM SOUTHERN EUROPE=0,TELESONIC=0\");\n }", "function t_registros_publicaciones_ppam_publicador_init(&$options, $memberInfo, &$args)\r\n\t{\r\n\t\t$options->DefaultSortField = '`t_registros_publicaciones_ppam_publicador`.`FechaRegistro` desc, `t_registros_publicaciones_ppam_publicador`.`IdPPAM` asc, `t_registros_publicaciones_ppam_publicador`.`IdTurno` desc, `t_registros_publicaciones_ppam_publicador`.`IdVoluntario` asc';\r\n\r\n\t\t$DisplayRecords = $_REQUEST['DisplayRecords'];\r\n\t\tif(!in_array($DisplayRecords, array('user', 'group')))\r\n\t\t{ \r\n\t\t\t$DisplayRecords = 'all'; \r\n\t\t}\r\n\r\n\t\t$perm=getTablePermissions('t_registros_publicaciones_ppam_publicador');\r\n\t\t\r\n\r\n\t\t$Filtro = !$_REQUEST['NoFilter_x'];\r\n\r\n//echo '<BR><BR><BR><BR>'.$perm[2].'<BR>'.$DisplayRecords.'<BR>'.$Filtro.'<BR>InfoUsuario[0]:'.$memberInfo['custom'][0].'<BR>InfoUsuario[1]:'.$memberInfo['custom'][1];\r\n\t\t\r\n\t\tif($perm[2]==1 || ($perm[2]>1 && $DisplayRecords=='user' && $Filtro))\r\n\t\t{ // view owner only\r\n\t\t\t$options->QueryFrom.=', membership_userrecords';\r\n\t\t\t$options->QueryWhere=\"where `t_registros_publicaciones_ppam_publicador`.`IdRegistro`=membership_userrecords.pkValue and membership_userrecords.tableName='t_registros_publicaciones_ppam_publicador' and lcase(membership_userrecords.memberID)='\".getLoggedMemberID().\"'\";\r\n\t\t}\r\n\t\telseif($perm[2]==2 || ($perm[2]>2 && $DisplayRecords=='group' && $Filtro))\r\n\t\t{ // view group only\r\n\t\t\t$options->QueryWhere=\"where `t_registros_publicaciones_ppam_publicador`.`IdPPAM` = '\".$memberInfo['custom'][0].\"' \";\r\n\t\t}\r\n\t\telseif($perm[2]==3)\r\n\t\t{ // view all\r\n\t\t\tif ($memberInfo['custom'][1] != 99)\r\n\t\t\t{\r\n\t\t\t\t$options->QueryFrom.=', t_ubicaciones_ppam ';\r\n\t\t\t\t$options->QueryWhere=\" where `t_ubicaciones_ppam`.`IdCiudadPPAM` = '\".$memberInfo['custom'][1].\"' and `t_registros_publicaciones_ppam_publicador`.`IdPPAM` = `t_ubicaciones_ppam`.`IdPPAM`\";\r\n\t\t\t}\r\n\t\t}\r\n\t\telseif($perm[2]==0){ // view none\r\n\t\t\t$options->QueryFields = array(\"Not enough permissions\" => \"NEP\");\r\n\t\t\t$options->QueryFrom = '`t_registros_publicaciones_ppam_publicador`';\r\n\t\t\t$options->QueryWhere = '';\r\n\t\t\t$options->DefaultSortField = '';\r\n\t\t}\r\n\r\n//echo '<BR><BR><BR><BR>'.$options->QueryWhere;\r\n\r\n\t\treturn TRUE;\r\n\t}", "function setCli_senha($cli_senha) {\n //O md5 vai criptografar a senha\n //$this->cli_senha = md5($cli_senha); \n //$this->cli_senha = hash('SHA512', $cli_senha);// SHA512 e uma senha com 128 digitos\n $this->cli_senha = Sistema::Criptografia($cli_senha);\n \n \n }", "function coppa_perms_form()\n\t{\n\t\t/* Keith said to strip these out - it's all his fault :( */\n\t\t$this->ipsclass->vars['coppa_address'] = str_replace( '<br />', '', $this->ipsclass->vars['coppa_address'] );\n\t\t$this->ipsclass->vars['coppa_address'] = str_replace( '<br>', '', $this->ipsclass->vars['coppa_address'] );\n\n\t\t$this->ipsclass->vars['coppa_address'] = nl2br($this->ipsclass->vars['coppa_address']);\n\n\t\techo($this->ipsclass->compiled_templates['skin_register']->coppa_form());\n\t\texit();\n\t}", "function mailListe() {\n\t\tinclude 'Net/SSH2.php';\n\n\t\t$ssh = new Net_SSH2('10.2.100.100');\n\t\tif (!$ssh->login('root', 'indianflute')) {\n\t\t\t$result = 'Login Failed';\n\t\t}\n\n\t\t$result=$ssh->exec(\"cat /var/www/html/annuaire/contact.dat\");\n\n\t\t$tab = explode(\"\\n\",utf8_encode($result));\n\n\t\t$chps = explode(\"\\t\",utf8_encode($tab[0]));\n\n\n\t\tfor ($i=0;$i<count($tab)-1;$i++) {\n\t\t\t$res[$i]= explode(\"\\t\",$tab[$i]);\n\t\t}\n\n\n\n\t\treturn $res;\n\t}", "protected function handleOwner()\n {\n if ( !ezcBaseFeatures::hasFunction( 'posix_getpwuid' ) )\n {\n return;\n }\n\n $t =& $this->properties;\n\n if ( posix_geteuid() === 0 && isset( $t['userName'] ) && $t['userName'] !== '' )\n {\n if ( ( $userName = posix_getpwnam( $t['userName'] ) ) !== false )\n {\n $t['userId'] = $userName['uid'];\n }\n if ( ( $groupName = posix_getgrnam( $t['groupName'] ) ) !== false )\n {\n $t['groupId'] = $groupName['gid'];\n }\n }\n }", "function abmUsuarios()\n {\n $this->checkCredentials();\n $users = $this->modelUser->getAllUsers();\n $this->view->showAbmUsuarios($users);\n }", "function anuncios_admin() {\n\t\tinclude('anuncios_admin.php');\n\t}", "public function connexionSuperAdminLogin(){\n }", "function showPermisosWithSistema()\r\n\t{\r\n\t\t$valuesPermisos = $this->Permiso->find('all');\r\n\t\t\r\n\t\tforeach ($valuesPermisos as $value)\r\n\t\t{\r\n\t\t\t$resultadoPermisos[$value['Permiso']['id']]= \"Permiso: \".$value['Permiso']['tipo_permiso'].\". Sistema: \".$value['Sistema']['nombre_sistema'] ;\r\n\t\t}\r\n\t\t\t\r\n\t\treturn $resultadoPermisos;\r\n\t}", "public function public_path();", "public function principal()\n\t {\n\t\t require_once('../../site_media/html/cursos/cu_Admin.php');\n\t }", "public static function modulePrivileges(&$simbio) {\n return array(\n 'add master data',\n 'remove master data'\n );\n }", "function cilien_autoriser(){}", "function ayudawp_ocultar_direccion( $items ) {\n\tunset($items['orders']);\n\tunset($items['members-area']);\n\tunset($items['downloads']);\n\tunset($items['payment-methods']);\n\tunset($items['edit-address']);\n\tunset($items['customer-logout']);\t\nreturn $items;\n}", "private function unix_account_instructions() {\n if (function_exists('posix_getuid') and function_exists('posix_getpwuid') and $unix_user = posix_getpwuid(posix_getuid()) and isset($unix_user['name']))\n return \" for the UNIX user account <strong>{$unix_user['name']}</strong>.\";\n\n return \".\";\n }", "function organismes()\n\t{\n\t\tglobal $gCms;\n\t\t$ping = cms_utils::get_module('Ping'); \n\t\t$db = cmsms()->GetDb();\n\t\t$designation = '';\n\t\t$tableau = array('F','Z','L','D');\n\t\t//on instancie la classe servicen\n\t\t$service = new Servicen();\n\t\t$page = \"xml_organisme\";\n\t\tforeach($tableau as $valeur)\n\t\t{\n\t\t\t$var = \"type=\".$valeur;\n\t\t\t//echo $var;\n\t\t\t$scope = $valeur;\n\t\t\t//echo \"la valeur est : \".$valeur;\n\t\t\t$lien = $service->GetLink($page,$var);\n\t\t\t//echo $lien;\n\t\t\t$xml = simplexml_load_string($lien, 'SimpleXMLElement', LIBXML_NOCDATA);\n\t\t\t\n\t\t\tif($xml === FALSE)\n\t\t\t{\n\t\t\t\t$designation.= \"service coupé\";\n\t\t\t\t$now = trim($db->DBTimeStamp(time()), \"'\");\n\t\t\t\t$status = 'Echec';\n\t\t\t\t$action = 'retrieve_ops';\n\t\t\t\tping_admin_ops::ecrirejournal($now,$status,$designation,$action);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$array = json_decode(json_encode((array)$xml), TRUE);\n\t\t\t\t///on initialise un compteur général $i\n\t\t\t\t$i=0;\n\t\t\t\t//on initialise un deuxième compteur\n\t\t\t\t$compteur=0;\n\t\t\t//\tvar_dump($xml);\n\n\t\t\t\t\tforeach($xml as $cle =>$tab)\n\t\t\t\t\t{\n\n\t\t\t\t\t\t$i++;\n\t\t\t\t\t\t$idorga = (isset($tab->id)?\"$tab->id\":\"\");\n\t\t\t\t\t\t$code = (isset($tab->code)?\"$tab->code\":\"\");\n\t\t\t\t\t\t$libelle = (isset($tab->libelle)?\"$tab->libelle\":\"\");\n\t\t\t\t\t\t// 1- on vérifie si cette épreuve est déjà dans la base\n\t\t\t\t\t\t$query = \"SELECT idorga FROM \".cms_db_prefix().\"module_ping_organismes WHERE idorga = ?\";\n\t\t\t\t\t\t$dbresult = $db->Execute($query, array($idorga));\n\n\t\t\t\t\t\t\tif($dbresult && $dbresult->RecordCount() == 0) \n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$query = \"INSERT INTO \".cms_db_prefix().\"module_ping_organismes (libelle, idorga, code, scope) VALUES (?, ?, ?, ?)\";\n\t\t\t\t\t\t\t\t//echo $query;\n\t\t\t\t\t\t\t\t$compteur++;\n\t\t\t\t\t\t\t\t$dbresultat = $db->Execute($query,array($libelle,$idorga,$code,$scope));\n\n\t\t\t\t\t\t\t\tif(!$dbresultat)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$designation.= $db->ErrorMsg();\t\t\t\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\n\n\t\t\t\t\t}// fin du foreach\n\n\t\t\t}\n\t\t\tunset($scope);\n\t\t\tunset($var);\n\t\t\tunset($lien);\n\t\t\tunset($xml);\n\t\t\tsleep(1);\n\t\t}//fin du premier foreach\n\t\t\n\n\t\t$designation.= $compteur.\" organisme(s) récupéré(s)\";\n\t\t$now = trim($db->DBTimeStamp(time()), \"'\");\n\t\t$status = 'Ok';\n\t\t$action = 'retrieve_ops';\n\t\tping_admin_ops::ecrirejournal($now,$status,$designation,$action);\n\n\t\t\t\n\t\t\n\t}", "function new_privileges($new_priv_name) {\r\n $conn = db_connect();\r\n $result = $conn->query(\"set names utf8\");\r\n $result = $conn->query(\"insert into privileges value ('', '\".trim($new_priv_name).\"')\");\r\n if (!$result) {\r\n throw new Exception(\"Could not connect to the DB.\");\r\n }\r\n return true;\r\n }", "function permsplash()\n\t{\n\t\t//-----------------------------------------\n\t\t// INIT\n\t\t//-----------------------------------------\n\n\t\t$perms = array();\n\t\t$mems = array();\n\t\t$groups = array();\n\t\t$dlist = \"\";\n\t\t$content = \"\";\n\n\t\t//-----------------------------------------\n\t\t// Page title & desc\n\t\t//-----------------------------------------\n\n\t\t$this->ipsclass->admin->page_title = \"Управление группами\";\n\t\t$this->ipsclass->admin->page_detail = \"Здесь вы сможете отредактировать параметры доступа для каждой группы.\";\n\t\t$this->ipsclass->admin->nav[] = array( $this->ipsclass->form_code.'&code=permsplash', 'Управление группами' );\n\n\t\t//-----------------------------------------\n\t\t// Get the names for the perm masks w/id\n\t\t//-----------------------------------------\n\n\t\t$this->ipsclass->DB->simple_construct( array( 'select' => '*', 'from' => 'forum_perms', 'order' => 'perm_name ASC' ) );\n\t\t$this->ipsclass->DB->simple_exec();\n\n\t\twhile( $r = $this->ipsclass->DB->fetch_row() )\n\t\t{\n\t\t\t$perms[ $r['perm_id'] ] = $r['perm_name'];\n\t\t}\n\n\t\t//-----------------------------------------\n\t\t// Get the number of members using this mask\n\t\t// as an over ride\n\t\t//-----------------------------------------\n\n\t\t$this->ipsclass->DB->cache_add_query( 'groups_permsplash', array() );\n\t\t$this->ipsclass->DB->cache_exec_query();\n\n\t\twhile( $r = $this->ipsclass->DB->fetch_row() )\n\t\t{\n\t\t\tif ( strstr( $r['org_perm_id'] , \",\" ) )\n\t\t\t{\n\t\t\t\tforeach( explode( \",\", $r['org_perm_id'] ) as $pid )\n\t\t\t\t{\n\t\t\t\t\t$mems[ $pid ] = !isset($mems[ $pid ]) ? 0 : $mems[ $pid ];\n\t\t\t\t\t$mems[ $pid ] += $r['count'];\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$mems[ $r['org_perm_id'] ] += $r['count'];\n\t\t\t}\n\t\t}\n\n\t\t//-----------------------------------------\n\t\t// Get the member group names and the mask\n\t\t// they use\n\t\t//-----------------------------------------\n\n\t\t$this->ipsclass->DB->simple_construct( array( 'select' => 'g_id, g_title, g_perm_id', 'from' => 'groups' ) );\n\t\t$this->ipsclass->DB->simple_exec();\n\n\t\twhile( $r = $this->ipsclass->DB->fetch_row() )\n\t\t{\n\t\t\tif ( strstr( $r['g_perm_id'] , \",\" ) )\n\t\t\t{\n\t\t\t\tforeach( explode( \",\", $r['g_perm_id'] ) as $pid )\n\t\t\t\t{\n\t\t\t\t\t$groups[ $pid ][] = $r['g_title'];\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$groups[ $r['g_perm_id'] ][] = $r['g_title'];\n\t\t\t}\n\t\t}\n\n\t\t//-----------------------------------------\n\t\t// Print the splash screen\n\t\t//-----------------------------------------\n\n\t\tforeach( $perms as $id => $name )\n\t\t{\n\t\t\t$groups_used = \"\";\n\t\t\t$mems_used = 0;\n\t\t\t$is_active = 0;\n\t\t\t$dlist .= \"<option value='$id'>$name</option>\\n\";\n\n\t\t\tif ( isset($groups[ $id ]) AND is_array( $groups[ $id ] ) )\n\t\t\t{\n\t\t\t\tforeach( $groups[ $id ] as $g_title )\n\t\t\t\t{\n\t\t\t\t\t$groups_used .= '&middot; ' . $g_title . \"<br />\";\n\t\t\t\t}\n\n\t\t\t\t$is_active = 1;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$groups_used = \"<center>Нет</center>\";\n\t\t\t}\n\n\t\t\tif ( isset($mems[ $id ]) AND $mems[ $id ] > 0 )\n\t\t\t{\n\t\t\t\t$is_active = 1;\n\t\t\t}\n\n\t\t\t$r['id'] = $id;\n\t\t\t$r['name'] = $name;\n\t\t\t$r['isactive'] = $is_active;\n\t\t\t$r['groups'] = $groups_used;\n\t\t\t$r['mems'] = isset($mems[ $id ]) ? intval( $mems[ $id ] ) : 0;\n\n\t\t\t$content .= $this->html->groups_perm_splash_row( $r );\n\t\t}\n\n\t\t$this->ipsclass->html .= $this->html->groups_perm_splash_wrapper( $content, $dlist );\n\n\t\t$this->ipsclass->admin->output();\n\t}", "function modif_root($IDVPS, $connection, $passroot){\n\t\n\t//Commande � ex�cuter\n\t$command='vzctl set '.$IDVPS.' --userpasswd root:'.$passroot;\n\t\t\n\t//On lance la commande d'install\n $stream = ssh2_exec($connection, $command);\n stream_set_blocking($stream, true);\n\t\n\t//R�cup�re le r�sultat\n\t$rep=\"\";\n\twhile($line = fgets($stream)){\n\t\t$rep.=$line;\t\n\t}\n\t//Ferme la connection\n\tfclose($stream);\n\n\tif($stream!=false){\n\t\treturn true;\n\t}else{\n\t\t\n\t$ok=stripos($rep,\"ok\");\n\t$time=time();\n\t$message = mysql_real_escape_string('Le '.date('d/m/y - H:i:s').' le VPS '.$hostname.' ('.$IDVPS.') est passer en erreur lors du chnagement de passwors root\n\t\tVoici le message : '.$rep.'\n\n\t\tCommande : \n\t\t'.$command_stop.'');\n\t$IDVPS = mysql_real_escape_string($IDVPS);\n\t$time = mysql_real_escape_string($time);\n\tmysql_query(\"INSERT INTO `warning` ( `id` , `id_client` , `ip` , `message` , `page` , `time` , `type`, `TYPE_W`)\nVALUES (\nNULL , '\".$IDVPS.\"', 'IP', '\".$message.\"', '', '\".$time.\"', 'W_ERREUR_UPDATE_PASSWORD_VPS', 'VPS'\n)\");\n\t\treturn false;\n\t}\n\t\n}", "function _ObtenerSecciones()\n\t{\n\t\tinclude_once('../Entidades/Secciones.php');\n\t\t$OBJUsuarios = new Secciones;\n\t\t$secciones=$OBJUsuarios -> ObtenerSeccionesparaCategorias();\n\n\n\t\tif ($secciones>=0) {\n\t\t\t\n\t\t\t$privilegios = $_SESSION['privilegios'];\n\t\t\t\n\t\t\tinclude_once('../ModuloAdministrador/vistas/FormularioCategorias.php');\n\t\t\t$OBJUsuarios = new FormularioCategorias;\n\t\t\t$OBJUsuarios -> MostrarFormularioCategorias($secciones,$privilegios);\n\n\t\t}\n\n\t\telse{\n\n\t\t\t\t $mensaje=\"llame al administrador o contacte a direcciones@mmmperu.org\";\n\t\t\t\t include('../includes/FormularioMensaje.php');\n\t\t\t\t $objmen = new FormularioMensaje;\n \t $objmen->MostrarMensajeLogin($mensaje);\n\n\t\t}\n\t}", "private function busquedaUsuarios($filter = array()) {\n $usuarios = new \\Modelos\\userPosix($this->dn, $this->pswd, 'central' );\n $atributos = array('uid','cn','title','o', 'ou','mail', 'telephoneNumber');\n $filtro = empty($filter) ? array(\"cn\"=>\"NOT (root OR nobody)\") : array_merge($filter, array(\"cn\"=>\"NOT (root OR nobody)\"));\n $datos = $usuarios->search($filtro, $atributos, \"dc=sv\");\n $this->parametros['errorLdap'] = $usuarios->getErrorLdap();\n return $datos; \n }", "public function __tostring(){\n\t\treturn $this->_base.\" - \".$this->_password.\" - \".$this->_server.\" - \".$this->_usuario;\n\t}", "function create_account($uname, $pwd) {\n $account_info = \"{$uname}:{$pwd}\\n\";\n add_item_to_file(\"users.txt\", $account_info);\n }", "public function index()\n {\n // Role::create(['name'=>'acao']);\n // Permission::create(['name'=>'opcoes']);\n \n $email=Auth::user()->email;\n\n list($nome,$descricao)=explode(\"@\",$email);\n list($mini,$co)=explode(\".\",$descricao);\n \n\n // auth()->user()->givePermissionTo('publicar');\n\n \n if(Auth::check()){\n if($mini==\"admin\"){\n \n return view('admin');\n \n }else{\n $Requerente=DB::table('requerentes')->where('Ministerio','=',$mini)->get(); \n \n auth()->user()->givePermissionTo('opcoes');\n \n\n\n return view('ministerio',['ministerio'=>$Requerente]);\n\n }\n }\n \n \t\n\n }", "function perfil (){\n \t $dato=$_SESSION['Usuarios'];\n\t\t $datos = Usuario::mostrar($dato);\n \t require \"app/Views/Perfil.php\";\n }", "static function crear( toba_modelo_instancia $instancia, $nombre, $usuarios_a_vincular , $dir_inst_proyecto=null)\n\t{\n\t\t//- 1 - Controles\n\t\t$dir_template = toba_dir() . self::template_proyecto;\n\t\tif ( $nombre == 'toba' ) {\n\t\t\tthrow new toba_error(\"INSTALACIÓN: No es posible crear un proyecto con el nombre 'toba'\");\n\t\t}\n\t\tif ( self::existe( $nombre ) ) {\n\t\t\ttoba_logger::instancia()->error(\"INSTALACIÓN: Ya existe una carpeta con el nombre '$nombre' en la carpeta 'proyectos'\");\n\t\t\tthrow new toba_error(\"INSTALACIÓN: Ya existe una carpeta con el nombre especificado en la carpeta 'proyectos'\");\n\t\t}\n\t\ttry {\n\n\t\t\t//- 2 - Modificaciones en el sistema de archivos\n\t\t\t$dir_proyecto = (is_null($dir_inst_proyecto)) ? $instancia->get_path_proyecto($nombre): $dir_inst_proyecto;\n\t\t\t$url_proyecto = $instancia->get_url_proyecto($nombre);\n\n\t\t\t// Creo la CARPETA del PROYECTO\n\t\t\t$excepciones = array();\n\t\t\t$excepciones[] = $dir_template.'/www/aplicacion.produccion.php';\n\t\t\ttoba_manejador_archivos::copiar_directorio( $dir_template, $dir_proyecto, $excepciones);\n\n\t\t\t// Modifico los archivos\n\t\t\t$editor = new toba_editor_archivos();\n\t\t\t$editor->agregar_sustitucion( '|__proyecto__|', $nombre );\n\t\t\t$editor->agregar_sustitucion( '|__instancia__|', $instancia->get_id() );\n\t\t\t$editor->agregar_sustitucion( '|__toba_dir__|', toba_manejador_archivos::path_a_unix( toba_dir() ) );\n\t\t\t$editor->agregar_sustitucion( '|__version__|', '1.0.0');\n\t\t\t$editor->procesar_archivo( $dir_proyecto . '/www/aplicacion.php' );\n\n\t\t\t$modelo = $dir_proyecto . '/php/extension_toba/modelo.php';\n\t\t\t$comando = $dir_proyecto . '/php/extension_toba/comando.php';\n\t\t\t$editor->procesar_archivo($comando);\n\t\t\t$editor->procesar_archivo($modelo);\n\t\t\t$editor->procesar_archivo($dir_proyecto.'/www/rest.php');\n\t\t\t$editor->procesar_archivo($dir_proyecto.'/www/servicios.php');\n\n\t\t\trename($modelo, str_replace('modelo.php', $nombre.'_modelo.php', $modelo));\n\t\t\trename($comando, str_replace('comando.php', $nombre.'_comando.php', $comando));\n\t\t\t$ini = $dir_proyecto.'/proyecto.ini';\n\t\t\t$editor->procesar_archivo($ini);\n\n\t\t\t// Asocio el proyecto a la instancia\n\t\t\t$instancia->vincular_proyecto( $nombre, $dir_inst_proyecto, $url_proyecto);\n\n\t\t\t//- 3 - Modificaciones en la BASE de datos\n\t\t\t$db = $instancia->get_db();\n\t\t\ttry {\n\t\t\t\t$db->abrir_transaccion();\n\t\t\t\t$db->retrasar_constraints();\n\t\t\t\t$db->ejecutar( self::get_sql_metadatos_basicos( $nombre ) );\n\t\t\t\t$sql_version = self::get_sql_actualizar_version( toba_modelo_instalacion::get_version_actual(),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$nombre);\n\t\t\t\t$db->ejecutar($sql_version);\n\t\t\t\tforeach( $usuarios_a_vincular as $usuario ) {\n\t\t\t\t\tself::do_vincular_usuario($db, $nombre, $usuario, array('admin'));\n\t\t\t\t}\n\t\t\t\t$db->cerrar_transaccion();\n\t\t\t} catch ( toba_error $e ) {\n\t\t\t\t$db->abortar_transaccion();\n\t\t\t\t$txt = 'PROYECTO : Ha ocurrido un error durante la carga de METADATOS del PROYECTO. DETALLE: ';\n\t\t\t\ttoba_logger::instancia()->error($txt . $e->getMessage());\n\t\t\t\tthrow new toba_error( $txt );\n\t\t\t}\n\t\t} catch ( toba_error $e ) {\n\t\t\t// Borro la carpeta creada\n\t\t\tif ( is_dir( $dir_proyecto ) ) {\n\t\t\t\t$instancia->desvincular_proyecto( $nombre );\n\t\t\t\ttoba_manejador_archivos::eliminar_directorio( $dir_proyecto );\n\t\t\t}\n\t\t\tthrow $e;\n\t\t}\n\t}" ]
[ "0.61847675", "0.5536852", "0.55128217", "0.5278969", "0.52379304", "0.5235276", "0.52198637", "0.52068925", "0.5206127", "0.5198886", "0.51877207", "0.51783645", "0.5154043", "0.5140766", "0.51404315", "0.5136752", "0.5130629", "0.50786835", "0.50760984", "0.50611687", "0.5041415", "0.5037647", "0.50341153", "0.5029138", "0.50166625", "0.49808773", "0.49738786", "0.4968844", "0.4963538", "0.49576256", "0.49496034", "0.49415082", "0.49309635", "0.49273944", "0.49175945", "0.49150327", "0.4899425", "0.489535", "0.4895274", "0.48913518", "0.4881294", "0.48734298", "0.4872069", "0.4871881", "0.48718667", "0.48708063", "0.4870632", "0.48627472", "0.4856651", "0.48441938", "0.48441577", "0.48425537", "0.48418963", "0.48302758", "0.4822732", "0.48090225", "0.4804704", "0.478313", "0.47823495", "0.47805303", "0.47747833", "0.4773801", "0.476931", "0.47670326", "0.47636583", "0.4761634", "0.47544637", "0.47527748", "0.47519654", "0.47518492", "0.47515845", "0.47378817", "0.4731386", "0.47269416", "0.4726626", "0.4724377", "0.47228125", "0.47215918", "0.47195345", "0.47175002", "0.4714427", "0.4714241", "0.47095427", "0.47040078", "0.47039655", "0.47035098", "0.4699353", "0.46894056", "0.46886957", "0.4680347", "0.46790013", "0.46673983", "0.46653157", "0.46652228", "0.4662472", "0.46558508", "0.4650919", "0.46499485", "0.46494386", "0.4647513", "0.4646382" ]
0.0
-1
Display a listing of the resource.
public function index() { // $thematicsList=ThematicSG::all(); return view('SG/Thematic/index', ['thematicsList'=>$thematicsList]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function indexAction()\n {\n $limit = $this->Request()->getParam('limit', 1000);\n $offset = $this->Request()->getParam('start', 0);\n $sort = $this->Request()->getParam('sort', array());\n $filter = $this->Request()->getParam('filter', array());\n\n $result = $this->resource->getList($offset, $limit, $filter, $sort);\n\n $this->View()->assign($result);\n $this->View()->assign('success', true);\n }", "public function listing();", "function index() {\n\t\t$this->show_list();\n\t}", "public function actionList() {\n $this->_getList();\n }", "public function listAction()\n {\n $model = $this->_getPhotoModel();\n $entries = $model->fetchEntries($this->_getParam('page', 1));\n\n $this->view->url = 'http://' . $this->_request->getHttpHost() . $this->_request->getBaseUrl(); \n $this->view->paginator = $entries;\n }", "public function index()\n {\n $items = Item::all();\n return ItemForShowResource::collection($items);\n }", "public function index()\n {\n return Resource::collection(($this->getModel())::paginate(10));\n }", "function index()\n\t{\n\t\t$this->_list();\n\t\t$this->display();\n\t}", "public function listingAction(){\n if (!LoginHelper::isAdmin()){\n Router::redirect('home', '<p class=\"alert alert-danger\">Unauthorized</p>');\n }\n $this->view->render('patient/list', Patient::all());\n }", "public function index()\n {\n //\n $list = $this->obj->all();\n\n return $this->render('index', compact('list'));\n }", "public function action_index()\n\t{\n\t\t$this->template->title = 'Resources';\n\t\t$this->view = View::factory('admin/resource/index');\n\t\t$this->template->scripts[] = 'media/js/jquery.tablesorter.min.js';\n\t\t$this->template->scripts[] = 'media/js/admin/resource.js';\n\t\t\n\t\t$resources = Sprig::factory('resource')->load(NULL, FALSE);\n\t\tif (!empty($resources))\n\t\t{\n\t\t\t$this->view->resources = $resources->as_array();\n\t\t}\n\t}", "function listing()\n\t\t{\n\t\t// en $this->_view->_listado para poder acceder a el desde la vista.\n\t\t\t$this->_view->_listado = $listado = $this->_instrumentoModel->getInstrumento();\n\t\t\t$this->_view->render('listing', '', '',$this->_sidebar_menu);\n\t\t}", "public function listAction()\n {\n $em = $this->getDoctrine()->getManager();\n \n $todos = $em->getRepository(Todo::class)->findAll();\n \n return $this->render('todo/index.html.twig', array(\n 'todos' => $todos,\n ));\n }", "public function index()\n\t{\n $this->authorize('list', Instance::class);\n\n\t\treturn $this->ok($this->repo->paginate($this->request->all()));\n\t}", "public function listing()\n\t{\n\t\t$hospitalID = $this->request->getSession()->read(\"hospital_id\") ? $this->request->getSession()->read(\"hospital_id\") : \"\";\n\t\t\n\t\t$patientMonitored = 1;\n\t\t$patientActive = 1;\n\t\t\n\t\t//GET ALL PATIENTS\n\t\t$patientsData = $this->Patients->allPatients($hospitalID,$patientMonitored,$patientActive);\n\t\t//GET ALL PATIENTS\n\t\t\n\t\t//echo \"<pre>\"; print_r($patientsData);die;\n\t\t$this->set(compact(\"patientsData\"));\n\t}", "public function actionRestList() {\n\t $this->doRestList();\n\t}", "public function listAction()\n {\n $htmlpage = '<!DOCTYPE html>\n<html>\n <head>\n <meta charset=\"UTF-8\">\n <title>todos list!</title>\n </head>\n <body>\n <h1>todos list</h1>\n <p>Here are all your todos:</p>\n <ul>';\n \n $em = $this->getDoctrine()->getManager();\n $todos = $em->getRepository(Todo::class)->findAll();\n foreach($todos as $todo) {\n $htmlpage .= '<li>\n <a href=\"/todo/'.$todo->getid().'\">'.$todo->getTitle().'</a></li>';\n }\n $htmlpage .= '</ul>';\n\n $htmlpage .= '</body></html>';\n \n return new Response(\n $htmlpage,\n Response::HTTP_OK,\n array('content-type' => 'text/html')\n );\n }", "public function index()\n {\n // Get Persons\n $person = Person::paginate(10);\n\n //Return collection of person as a resource\n return PersonResource::collection($person);\n }", "public function listAction() {\n\t\t$this->view->title = $this->translator->translate(\"Invoice list\");\n\t\t$this->view->description = $this->translator->translate(\"Here you can see all the invoices.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"/admin/invoices/new/\", \"label\" => $this->translator->translate('New'), \"params\" => array('css' => null)));\r\n\t\t$this->datagrid->setConfig ( Invoices::grid() )->datagrid ();\n\t}", "public function listAll()\n\t{\n\t\t$this->render(self::PATH_VIEWS . '/list', [\n\t\t\t'pages' => $this->pagesDb->findAll('id', 'DESC'),\n\t\t]);\n\t}", "public function list()\n {\n // récupérer les données : toutes les catégories enregistrées\n $productList = Product::findAll();\n\n $this->show('product/list', [\n 'productList' => $productList\n ]);\n }", "public function index()\n {\n // CRUD -> Retrieve --> List\n // BREAD -> Browse Read Edit Add Delete\n // return Item::all();\n return view('list_items',compact('items'));\n }", "public function index()\n {\n // Get manufacturers\n $manufacturers = Manufacturer::orderBy('created_at', 'desc')->paginate(15);\n\n // Return collection of manufacturers as a resource\n return ManufacturerResource::collection($manufacturers);\n }", "public function index()\n {\n return ArtistResource::collection(Artist::orderBy('created_at', 'desc')->get());\n }", "public function indexAction() {\n\t\t$page = intval($this->getInput('page'));\n\t\t$perpage = $this->perpage;\n\t\t\n\t\tlist(,$files) = Lock_Service_FileType::getAllFileType();\n\t\t$data = array();\n\t\tforeach ($files as $key=>$value) {\n\t\t\t$data[$key]['id'] = $value['id'];\n\t\t\t$data[$key]['title'] = $value['name'];\n\t\t}\n\t\tlist($total, $filetype) = Lock_Service_FileType::getList($page, $perpage);\n\t\t$this->assign('filetype', $filetype);\n\t\t$this->assign('pager', Common::getPages($total, $page, $perpage, $this->actions['listUrl'].'/?'));\n\t\t$this->assign('data', json_encode($data));\n\t}", "public function listAction()\n {\n $qb = $this->getRepository()->queryAll();\n\n $view = new ImportListView;\n $view->imports = $qb->getQuery()->execute();\n\n return $this->templating->renderResponse('InfiniteImportBundle:Import:list.html.twig', array(\n 'data' => $view\n ));\n }", "public function index()\n\t{\n\t\t//Return model all()\n\t\t$instances = $this->decorator->getListingModels();\n\n\t\treturn View::make($this->listingView, array(\n\t\t\t'instances' => $instances,\n\t\t\t'controller' => get_class($this), \n\t\t\t'modelName' => class_basename(get_class($this->decorator->getModel())),\n\t\t\t'columns' => $this->getColumnsForInstances($instances),\n\t\t\t'editable' => $this->editable\n\t\t));\n\t}", "public function index()\n {\n return InfografiResources::collection(\n Infografi::orderBy('date', 'desc')->get()\n );\n }", "public function listAction()\n\t {\n\t\t\t$this->_forward('index');\n \n\t\t}", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function listAction()\n {\n $defaults = array(\n 'page' => null,\n 'order' => null,\n 'limit' => null,\n 'offset' => null,\n 'filter' => array(),\n );\n $body = $this->getRequest()->getBody();\n $options = $body + $defaults;\n\n // Process the options\n if (is_string($options['order'])) {\n $options['order'] = array_map('trim', explode(',', $options['order']));\n }\n if (is_string($options['page'])) {\n $options['page'] = (int)$options['page'];\n }\n if (is_string($options['limit'])) {\n $options['limit'] = (int)$options['limit'];\n }\n if (is_string($options['offset'])) {\n $options['offset'] = (int)$options['offset'];\n }\n $filter = $options['filter'];\n unset($options['filter']);\n\n $options = array_filter($options);\n\n return $this->getBinding()->find($filter, $options);\n }", "public function index()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the resources from the model */\n $resources = $this->resourcesList($this->model);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.index\")) {\n $view = \"admin.{$this->name}.index\";\n } else {\n $view = 'admin.includes.actions.index';\n }\n\n /* Display a listing of the resources */\n return view($view)\n ->with('resources', $resources)\n ->with('module', $this->module);\n }", "public function index()\n\t{\n\t\t$data['lists'] = $this->mdl_student->get_all();\n\t\t$this->template->set('title', 'Student Hostel List');\n\t\t$this->template->load('template', 'contents', 'student_hostel/student_hostel_list', $data);\n\t}", "public function index()\n {\n $modules = Module::all();\n return Resource::collection($modules);\n }", "public function index()\n {\n // List all resources from user entity\n $users = User::all();\n\n return $this->showAll($users);\n }", "public function index()\n {\n // Get todos\n $todos = Todo::orderBy('created_at', 'desc')->paginate(3);\n\n // Return collection of articles as a resource\n return TodoResource::collection($todos);\n }", "public function index()\n {\n return CourseListResource::collection(\n Course::query()->withoutGlobalScope('publish')\n ->latest()->paginate()\n );\n }", "public function index()\n {\n return Resources::collection(Checking::paginate());\n }", "public function index()\n {\n $cars = Car::paginate(15);\n return CarResource::collection($cars);\n }", "public function index()\n {\n // Get articles\n $articles = Article::orderBy('created_at', 'desc')->paginate(5);\n\n // Return collection of articles as a resource\n return ArticleResource::collection($articles);\n }", "public function index()\n {\n $authors = Author::paginate(10);\n\n return AuthorResource::collection($authors);\n }", "public function index()\n {\n //Get Books\n $books = Book::paginate(10);\n \n if ($books) {\n return (BookResource::collection($books))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n } else {\n return (BookResource::collection([]))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n }\n return view('index')->with('data', $books);\n }", "public function index()\n {\n $books = Book::latest()\n ->paginate(20);\n\n return BookResource::collection($books);\n }", "public function view(){\n\t\t$this->buildListing();\n\t}", "public function index()\n {\n $listing = Listing::orderBy('id', 'desc')->paginate(10);\n return view('listings.index')->withListings($listing);\n }", "public function listAction()\n {\n $this->_getSession()->setFormData([]);\n\n $this->_title($this->__('Training Cms'))\n ->_title($this->__('Pages'));\n\n $this->loadLayout();\n\n $this->_setActiveMenu('training_cms');\n $this->_addBreadcrumb($this->__('Training Cms'), $this->__('Training Cms'));\n $this->_addBreadcrumb($this->__('Pages'), $this->__('Pages'));\n\n $this->renderLayout();\n }", "public function index()\n {\n $services = $this->serviceRepository->paginate();\n\n return ServiceResource::collection($services);\n }", "public function index()\n {\n $resources = ResourceManagement::paginate(5);\n $users = User::get();\n\n return view('resources-mgmt/index', ['resources' => $resources, 'users' => $users]);\n }", "public function index()\n {\n $catalogs = Catalog::where('status', '=', Catalog::PUBLICADO)\n ->orderBy('id', 'DESC')->get();\n \n $data = CatalogResource::collection($catalogs);\n\n return [\n 'items' => $data,\n 'mensaje' => ''\n ];\n }", "public function listAction(){\n // In a controller this can be:\n // $this->request->getQuery('page', 'int'); // GET\n $currentPage = $this->request->getPost('pageindex', 'int'); // POST\n $pageNum = ($currentPage == null) ? 1 : $currentPage;\n\n // The data set to paginate\n $message = new Notice();\n $results = $message->getMsg4Admin();\n\n // Create a Model paginator, show 10 rows by page starting from $currentPage\n $paginator = new PaginatorArray(\n array(\n \"data\" => $results,\n \"limit\" => 10,\n \"page\" => $pageNum\n )\n );\n\n // Get the paginated results\n $page = $paginator->getPaginate();\n\n return $this->response->setJsonContent($page);\n\n }", "public function list()\n {\n try {\n return $this->success($this->service->list());\n } catch (\\Exception $exception) {\n return $this->error($exception->getMessage());\n }\n }", "public function index()\n {\n return $this->sendResponse(CrisisResource::collection(Crisis::paginate(10)), 'Data fetched successfully');\n }", "public function index()\n\t{\n\t\t$%Alias = new %Model();\n\t\t$params = array();\n\t\t\n\t\t$Paginator = new Paginator( $%Alias->findSize( $params ), $this->getLimit(), $this->getPage() );\n\t\t$this->getView()->set( '%Aliass', $%Alias->findList( $params, 'Id desc', $this->getOffset(), $this->getLimit() ) );\n\t\t$this->getView()->set( 'Paginator', $Paginator );\n\t\treturn $this->getView()->render();\n\t}", "public function listAction() {}", "public function index()\n {\n\n return RecipeResource::collection(Recipe::all());\n }", "public function index()\n {\n $this->indexPage('list-product', 'List Product');\n }", "public function listAction()\n {\t\n\t\t$this->removeSession();\n\t\t$this->verifySessionRights();\n\t\t$this->setActivity(\"List view\");\n $em = $this->getDoctrine()->getManager();\n $oRepClient = $em->getRepository('BoAdminBundle:Client');\n\t\t$nb_tc = $oRepClient->getTotal();\n\t\t//get page\n\t\t$page = $this->get('session')->get('page');\n\t\tif($page==null){\n\t\t\t$page=1;\n\t\t\t$this->get('session')->set('page',1);\n\t\t}\n\t\t//get number line per page\n\t\t$nb_cpp = $em->getRepository('BoAdminBundle:Param')->getParam(\"display_list_page_number\",1);\n\t\t$nb_pages = ceil($nb_tc/$nb_cpp);\n\t\t$offset = $page>0?($page-1) * $nb_cpp:0;\n\t\t$clients = $em->getRepository('BoAdminBundle:Client')->findBy(array(),array('id' => 'desc'),$nb_cpp,$offset);\n $form = $this->createForm('Bo\\AdminBundle\\Form\\ClientType', new Client());\n return $this->render('client/index.html.twig', array(\n 'clients' => $clients,\n\t\t\t'page' => $page, // forward current page to view,\n\t\t\t'nb_pages' => $nb_pages, //total number page,\n 'form' => $form->createView(),\n\t\t\t'total'=>$nb_tc, // record number.\n\t\t\t'nb_cpp' => $nb_cpp,// line's number to display\n\t\t\t'pm'=>\"contracts\",\n\t\t\t'sm'=>\"client\",\n ));\n }", "public function index()\n {\n return AcResource::collection(Ac::latest()->paginate()); //\n }", "public function executeList()\n {\n $this->setTemplate('list');\n }", "public function indexAction()\n {\n $books = Book::getAll();\n\n View::renderTemplate('Books/index.html', [\n 'books' => $books\n ]);\n }", "function listing() {\r\n\r\n }", "public function listar() {\n $rs = $this->model->listar();\n\n echo $this->toJson($rs);\n }", "public function index()\n {\n return BookResource::collection(Book::orderby('id')->get());\n }", "public function index()\n {\n $client = Client::paginate();\n return ClientResource::collection($client);\n }", "public function doRestList()\n {\n $this->outputHelper( \n 'Records Retrieved Successfully', \n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->orderBy($this->restSort)->limit($this->restLimit)->offset($this->restOffset)->findAll(),\n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->count()\n );\n\t}", "public function index()\n {\n return TagResource::collection(\n Tag::orderBy('name', 'ASC')->paginate(request('per_page', 10))\n );\n }", "public function index()\n\t{\n\t\t$data['lists'] = $this->gallery_mdl->get_all();\n\t\t$this->template->set('title', 'Gallery');\n\t\t$this->template->render('template', 'list', $data);\n\t}", "public function _index(){\n\t $this->_list();\n\t}", "public function index()\n {\n $this->booklist();\n }", "function drush_restapi_list() {\n\n $resources = restapi_get_resources();\n $last_module = NULL;\n $rows = [\n [dt('Module'), dt('Path'), dt('Class')],\n ];\n\n foreach($resources as $resource) {\n if ($last_module != $resource->getModule()) {\n $module = $last_module = $resource->getModule();\n }\n else {\n $module = '';\n }\n $rows[] = [$module, $resource->getPath(), $resource->getClass()];\n }\n\n drush_print_table($rows, TRUE);\n drush_log(dt('Displaying !count total resources', [\n '!count' => count($resources),\n ]), 'ok');\n\n}", "public function index()\n {\n $items = Item::all();\n return view('items::list_items',compact('items'));\n }", "public function index()\n {\n //\n $accounts = accounts::paginate(15);\n\n //return the collection of employees as a resource\n return accountResource::collection($accounts);\n\n\n }", "public function index()\n {\n // Get houses\n $houses = House::orderBy('created_at', 'desc')->paginate(self::PAGINATE);\n \n // Return collection of houses\n \n return HouseResource::collection($houses);\n }", "public function index()\n {\n $products = Product::paginate(6);\n return ProductResource::collection($products);\n }", "public function index() {\n $this->template->allFoundItems = Found::showAll();\n $this->template->display( 'index.html.php' );\n }", "public function indexAction() {\n $this->_forward('list');\n }", "public function index()\n {\n $data = Productcategory::paginate(10);\n\t\treturn ProductcategoryResource::Collection($data);\n }", "public function index()\n {\n return SongResource::collection(\\App\\Song::orderBy('created_at', 'desc')->get());\n }", "public function ListView()\n\t{\n\t\t\n\t\t// Requer permissão de acesso\n\t\t$this->RequirePermission(Usuario::$P_ADMIN,\n\t\t\t\t'SecureExample.LoginForm',\n\t\t\t\t'Autentique-se para acessar esta página',\n\t\t\t\t'Você não possui permissão para acessar essa página ou sua sessão expirou');\n\t\t\n\t\t//$usuario = Controller::GetCurrentUser();\n\t\t//$this->Assign('usuario',$usuario);\n\t\t$this->Render();\n\t}", "public function index () {\n permiss ( 'role.list' );\n\n $data = $this->entity\n ->orderBy('created_at', 'desc')->get();\n\n return new ModelResource($data);\n }", "public function index()\n {\n //get articless\n $articles = Article::paginate(15);\n\n //Return collection of article has a resource\n return ArticleResource::collection($articles);\n\n }", "public function showResources()\n {\n $resources = Resource::get();\n return view('resources', compact('resources'));\n }", "public function actionList() {\n header(\"Content-type: application/json\");\n $verb = $_SERVER[\"REQUEST_METHOD\"];\n\n if ($verb === 'GET') {\n echo \"{\\\"data\\\":\" . CJSON::encode(Donneur::model()->findAll()) . \"}\";\n } else if ($verb == 'POST') {\n if (Donneur::model()->exists('id' === $_POST['id'])) {\n $this->actionListUpdate($_POST);\n } else {\n $this->actionListPost();\n }\n } else if ($verb == 'DELETE') {\n $this->actionListDelete();\n }\n }", "public function list()\n {\n return $this->http->request(HttpMethods::GET, $this->endpoint);\n }", "public function indexAction(){\n $data = array(\n 'collection' => $this->model->getCollection(),\n \n ); \t\n return $this->getView($data);\n }", "public function actionIndex()\n {\n $dataProvider = new ActiveDataProvider([\n 'query' => Slaves::find(),\n ]);\n\n return $this->render('index', [\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('DiverPriceLisrBundle:Items')->findAll();\n\n return $this->render('DiverPriceLisrBundle:Items:index.html.twig', array(\n 'entities' => $entities,\n ));\n }", "public function listAction() {\n\t\t// Recogemos el repositorio\n\t\t$repository = $this->getDoctrine() ->getRepository('AppBundle:Product');\n\t\n\t\t// Recuperamos todos los productos.\n\t\t$products = $repository->findAll();\n\t\t// Pasamos a la plantilla el aray products\n\t\treturn $this->render('product/listActionProduct.html.twig', array( 'products' => $products));\n\t\n\t}", "public function actionList()\n {\n // get model\n $model = new $this->_model('search');\n $model->unsetAttributes();\n\n // set filter\n if (isset($_GET[$this->_model])) {\n $model->attributes = $_GET[$this->_model];\n }\n $model->u_cms_album_id = $_GET['album'];\n\n // search\n $dataProvider = $model->search(Yii::app()->language);\n // sort\n $sort = $dataProvider->getSort();\n // route\n $sort->route = $this->id . '/list';\n\n // pagination parameters\n $pagination = $dataProvider->getPagination();\n $pagination->route = $this->id . '/list';\n $pagination->pageSize = UInterfaceSetting::model()->getSettings($this->id . ':' . $this->module->id, Yii::app()->user->id)->page_size;\n $pagination->itemCount = $dataProvider->totalItemCount;\n\n // datas\n $datas = $dataProvider->getData();\n\n // related datas\n $relatedDatas = $this->_loadRelatedData();\n\n // template\n $template = isset($_REQUEST['partial']) ? 'list/_table' : 'list/main';\n\n $jsonParams = array();\n if (Yii::app()->request->isAjaxRequest) {\n // filters\n $filtersDatas = array();\n if (isset($_GET[$this->_model])) {\n $filtersDatas[$this->_model] = $_GET[$this->_model];\n }\n if (isset($_GET[$sort->sortVar])) {\n $filtersDatas[$sort->sortVar] = $_GET[$sort->sortVar];\n }\n\n $jsonParams = array(\n 'filters' => http_build_query($filtersDatas)\n );\n }\n\n $this->dynamicRender(\n $template,\n array(\n 'dataView' => new $this->crudComponents['listDataView'](\n $datas, $relatedDatas, $model, $sort, $pagination, $this\n )\n ),\n $jsonParams\n );\n }", "public function listAction()\n\t {\n\t\t$model = $this->_getModel();\n\t\t$result = $model->getLayouts();\t\n\t\t$page = (int)($this->_request->getParam('page')); \n\t\tif(count($result) > 0)\n\t\t{ \n\t\t\tGlobals::doPaging($result, $page, $this->view);\n\t\t}\n\t\t\t\t\n\t\t$this->view->page = $page;\n\t }", "public function index()\n {\n return view('listings.index')->with('listings', Listing::all());\n }", "public function get_index()\n\t{\n\t\t$pages = Page::recent_available()->paginate(30);\n\t\t$table = Cello\\Presenter\\Page::table($pages);\n\t\t$data = array(\n\t\t\t'eloquent' => $pages,\n\t\t\t'table' => $table,\n\t\t);\n\n\t\tSite::set('title', __('cello::title.pages.list'));\n\n\t\treturn View::make('cello::api.resources.index', $data);\n\t}", "public function index()\n {\n $category = GalleryCategory::paginate(15);\n\n // return collection of category as a resource.\n return Resource::collection($category);\n }", "public function index()\n {\n return ProductResource::collection(Product::latest()->paginate(10));\n }", "public function index()\n {\n //\n $news = News::latest()->paginate(18);\n\n return NewsResource::collection($news);\n }", "public function indexAction() {\n\t\t$list_info = Zend_Registry::get('list_info');\n if (!Engine_Api::_()->core()->hasSubject('list_listing')) {\n return $this->setNoRender();\n }\n \n $this->view->expiry_setting = Engine_Api::_()->list()->expirySettings();\n\n //GET SUBJECT\n $this->view->list = $list = Engine_Api::_()->core()->getSubject('list_listing');\n\n\t\t//GET CATEGORY TABLE\n\t\t$this->view->tableCategory = Engine_Api::_()->getDbTable('categories', 'list');\n\n //GET CATEGORIES NAME\n\t\t$this->view->category_name = $this->view->subcategory_name = $this->view->subsubcategory_name = '';\n\n\t\tif(!empty($list->category_id)) {\n\t\t\tif($this->view->tableCategory->getCategory($list->category_id))\n\t\t\t$this->view->category_name = $this->view->tableCategory->getCategory($list->category_id)->category_name;\n\n\t\t\tif(!empty($list->subcategory_id)) {\n\t\t\t\tif($this->view->tableCategory->getCategory($list->subcategory_id))\n\t\t\t\t$this->view->subcategory_name = $this->view->tableCategory->getCategory($list->subcategory_id)->category_name;\n\n\t\t\t\tif(!empty($list->subsubcategory_id)) {\n\t\t\t\t\tif($this->view->tableCategory->getCategory($list->subsubcategory_id))\n\t\t\t\t\t$this->view->subsubcategory_name = $this->view->tableCategory->getCategory($list->subsubcategory_id)->category_name;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n //GET LISTING TAGS\n $this->view->listTags = $list->tags()->getTagMaps();\n\n\t\t//GET OTHER DETAILS\n\t\t$this->view->list_description = Zend_Registry::get('list_descriptions');\n $this->view->addHelperPath(APPLICATION_PATH . '/application/modules/Fields/View/Helper', 'Fields_View_Helper');\n $this->view->fieldStructure = Engine_Api::_()->fields()->getFieldsStructurePartial($list);\n\t\tif(empty($list_info)){ return $this->setNoRender(); }\n }", "public function index()\n {\n return $this->service->fetchResources(Author::class, 'authors');\n }", "public function index()\n {\n return view('admin.resources.index');\n }", "public function doRestList() {\n\t\t$this->outputHelper ( 'Collections Retrieved Successfully', $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->orderBy ( $this->restSort )->limit ( $this->restLimit )->offset ( $this->restOffset )->findAll (), $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->count () );\n\t}" ]
[ "0.7447426", "0.73628515", "0.73007894", "0.7249563", "0.7164474", "0.7148467", "0.71320325", "0.7104678", "0.7103152", "0.7100512", "0.7048493", "0.6994995", "0.69899315", "0.6935843", "0.6899995", "0.68999326", "0.6892163", "0.6887924", "0.6867505", "0.6851258", "0.6831236", "0.68033123", "0.6797587", "0.6795274", "0.67868614", "0.67610204", "0.67426085", "0.67303514", "0.6727031", "0.67257243", "0.67257243", "0.67257243", "0.67195046", "0.67067856", "0.67063624", "0.67045796", "0.66655326", "0.666383", "0.66611767", "0.66604036", "0.66582054", "0.6654805", "0.6649084", "0.6620993", "0.66197145", "0.6616024", "0.66077465", "0.6602853", "0.6601494", "0.6593894", "0.65878326", "0.6586189", "0.6584675", "0.65813804", "0.65766823", "0.65754175", "0.657203", "0.657202", "0.65713936", "0.65642136", "0.6563951", "0.6553249", "0.6552584", "0.6546312", "0.6536654", "0.6534106", "0.6532539", "0.6527516", "0.6526785", "0.6526042", "0.65191233", "0.6518727", "0.6517732", "0.6517689", "0.65155584", "0.6507816", "0.65048593", "0.6503226", "0.6495243", "0.6492096", "0.6486592", "0.64862204", "0.6485348", "0.6483991", "0.64789015", "0.6478804", "0.64708763", "0.6470304", "0.64699143", "0.6467142", "0.646402", "0.6463102", "0.6460929", "0.6458856", "0.6454334", "0.6453653", "0.645357", "0.6450551", "0.64498454", "0.64480853", "0.64453584" ]
0.0
-1
Show the form for creating a new resource.
public function create() { return view('SG/Thematic/create'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return view('admin.resources.create');\n }", "public function create(){\n\n return view('resource.create');\n }", "public function create()\n\t{\n\t\treturn $this->showForm('create');\n\t}", "public function create()\n {\n return \"Display a form for creating a new catalogue\";\n }", "public function newAction()\n {\n $entity = new Resource();\n $current = $this->get('security.context')->getToken()->getUser();\n $entity->setMember($current);\n $form = $this->createCreateForm($entity);\n\n return array(\n 'nav_active'=>'admin_resource',\n 'entity' => $entity,\n 'form' => $form->createView(),\n );\n }", "public function create()\n {\n return view ('forms.create');\n }", "public function create ()\n {\n return view('forms.create');\n }", "public function create()\n\t{\n\t\treturn view('faith.form');\n\t}", "public function create(NebulaResource $resource): View\n {\n $this->authorize('create', $resource->model());\n\n return view('nebula::resources.create', [\n 'resource' => $resource,\n ]);\n }", "public function create()\n {\n return view(\"request_form.form\");\n }", "public function create()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.create\")) {\n $view = \"admin.{$this->name}.create\";\n } else {\n $view = 'admin.includes.actions.create';\n }\n\n /* Show the form for creating a new resource. */\n return view($view)\n ->with('name', $this->name);\n }", "public function newAction()\n\t{\n\t\t$this->render( View::make( 'schools/form' , array(\n\t\t\t'title' => 'Ajouter une nouvelle &eacute;cole'\n\t\t) ) );\n\t}", "public function create()\n {\n return view($this->forms . '.create');\n }", "public function create()\n {\n return view('restful.add');\n }", "public function create()\n {\n $resource = (new AclResource())->AclResource;\n\n //dd($resource);\n return view('Admin.acl.role.form', [\n 'resource' => $resource\n ]);\n }", "public function create()\n {\n return view('admin.createform');\n }", "public function create()\n {\n return view('admin.forms.create');\n }", "public function create()\n {\n return view('backend.student.form');\n }", "public function newAction()\n {\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem('Inicio', $this->get('router')->generate('admin.homepage'));\n $breadcrumbs->addItem($this->entityDescription, $this->get(\"router\")->generate(\"admin.$this->entityName.index\"));\n $breadcrumbs->addItem('Nuevo');\n\n $entity = $this->getManager()->create();\n $form = $this->getForm($entity);\n\n return $this->render('AdminBundle:Default:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'metadata' => $this->getMetadata()\n ));\n }", "public function create()\n {\n return view('client.form');\n }", "public function create()\n {\n // Nos regresa la vista del formulario\n return view('project.form');\n }", "public function create()\n {\n return view('Form');\n }", "public function newAction(){\n \n $entity = new Resourceperson();\n $form = $this->createAddForm($entity);\n\n \n return $this->render('ABCRspBundle:rsp:add.html.twig',array('entity'=>$entity,'form'=> $form->createView()));\n }", "public function createForm()\n\t{\n\t\treturn view('post.new');\n\t}", "public function create()\n {\n return view('admin.form.create', ['form' => new Form]);\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n $title = $this->title;\n $subtitle = \"Adicionar cliente\";\n\n return view('admin.clients.form', compact('title', 'subtitle'));\n }", "public function create()\n {\n return view('backend.schoolboard.addform');\n }", "public function create()\n\t{\n\t\treturn view('info.forms.createInfo');\n\t}", "public function create()\n {\n return view('rests.create');\n }", "public function create()\n {\n //\n return view('form');\n }", "public function create()\n {\n return $this->showForm();\n }", "public function create()\n {\n return $this->showForm();\n }", "public function create()\n {\n return view(\"Add\");\n }", "public function create(){\n return view('form.create');\n }", "public function create()\n {\n // Show the page\n return view('admin.producer.create_edit');\n }", "public function create()\n {\n\n return view('control panel.student.add');\n\n }", "public function newAction() {\n\t\t\n\t\t$this->view->form = $this->getForm ( \"/admin/invoices/process\" );\n\t\t$this->view->title = $this->translator->translate(\"New Invoice\");\n\t\t$this->view->description = $this->translator->translate(\"Create a new invoice using this form.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"#\", \"label\" => $this->translator->translate('Save'), \"params\" => array('css' => null,'id' => 'submit')),\r\n\t\t\t\t\t\t\t array(\"url\" => \"/admin/invoices/list\", \"label\" => $this->translator->translate('List'), \"params\" => array('css' => null)));\n\t\t$this->render ( 'applicantform' );\n\t}", "public function create()\n {\n $data['action'] = 'pengiriman.store';\n return view('pengiriman.form', $data);\n }", "public function create()\n {\n return $this->cView(\"form\");\n }", "public function newAction()\n {\n // Création de l'entité et du formulaire.\n $client = new Client();\n $formulaire = $this->createForm(new ClientType(), $client);\n \n \n \n // Génération de la vue.\n return $this->render('KemistraMainBundle:Client:new.html.twig',\n array('formulaire' => $formulaire->createView()));\n }", "public function create()\n {\n return view(\"dresses.form\");\n }", "public function create()\n\t{\n\t\treturn View::make('new_entry');\n\t}", "public function createAction()\n {\n// $this->view->form = $form;\n }", "public function create()\n {\n return view('bank_account.form', ['mode' => 'create']);\n }", "public function create()\n {\n return view('fish.form');\n }", "public function create()\n {\n return view('users.forms.create');\n }", "public function create()\n {\n $this->setFormFields($this->getCreateFormFields());\n $form = $this->getCreateForm();\n\n return view($this->getViewName('create'), [\n 'crudSlug' => $this->slug,\n 'form' => $form,\n ]);\n }", "public function create()\n\t{\n\t\treturn view('admin.estadoflete.new');\n\t}", "public function create()\n {\n $person = new Person;\n return view('contents.personform')->with(compact('person') );\n }", "public function createAction(){\n \t$this->view->placeholder('title')->set('Create');\n \t$this->_forward('form');\n }", "public function create()\n {\n Gate::authorize('app.products.create');\n\n return view('backend.products.form');\n }", "public function create()\n {\n return view('essentials::create');\n }", "public function create()\n {\n return view('student.add');\n }", "public function create()\n\t{\n\t\treturn view('loisier/create');\n\t}", "public function create()\n {\n return view('url.form');\n }", "public function newAction()\n {\n $entity = new Facture();\n $factureType = new FactureType();\n\t\t$factureType->setUser($this->get('security.context')->getToken()->getUser());\n $form = $this->createForm($factureType, $entity);\n\n return $this->render('chevPensionBundle:Facture:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function newAction()\n {\n $entity = new Chofer();\n $form = $this->createForm(new ChoferType(), $entity, ['user' => $this->getUser()]);\n\n return $this->render('ChoferesBundle:Chofer:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'css_active' => 'chofer',\n ));\n }", "public function create()\n\t{\n\t\treturn View::make('crebos.create');\n\t}", "public function create() : View\n {\n $fieldset = $this->menuFieldset();\n\n return $this->view('create', [\n 'title' => trans('addons.Aardwolf::titles.create'),\n 'data' => [],\n 'fieldset' => $fieldset->toPublishArray(),\n 'suggestions' => [],\n 'submitUrl' => route('aardwolf.postCreate')\n ]);\n }", "public function newAction()\n {\n $entity = new Species();\n $form = $this->createForm(new SpeciesType(), $entity);\n\n return $this->render('InfectBackendBundle:Species:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n return view('libro.create');\n }", "public function create()\n {\n return view('libro.create');\n }", "public function create()\n {\n return view('crud/add'); }", "public function create()\n\t{\n\t\treturn View::make('supplier.create');\n\t}", "public function newAction()\n {\n $entity = new Company();\n $form = $this->createForm(new CompanyType(), $entity);\n\n return $this->render('SiteSavalizeBundle:Company:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n return view(\"List.form\");\n }", "public function index_onCreateForm()\n\t{\n\t\tparent::create();\n\t\treturn $this->makePartial('create');\n\t}", "public function create()\n {\n //load create form\n return view('products.create');\n }", "public function create()\n {\n return view('article.addform');\n }", "public function create()\n {\n // Mengarahkan ke halaman form\n return view('buku.form');\n }", "public function create()\n {\n return view('saldo.form');\n }", "public function create()\n\t{\n\t\t// load the create form (app/views/material/create.blade.php)\n\t\t$this->layout->content = View::make('material.create');\n\t}", "public function create()\n\t\t{\n\t\t\treturn view('kuesioner.create');\n\t\t}", "public function view_create_questioner_form() {\n \t// show all questioner\n \t// send questioner to form\n \treturn view(\"create_questioner\");\n }", "public function newAction() {\n $entity = new Question();\n $form = $this->createCreateForm($entity);\n\n return $this->render('CdlrcodeBundle:Question:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n $data['companies'] = Company::select('id', 'name')->where('status', 1)->orderBy('id', 'desc')->get();\n return view('admin.outlet.outlet_form', $data);\n }", "public function create()\n {\n return view('admin.inverty.add');\n }", "public function create()\n {\n return view('Libro.create');\n }", "public function create()\n {\n $breadcrumb='car.create';\n return view('admin.partials.cars.form', compact('breadcrumb'));\n }", "public function create()\n {\n return view(\"familiasPrograma.create\");\n }", "public function create()\n {\n $title = trans('entry_mode.new');\n return view('layouts.create', compact('title'));\n }", "public function create()\n {\n return view('admin.car.create');\n }", "public function create()\n {\n return view('admin.car.create');\n }", "public function create()\n\t{\n\t\treturn View::make('perusahaans.create');\n\t}", "public function create()\n {\n return view(\"create\");\n }", "public function create()\n\t{\n //echo 'show form';\n\t\treturn View::make('gaans.create');\n\t}", "public function create()\n {\n $title = trans('dormitorybed.new');\n $this->generateParams();\n\n return view('layouts.create', compact('title'));\n }", "public function create()\n {\n return view('forming');\n }", "public function formNew() {\n $this->data->options = array(\n 'RJ' => 'Rio de Janeiro',\n 'MG' => 'Minas Gerais',\n 'SP' => 'São Paulo',\n 'ES' => 'Espírito Santo',\n 'BA' => 'Bahia',\n 'RS' => 'Rio Grande do Sul'\n );\n $this->data->action = \"@exemplos/pessoa/save\";\n $this->render();\n }", "public function create()\n {\n \t\n \treturn view('supplies.create');\n\n }", "public function createAction()\n {\n if ($form = $this->processForm()) {\n $this->setPageTitle(sprintf($this->_('New %s...'), $this->getTopic()));\n $this->html[] = $form;\n }\n }", "public function create()\n {\n $page_title = \"Add New\";\n return view($this->path.'create', compact('page_title'));\n }", "public function newAction(){\n\t\t$entity = new Reserva();\n\t\t$form = $this->createCreateForm($entity);\n\n\t\treturn $this->render('LIHotelBundle:Reserva:new.html.twig', array(\n\t\t\t'entity' => $entity,\n\t\t\t'form' => $form->createView(),\n\t\t));\n\t}", "public function create()\n {\n // not sure what to do with the form since im\n // using ame partial for both create and edit\n return view('plants.create')->with('plant', new Plant);\n }", "public function create()\n {\n return view('student::students.student.create');\n }", "public function create() {\n\t\t$title = 'Create | Show';\n\n\t\treturn view('admin.show.create', compact('title'));\n\t}" ]
[ "0.7593278", "0.7593278", "0.75862813", "0.7577653", "0.7570922", "0.7499259", "0.743598", "0.7431475", "0.738692", "0.7351195", "0.7336038", "0.73110175", "0.7294184", "0.7280905", "0.7272454", "0.72410536", "0.7229507", "0.72239184", "0.7184587", "0.7177518", "0.7172079", "0.7148124", "0.7142547", "0.71422434", "0.713585", "0.712646", "0.7121425", "0.7113886", "0.7113886", "0.7113886", "0.71099454", "0.7091995", "0.70838404", "0.70796615", "0.70783395", "0.70560604", "0.70560604", "0.7053403", "0.7037733", "0.7037483", "0.7034196", "0.7032379", "0.7028811", "0.70255613", "0.7025196", "0.7018564", "0.7015596", "0.7003297", "0.7002209", "0.6999467", "0.6994898", "0.69925386", "0.69918746", "0.69880474", "0.6985266", "0.69648707", "0.69642234", "0.69544894", "0.6950107", "0.6949808", "0.6946825", "0.69433236", "0.6939847", "0.6938437", "0.6936151", "0.69359493", "0.69359493", "0.6932416", "0.69302046", "0.6927174", "0.69250137", "0.6922311", "0.6917047", "0.69137764", "0.6910701", "0.6909241", "0.6908554", "0.69062465", "0.69030714", "0.6900927", "0.689929", "0.6898352", "0.6893204", "0.68918675", "0.6891051", "0.68910086", "0.6889982", "0.6889982", "0.68871695", "0.6886071", "0.68850255", "0.6882077", "0.688044", "0.6879478", "0.6874531", "0.6871747", "0.6871178", "0.686907", "0.6868627", "0.6868156", "0.68674266" ]
0.0
-1
Store a newly created resource in storage.
public function store(Request $r) { if($r->hasFile('background')){ $file = $r->file('background'); $name_bg = $file->getClientOriginalName(); $file->move(public_path().'/images/imagesSG', $name_bg); } $thematic = new ThematicSG(); $thematic->type = $r->type; $thematic->name = $r->name; $thematic->description = $r->description; $thematic->background = $name_bg; $thematic->snake_color = $r->snake_color; $thematic->save(); return redirect()->route('ThematicSG.index'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function store($data, Resource $resource);", "public function store()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'storeValidations')) {\n $this->request->validate($this->storeValidations());\n }\n\n /* Create a new resource */\n $resource = $this->model::create(Input::all());\n\n /* Redirect to newly created resource page */\n return redirect()\n ->route($this->name . '.edit', $resource->id)\n ->with(\n 'success',\n Lang::has($this->name . '.resource-created') ?\n $this->name . '.resource-created' :\n 'messages.alert.resource-created'\n );\n }", "public function store(CreateStorageRequest $request)\n {\n $this->storage->create($request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource created', ['name' => trans('product::storages.title.storages')]));\n }", "public function createStorage();", "public function store(StoreStorage $request)\n {\n $storage = Storage::create($request->all());\n $request->session()->flash('alert-success', 'Запись успешно добавлена!');\n return redirect()->route('storage.index');\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function store(Request $request, NebulaResource $resource): RedirectResponse\n {\n $this->authorize('create', $resource->model());\n\n $validated = $request->validate($resource->rules(\n $resource->createFields()\n ));\n\n $resource->storeQuery($resource->model(), $validated);\n\n $this->toast(__(':Resource created', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }", "function storeAndNew() {\n $this->store();\n }", "public function store(Request $request)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $validator = Validator::make($request->all(), [\n 'content' => 'required|string',\n 'image_link' => 'sometimes|url',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), [], 400);\n }\n\n $resource = new Resource;\n $resource->user_id = $currentUser['id'];\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->image_link = $request->get('imageLink');\n $resource->video_link = $request->get('videoLink');\n $resource->file_link = $request->get('fileLink');\n $resource->audio_link = $request->get('audioLink');\n $resource->tags = collect($request->get('tags'))->implode('text', ',');\n $resource->is_public = 0;\n $resource->save();\n $data['resource'] = $resource;\n\n if ($request->get('programId')) {\n $this->addToProgram($resource, $request->programId);\n // event(new NewLearningPathResourcePublished($resource, $invitee));\n }\n\n User::find($currentUser['id'])->increment('points', 2);\n\n return APIHandler::response(1, \"New resource has been created\", $data, 201);\n }", "public function store()\n {\n if (!$this->id) { // Insert\n $this->insertObject();\n } else { // Update\n $this->updateObject();\n }\n }", "public function store()\n\t{\n\t\t\n\t\t//\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}" ]
[ "0.72865677", "0.7145327", "0.71325725", "0.6640912", "0.66209733", "0.65685713", "0.652643", "0.65095705", "0.64490104", "0.637569", "0.63736665", "0.63657933", "0.63657933", "0.63657933", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437" ]
0.0
-1
Display the specified resource.
public function show($id) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function show(Resource $resource)\n {\n // not available for now\n }", "public function show(Resource $resource)\n {\n //\n }", "function Display($resource_name, $cache_id = null, $compile_id = null)\n {\n $this->_smarty->display($resource_name, $cache_id, $compile_id);\n }", "private function showResourceable($resourceable)\n {\n save_resource_url();\n\n return $this->view('resources.create_edit')\n ->with('resource', $resourceable)\n ->with('photos', $resourceable->photos)\n ->with('videos', $resourceable->videos)\n ->with('documents', $resourceable->documents);\n }", "function display($resource_name, $cache_id = null, $compile_id = null) {\n\t\t$this->_getResourceInfo($resource_name); // Saves resource info to a Smarty class var for debugging\n\t\t$_t3_fetch_result = $this->fetch($resource_name, tx_smarty_div::getCacheID($cache_id), $compile_id);\n if ($this->debugging) { // Debugging will have been evaluated in fetch\n require_once(SMARTY_CORE_DIR . 'core.display_debug_console.php');\n $_t3_fetch_result .= smarty_core_display_debug_console(array(), $this);\n }\n\t\treturn $_t3_fetch_result;\n\t}", "public function show(ResourceSubject $resourceSubject)\n {\n //\n }", "public function show(ResourceManagement $resourcesManagement)\n {\n //\n }", "public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function retrieve(Resource $resource);", "public function showResource($resouceable, $id)\n {\n $model_name = str_replace('-', ' ',ucwords($resouceable));\n $model_name = str_replace(' ', '',ucwords($model_name));\n\n $resource_type = 'App\\Models\\\\'.$model_name;\n $model = app($resource_type);\n $model = $model->find($id);\n\n return $this->showResourceable($model);\n }", "public function showAction(Ressource $ressource)\n {\n $deleteForm = $this->createDeleteForm($ressource);\n\n return $this->render('ressource/show.html.twig', array(\n 'ressource' => $ressource,\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function show(Dispenser $dispenser)\n {\n //\n }", "public function show($id)\n {\n $resource = Resource::find($id);\n dd($resource);\n }", "public function displayAction() {\n\t\tif(is_numeric($this->req_id)) {\n\t\t\tAPI::DEBUG(\"[DefaultController::displayAction()] Getting \" . $this->req_id, 1);\n\t\t\t$this->_view->data['info'] = $this->_model->get($this->req_id);\n\t\t\t$this->_view->data['action'] = 'edit';\n\n\t\t} else {\n\t\t\t$this->_view->data['action'] = 'new';\n\t\t}\n\t\t// auto call the hooks for this module/action\n\t\terror_log(\"Should Call: \" . $this->module .\"/\".$this->action.\"/\".\"controller.php\");\n\t\tAPI::callHooks($this->module, $this->action, 'controller', $this);\n\n\t\t$this->addModuleTemplate($this->module, 'display');\n\n\t}", "public function show(NebulaResource $resource, $item): View\n {\n $this->authorize('view', $item);\n\n return view('nebula::resources.show', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }", "public function resource(string $resource, string $controller): void\n {\n $base = $this->plural($resource);\n $entity = '/{'.$resource.'}';\n\n $this->app->get($base, $controller.'@index');\n $this->app->post($base, $controller.'@store');\n $this->app->get($base.$entity, $controller.'@show');\n $this->app->patch($base.$entity, $controller.'@update');\n $this->app->delete($base.$entity, $controller.'@destroy');\n }", "public function show($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.show\")) {\n $view = \"admin.{$this->name}.show\";\n } else {\n $view = 'admin.includes.actions.show';\n }\n\n /* Displays the specified resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }", "function displayCustom($resource_name, $cache_id = null, $compile_id = null)\n\t{\n\t return $this->display(DotbAutoLoader::existingCustomOne($resource_name), $cache_id, $compile_id);\n\t}", "public function show($id)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $rules = [\n 'id' => 'required|integer'\n ];\n\n $validator = Validator::make(['id' => $id], $rules);\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n $resource = $this->resourceRepository->fetchResource($id);\n $this->resourceRepository->storeView($id, $currentUser['id']);\n\n $data = [\n 'resource' => $resource,\n 'related_resources' => $this->resourceRepository->getResourcesRelatedTo($resource->id, $resource->mentoring_area_id)\n ];\n\n return APIHandler::response(1, \"Show Resource\", $data);\n }", "public function get(Resource $resource);", "public function showAction()\n {\n $model = $this->_getPhotoModel();\n $photo = $model->fetchEntry($this->getRequest()->getParam('id'));\n\n if (null === $photo) {\n return $this->_forward('notfound', 'error');\n }\n\n $this->view->auth = Zend_Auth::getInstance();\n $this->view->title = $photo->title;\n $this->view->photo = $photo;\n }", "public function show($id)\n {\n //\n $data=Resource::find($id);\n return view('resourceDetails',compact('data'));\n }", "function display() {\n\t\t$view = &$this->getView();\n\t\t$view->display();\n\t}", "public function show(ShowResourceRequest $request, $id)\n {\n // TODO: Implement show() method.\n }", "public function show()\n {\n if ($this->twig !== false) {\n $this->twigDefaultContext();\n if ($this->controller) {\n $this->controller->display($this->data);\n }\n echo $this->twig->render($this->twig_template, $this->data);\n } else {\n $filename = $this->findTemplatePath($this->template);\n require($filename);\n }\n }", "function show( $resource ){\n\n $where = \"reservation_status <> 'Pending' AND id = {$resource}\";\n $reservation = where( 'reservations', $where );\n $reservation = $reservation[0];\n\n return view('admin/reservation/preview_reservation', compact( 'reservation' ));\n}", "public function edit(Resource $resource)\n {\n //\n }", "public function show(rc $rc)\n {\n //\n }", "public function show(Resolucion $resolucion)\n {\n //\n }", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function showAction(furTexture $furTexture)\n {\n\n return $this->render('furtexture/show.html.twig', array(\n 'furTexture' => $furTexture,\n ));\n }", "public function show(Resena $resena)\n {\n }", "public function action_display()\r\n\t{\r\n\t\t$event = ORM::factory('event', array('id' => $this->request->param('id')));\r\n\t\r\n\t\tif ( ! $event->loaded())\r\n\t\t{\r\n\t\t\tNotices::error('event.view.not_found');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Can user view this event?\r\n\t\tif ( ! $this->user->can('event_view', array('event' => $event)))\r\n\t\t{\r\n\t\t\t// Error notification\r\n\t\t\tNotices::error('event.view.not_allowed');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Pass event data to the view class\r\n\t\t$this->view->event_data = $event;\r\n\t\t$this->view->user = $this->user;\r\n\t}", "public function showAction() {\n $docId = $this->getParam('id');\n\n // TODO verify parameter\n\n $document = new Opus_Document($docId);\n\n $this->_helper->layout()->disableLayout();\n\n $this->view->doc = $document;\n $this->view->document = new Application_Util_DocumentAdapter($this->view, $document);\n }", "public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }", "public function execute()\n {\n // HTTP Request Get\n if ($this->type == \"resource\") {\n $action = $this->getResourceAction();\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n } else {\n $action = $this->Request->action;\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n }\n }", "public function display()\n {\n echo $this->getDisplay();\n $this->isDisplayed(true);\n }", "public function show(Resident $resident)\n {\n $this->authorize('admin.resident.show', $resident);\n\n // TODO your code goes here\n }", "public function display()\n\t{\n\t\tparent::display();\n\t}", "public function show()\n\t{\n\t\t\n\t}", "public function get_resource();", "function display() {\n\n\t\t// Check authorization, abort if negative\n\t\t$this->isAuthorized() or $this->abortUnauthorized();\n\n\t\t// Get the view\n\t\t$view = $this->getDefaultView();\n\n\t\tif ($view == NULL) {\n\t\t\tthrow new Exception('Display task called, but there is no view assigned to that controller. Check method getDefaultView.');\n\t\t}\n\n\t\t$view->listing = true;\n\n\t\t// Wrap the output of the views depending on the way the stuff should be shown\n\t\t$this->wrapViewAndDisplay($view);\n\n\t}", "public function viewResources()\n {\n $database = new Database();\n\n $resources = $database->getAllActiveResourcesNoLimit();\n\n\n $resourceArray = array();\n $i = 1;\n\n foreach ($resources as $resource) {\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n array_push($resourceArray, $availableResource);\n $i += 1;\n }\n $resourceSize = sizeof($resourceArray);\n $this->_f3->set('resourcesByActive', $resourceArray);\n $this->_f3->set('resourcesSize', $resourceSize);\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function show($id)\n {\n $this->title .= ' show';\n $this->one($id);\n }", "public function display($title = null)\n {\n echo $this->fetch($title);\n }", "public function display(){}", "public function show($id)\n\t{\n\t\t//\n\t\t//\n\t\n\t}", "public function viewAction()\n\t{\n\t\t//get Id param from request\n\t\tif (!$id = $this->_getParam('id')) {\n\t\t\t$this->getFlashMessenger()->addMessage('Product ID was not specified');\n\t\t\t$this->getRedirector()->gotoSimple('list');\n\t\t}\n\n\t\t//fetch requested ProductID from DB\n\t\tif (!$this->_model->fetch($id)) {\n\t\t\t$this->render('not-found');\n\t\t} else {\n\t\t\t$this->view->model = $this->_model;\n\t\t}\n\t}", "public function show($id)\n {\n // Get single person\n $person = Person::findOrFail($id);\n\n // Return single person as a resource\n return '<h1>Person Number '.$id.'</h1><br>'.json_encode(new PersonResource($person));\n }", "public function display() {\n echo $this->render();\n }", "#[TODO] use self object?\n\tprotected function GET(ResourceObject $resource) {\n#[TODO]\t\tif ($resource->getMTime())\n#[TODO]\t\t\t$this->response->headers->set('Last-modified', gmdate('D, d M Y H:i:s ', $resource->getMTime()) . 'GMT');\n#[TODO]\t\tif ($resource->getCTime())\n#[TODO]\t\t\t$this->response->headers->set('Date', gmdate('D, d M Y H:i:s ', $resource->getCTime()) . 'GMT');\n\n\n#[TODO] handle file streams\n\t\t// get ranges\n#\t\t$ranges = WebDAV::getRanges($this->request, $this->response);\n\n\t\t// set the content of the response\n\t\tif ($resource instanceof ResourceDocument) {\n\t\t\t$this->response->content->set($resource->getContents());\n\t\t\t$this->response->content->setType($resource->getMIMEType());\n\t\t\t$this->response->content->encodeOnSubmit(true);\n\t\t}\n\t}", "public function show($id)\n\t{\n\t//\n\t}", "public function show($id)\n\t{\n\t//\n\t}", "public function show($id)\n {\n //\n $this->_show($id);\n }", "function Fetch($resource_name, $cache_id = null, $compile_id = null, $display = false)\n {\n return $this->_smarty->fetch($resource_name, $cache_id, $compile_id, $display);\n }", "public function show()\n\t{\n\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {}", "static public function showCallback(O_Dao_Renderer_Show_Params $params) {\r\n\t\t/* @var $r R_Mdl_Resource */\r\n\t\t$r = $params->record();\r\n\t\t// Setting layout title\r\n\t\t$params->layout()->setTitle($r->getPageTitle());\r\n\r\n?><h1><?=$r->title?></h1><div id=\"resource\"><?\r\n\t\tif($r->getContent()) {\r\n\t\t\t// page has its own content -- show it\r\n\t\t\t$r->getContent()->show($params->layout(), \"content\");\r\n\t\t} else {\r\n\t\t\t// It is a post unit, show all childs\r\n\t\t\tif($r->is_unit == 1) {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"content\");\r\n\r\n\t\t\t// It is a folder with several units, show paginator\r\n\t\t\t} elseif($r->show_def == \"last-units\") {\r\n\t\t\t\tlist($type, $perpage) = explode(\":\", $r->show_def_params);\r\n\t\t\t\t/* @var $p O_Dao_Paginator */\r\n\t\t\t\t$p = $r->addQueryAccessChecks($r->getChilds())->test(\"is_unit\", 1)->getPaginator(array($r, \"getPageUrl\"), $perpage);\r\n\t\t\t\t$p->show($params->layout(), $type);\r\n\t\t\t// It is a folder with subfolders, boxes, contents. Show one childs level\r\n\t\t\t} else {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"on-parent-page\");\r\n\t\t\t}\r\n\r\n\t\t}\r\n?></div><?\r\n\t}", "public function show($id)\r\n\t{\r\n\t\t//\r\n\r\n\r\n\r\n\t}", "public abstract function display();", "public function show($resourceId, $eventId)\n {\n $routes = $this->routes;\n\n $eventable = $this->getEventableRepository()->model()->findOrFail($resourceId);\n\n if (method_exists($eventable, 'events')) {\n $event = $eventable->events()->find($eventId);\n\n if ($event) {\n $apiObject = $this->event->findApiObject($event->api_id);\n\n return view('events.eventables.show', compact('routes', 'eventable', 'event', 'apiObject'));\n }\n }\n\n abort(404);\n }", "public function show($id)\r\r\n\t{\r\r\n\t\t//\r\r\n\t}", "public function show( $id ) {\n\t\t//\n\t}", "public function show( $id ) {\n\t\t//\n\t}", "abstract public function resource($resource);", "public function show(Response $response)\n {\n //\n }", "public function show()\n {\n return auth()->user()->getResource();\n }", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}" ]
[ "0.8232636", "0.81890994", "0.68296117", "0.64987075", "0.649589", "0.64692974", "0.64633286", "0.63640857", "0.6307513", "0.6281809", "0.621944", "0.61926234", "0.61803305", "0.6173143", "0.61398774", "0.6119022", "0.61085826", "0.6106046", "0.60947937", "0.6078597", "0.6047151", "0.60409963", "0.6021287", "0.5989136", "0.5964405", "0.5962407", "0.59518087", "0.59309924", "0.5921466", "0.5908002", "0.5908002", "0.5908002", "0.59051657", "0.5894554", "0.5871459", "0.5870088", "0.586883", "0.5851384", "0.58168566", "0.58166975", "0.5815869", "0.58056176", "0.5799148", "0.5795126", "0.5791158", "0.57857597", "0.5783371", "0.5761351", "0.57592535", "0.57587147", "0.5746491", "0.57460666", "0.574066", "0.5739448", "0.5739448", "0.57295275", "0.57293373", "0.5729069", "0.57253987", "0.57253987", "0.57253987", "0.57253987", "0.57253987", "0.57253987", "0.57253987", "0.57253987", "0.57253987", "0.57253987", "0.57214445", "0.57149816", "0.5712036", "0.5710076", "0.57073003", "0.5707059", "0.5705454", "0.5705454", "0.5700382", "0.56997055", "0.5693362", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868" ]
0.0
-1
Show the form for editing the specified resource.
public function edit($id) { $thematics = ThematicSG::find($id); return view('SG/Thematic/edit', array('thematic'=>$thematics)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function edit($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.edit\")) {\n $view = \"admin.{$this->name}.edit\";\n } else {\n $view = 'admin.includes.actions.edit';\n }\n\n /* Displays the edit resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }", "public function edit(NebulaResource $resource, $item): View\n {\n $this->authorize('update', $item);\n\n return view('nebula::resources.edit', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }", "public function edit() {\r\n $id = $this->api->getParam('id');\r\n\r\n if ($id) {\r\n $this->model->id = $id;\r\n $this->checkOwner();\r\n }\r\n $object = $this->model->find_by_id($id);\r\n\r\n $this->api->loadView('contact-form', array('row' => $object));\r\n }", "public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function edit()\n {\n return view('hirmvc::edit');\n }", "public function editformAction(){\n\t\t$this->loadLayout();\n $this->renderLayout();\n\t}", "public function edit() {\n $id = $this->parent->urlPathParts[2];\n // pass name and id to view\n $data = $this->parent->getModel(\"fruits\")->select(\"select * from fruit_table where id = :id\", array(\":id\"=>$id));\n $this->getView(\"header\", array(\"pagename\"=>\"about\"));\n $this->getView(\"editForm\", $data);\n $this->getView(\"footer\");\n }", "public function edit($id)\n\t{\n\t\treturn $this->showForm('update', $id);\n\t}", "public function edit($id)\n {\n $model = $this->modelObj;\n $formObj = $model::findOrFail($id);\n $data['formObj'] = $formObj;\n return view($this->veiw_base . '.edit', $data);\n }", "public function createEditForm(Resourceperson $entity){\n \n $form = $this->createForm(new ResourcepersonType(), $entity, array(\n 'action' => $this->generateUrl('rsp_update', array('id' => $entity->getRpId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update','attr'=> array(\n 'class'=>'btn btn primary'\n )));\n\n return $form;\n }", "private function createEditForm(Resource $entity)\n {\n $form = $this->createForm(new ResourceType(), $entity, array(\n 'action' => $this->generateUrl('social_admin_resource_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => '保存','attr'=>[\n 'class'=>'btn btn-primary'\n ]));\n\n return $form;\n }", "public function edit($id)\n {\n return $this->showForm('update', $id);\n }", "public function edit($id)\n {\n return $this->showForm('update', $id);\n }", "public function editAction()\n {\n if ($form = $this->processForm()) {\n if ($this->useTabbedForms && method_exists($this, 'getSubject')) {\n $data = $this->getModel()->loadFirst();\n $subject = $this->getSubject($data);\n $this->setPageTitle(sprintf($this->_('Edit %s %s'), $this->getTopic(1), $subject));\n } else {\n $this->setPageTitle(sprintf($this->_('Edit %s'), $this->getTopic(1)));\n }\n $this->html[] = $form;\n }\n }", "public function edit($id)\n {\n $this->data['entity'] = GS_Form::where('id', $id)->firstOrFail();\n return view('admin.pages.forms.edit', $this->data);\n }", "public function edit($id)\n\t{\n\t\t// get the fbf_presenca\n\t\t$fbf_presenca = FbfPresenca::find($id);\n\n\t\t\n\t\t// show the edit form and pass the fbf_presenca\n\t\t$this->layout->content = View::make('fbf_presenca.edit')\n->with('fbf_presenca', $fbf_presenca);\n\t}", "public function edit($id)\n {\n $data = $this->model->find($id);\n\n return view('admin.backends.employee.form.edit',compact('data'));\n }", "public function edit($model, $form);", "function edit() {\n\t\tglobal $tpl;\n\n\t\t$form = $this->initForm();\n\t\t$tpl->setContent($form->getHTML());\n\t}", "public function edit($id)\n\t{\n\t\t$faith = Faith::find($id);\n \n return view('faith.form')->with('faith', $faith);\n\n\t}", "public function edit(Form $form)\n {\n //\n }", "public function edit()\n { \n return view('admin.control.edit');\n }", "public function edit()\n {\n return view('common::edit');\n }", "public function edit($id)\n {\n $resource = (new AclResource())->AclResource;\n $roleResource = AclRole::where('role', $id)->get(['resource'])->toArray();\n $roleResource = Arr::pluck($roleResource, 'resource');\n return view('Admin.acl.role.form', [\n 'role' => $id,\n 'resource' => $resource,\n 'roleResource' => $roleResource,\n ]);\n }", "public function edit()\n {\n return view('admin::edit');\n }", "public function edit()\n {\n return view('admin::edit');\n }", "public function edit()\r\n {\r\n return view('petro::edit');\r\n }", "public function edit($id)\n {\n // show form edit user info\n }", "public function edit()\n {\n return view('escrow::edit');\n }", "public function edit($id)\n {\n $resource = ResourceManagement::find($id);\n\n $users = User::get();\n // Redirect to user list if updating user wasn't existed\n if ($resource == null || $resource->count() == 0) {\n return redirect()->intended('/resource-management');\n }\n\n return view('resources-mgmt/edit', ['resource' => $resource, 'users' => $users]);\n }", "public function edit()\n {\n return view('commonmodule::edit');\n }", "public function editAction()\n\t{\n\t\t$params = $this->data->getParams();\n\t\t$params = $this->valid->clearDataArr($params);\n\t\tif (isset($params['id']))\n\t\t{\n\t\t\t$this->employee->setFlag(true);\n\t\t}\n\t\tif (isset($_POST['submit']))\n\t\t{\n\t\t\t$action = $this->valid->clearDataArr($_POST);\n\t\t\t$this->employee->setDataArray($action);\n\t\t\theader('Location: ' . PATH . 'Employee/index/', true, 303);\n\t\t}\n\t\t$employee = $this->employee->setAction('edit');\n\t\t$this->view->addToReplace($employee);\n\t\t$this->listEmployee();\n\t\t$this->arrayToPrint();\n\t}", "public function edit(form $form)\n {\n //\n }", "public function edit()\n {\n return view('catalog::edit');\n }", "public function edit()\n {\n return view('catalog::edit');\n }", "public function actionEdit($id) { }", "public function edit()\n {\n return view('admincp::edit');\n }", "public function edit()\n {\n return view('scaffold::edit');\n }", "public function edit($id)\n {\n $header = \"Edit\";\n\t\t$data = Penerbit::findOrFail($id);\n\t\treturn view('admin.penerbit.form', compact('data','header'));\n }", "public function edit()\n {\n return view('Person.edit');\n }", "public function edit($id)\n {\n $data = Form::find($id);\n return view('form.edit', compact('data'));\n }", "public function edit($id)\n\t{\n\t\t$career = $this->careers->findById($id);\n\t\treturn View::make('careers._form', array('career' => $career, 'exists' => true));\n\t}", "public function edit($id, Request $request)\n {\n $formObj = $this->modelObj->find($id);\n\n if(!$formObj)\n {\n abort(404);\n } \n\n $data = array();\n $data['formObj'] = $formObj;\n $data['page_title'] = \"Edit \".$this->module;\n $data['buttonText'] = \"Update\";\n\n $data['action_url'] = $this->moduleRouteText.\".update\";\n $data['action_params'] = $formObj->id;\n $data['method'] = \"PUT\"; \n\n return view($this->moduleViewName.'.add', $data);\n }", "public function edit($id)\n\t{\n\t\t// get the material\n\t\t$material = Material::find($id);\n\n\t\t// show the edit form and pass the material\n\t\t$this->layout->content = View::make('material.edit')\n\t\t\t->with('material', $material);\n\t}", "public function edit(Flight $exercise, FlightResource $resource)\n {\n return $this->viewMake('adm.smartcars.exercise-resources.edit')\n ->with('flight', $exercise)\n ->with('resource', $resource);\n }", "public function edit()\n {\n $id = $this->getId();\n return view('panel.user.form', [\n 'user' => $this->userRepository->findById($id),\n 'method' => 'PUT',\n 'routePrefix' => 'profile',\n 'route' => 'profile.update',\n 'parameters' => [$id],\n 'breadcrumbs' => $this->getBreadcrumb('Editar')\n ]);\n }", "public function edit()\r\n {\r\n return view('mpcs::edit');\r\n }", "function edit()\n\t{\n\t\t// hien thi form sua san pham\n\t\t$id = getParameter('id');\n\t\t$product = $this->model->product->find_by_id($id);\n\t\t$this->layout->set('auth_layout');\n\t\t$this->view->load('product/edit', [\n\t\t\t'product' => $product\n\t\t]);\n\t}", "public function edit($id)\n {\n //\n $data = Diskon::find($id);\n\n $form = $this->form;\n $edit = $this->edit;\n $field = $this->field;\n $page = $this->page;\n $id = $id;\n $title = $this->title;\n return view('admin/page/'.$this->page.'/edit',compact('form','edit','data','field','page','id','title'));\n }", "public function edit($id)\n {\n return $this->showForm($id);\n }", "public function edit($id)\n {\n return $this->showForm($id);\n }", "protected function _edit(){\n\t\treturn $this->_editForm();\n\t}", "public function editAction()\n {\n $robot = Robots::findFirst($this->session->get(\"robot-id\"));\n if ($this->request->isGet()) {\n $this->tag->prependTitle(\"Редактировать робота :: \");\n $user = $this->session->get(\"auth-id\");\n if (!$robot) {\n $this->flashSession->error(\n \"Робот не найден\"\n );\n return $this->response->redirect(\"users/usershow/$user->name\");\n }\n\n }\n\n $this->view->form = new RobotForm(\n $robot,\n [\n \"edit\" => true,\n ]\n );\n }", "public function editAction()\n {\n $form = new $this->form();\n\n $request = $this->getRequest();\n $param = $this->params()->fromRoute('id', 0);\n\n $repository = $this->getEm()->getRepository($this->entity);\n $entity = $repository->find($param);\n\n if ($entity) {\n\n $form->setData($entity->toArray());\n\n if ( $request->isPost() ) {\n\n $form->setData($request->getPost());\n\n if ( $form->isValid() ) {\n\n $service = $this->getServiceLocator()->get($this->service);\n $service->update($request->getPost()->toArray());\n\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n }\n } else {\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n\n return new ViewModel(array('form' => $form, 'id' => $param));\n\n }", "public function edit($id)\n\t{\n\t\t$SysApplication = \\Javan\\Dynaflow\\Domain\\Model\\SysApplication::find($id);\n\t\t$form = \\FormBuilder::create('Javan\\Dynaflow\\FormBuilder\\SysApplicationForm', [\n \t'method' => 'POST',\n \t'url' => 'sysapplication/update/'.$id,\n \t'model' => $SysApplication,\n \t'data' => [ 'flow_id' => $SysApplication->flow_id]\n \t]);\n\t\treturn View::make('dynaflow::sysapplication.form', compact('form', 'SysApplication'));\n\t}", "public function editAction() {\n\t\t$id = (int) $this->_getParam('id');\n\t\t$modelName = $this->_getParam('model');\n\t\t\n\t\t$model = Marcel_Backoffice_Model::factory($modelName);\n\t\t$item = $model->find($id)->current();\n\t\tif (!$item) {\n\t\t\t$item = $model->createRow();\n\t\t}\n\t\t$form = $item->getForm();\n\t\tif ($this->_request->isPost()) {\n\t\t\t$newId = $form->populate($this->_request->getPost())->save();\n\t\t\tif ($newId) {\n\t\t\t\t$this->_helper->flashMessenger('Saved successfully!');\n\t\t\t\t$this->_helper->redirector('edit', null, null, array('id' => $newId, 'model' => $modelName));\n\t\t\t}\n\t\t}\n\t\t$this->view->form = $form;\n\t\t$this->view->messages = $this->_helper->flashMessenger->getMessages();\n\t}", "public function edit($id)\n {\n return view('models::edit');\n }", "public function edit()\n {\n return view('home::edit');\n }", "public function editAction()\n {\n $id = $this->params()->fromRoute('id');\n $entity = $this->entityManager->find(Entity\\CourtClosing::class, $id);\n if (! $entity) {\n // to do: deal with it\n }\n $form = $this->getForm('update');\n $form->bind($entity);\n if ($this->getRequest()->isPost()) {\n return $this->post();\n }\n\n return new ViewModel(['form' => $form]);\n }", "public function editAction($id)\n {\n $entity = $this->getManager()->find($id);\n\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem('Inicio', $this->get('router')->generate('admin.homepage'));\n $breadcrumbs->addItem($this->entityDescription, $this->get(\"router\")->generate(\"admin.$this->entityName.index\"));\n $breadcrumbs->addItem('Editar');\n\n if (!$entity) {\n throw $this->createNotFoundException('No se ha encontrado el elemento');\n }\n\n $form = $this->getForm($entity);\n\n return $this->render('AdminBundle:Default:edit.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'metadata' => $this->getMetadata()\n ));\n }", "public function edit()\n {\n return view('user::edit');\n }", "public function edit()\n {\n return view('user::edit');\n }", "public function edit(Form $form)\n {\n return view('admin.forms.edit', compact('form'));\n }", "public function editAction()\n {\n $form = MediaForm::create($this->get('form.context'), 'media');\n $media = $this->get('media_manager.manager')->findOneById($this->get('request')->get('media_id'));\n \n $form->bind($this->get('request'), $media);\n \n return $this->render('MediaManagerBundle:Admin:form.html.twig', array('form' => $form, 'media' => $media));\n }", "public function editAction($id) {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('CdlrcodeBundle:Question')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Question entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('CdlrcodeBundle:Question:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return view('consultas::edit');\n }", "public function edit(DirectorFormBuilder $form, $id)\n {\n return $form->render($id);\n }", "public function edit()\n {\n return view('dashboard::edit');\n }", "public function edit($id){\n $rfid = Rfid::find($id);\n\n //load form view\n return view('rfids.edit', ['rfid' => $rfid]);\n }", "public function edit($id)\n {\n\n // retrieve provider\n $provider = Provider::findOrFail($id);\n\n // return form with provider\n return view('backend.providers.form')->with('provider', $provider);\n }", "public function edit() {\n return view('routes::edit');\n }", "public function edit(Question $question)\n {\n $this->employeePermission('application' , 'edit');\n $question->chooses;\n $action = 'edit';\n return view('admin.setting.question_form', compact('action' , 'question'));\n }", "public function edit($id)\n {\n $this->data['product'] = Product::find($id);\n $this->data['category'] = Category::arrForSelect();\n $this->data['title'] = \" Update Prouct Details\";\n $this->data['mode'] = \"edit\";\n\n return view('product.form', $this->data);\n }", "public function edit(ClueEnFormBuilder $form, $id): Response\n {\n return $form->render($id);\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('BaseBundle:Feriado')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Feriado entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('BaseBundle:Feriado:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($articulo_id)\n {\n $titulo = \"Editar\";\n return View(\"articulos.formulario\",compact('titulo','articulo_id'));\n }", "public function edit($id)\n {\n return view('cataloguemodule::edit');\n }", "public function edit($id)\n {\n $resources = User::find(session('usuario_id'))->resources;\n $languages = Language::pluck('name', 'id');\n $types = Type::pluck('name', 'id');\n $method = 'PATCH';\n\n $recurso = Resource::find($id);\n $url = \"/resource/$recurso->id\";\n\n return view('resources.resources', compact('resources', 'languages', 'types', 'method', 'url', 'recurso'));\n }", "public function edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit]);\n }", "public function displayEditForm(Employee $employee){\n return view('employee.displayEditForm',['employee'=>$employee]);\n }", "public function edit()\n {\n return view('website::edit');\n }", "public function edit()\n {\n return view('inventory::edit');\n }", "public function edit()\n {\n return view('initializer::edit');\n }", "public function editAction()\n {\n View::renderTemplate('Profile/edit.html', [\n 'user' => $this->user\n ]);\n }", "public function edit($id)\n {\n return view('backend::edit');\n }", "public function edit($id)\n {\n return view('crm::edit');\n }", "public function edit($id)\n {\n return view('crm::edit');\n }", "public function edit($id)\n {\n //dd($id);\n $familiaPrograma= FamiliaPrograma::findOrFail($id);\n return view('familiasPrograma.edit', compact('familiaPrograma'));\n }", "public function edit($id)\n {\n $user = User::where('id', $id)->first();\n\n\n return view('users.forms.update', compact('user'));\n }", "public function editAction($id)\n\t{\n\t\t$school = School::find( $id );\n\t\t$this->render( View::make( 'schools/form' , array(\n\t\t\t'title' => sprintf( 'Modifier \"%s\"', $school->name ),\n\t\t\t'entity' => $school\n\t\t) ) );\n\t}", "public function edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit ]);\n }", "public function edit($id)\n {\n \t$product = Product::find($id);\n \treturn view('admin.products.edit')->with(compact('product')); // formulario de actualizacion de datos del producto\n }", "public function edit(Person $person) {\n\t\t$viewModel = new PersonFormViewModel();\n\t\treturn view('person.form', $viewModel);\n\t}", "public function edit_person($person_id){\n \t$person = Person::find($person_id);\n \treturn view('resource_detail._basic_info.edit',compact('person'));\n }", "public function edit($id)\n {\n $data = Restful::find($id);\n return view('restful.edit', compact('data'));\n }", "public function edit($id)\n {\n $professor = $this->repository->find($id);\n return view('admin.professores.edit',compact('professor'));\n }", "public function edit($id)\n {\n return $this->form->render('mconsole::personal.form', [\n 'item' => $this->person->query()->with('uploads')->findOrFail($id),\n ]);\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('MedecinIBundle:Fichepatient')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Fichepatient entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('MedecinIBundle:Fichepatient:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n\t{\n\t\t // get the project\n $project = Project::find($id);\n\n // show the edit form and pass the project\n return View::make('logicViews.projects.edit')->with('project', $project);\n\t}" ]
[ "0.7854417", "0.7692986", "0.72741747", "0.72416574", "0.7173436", "0.706246", "0.70551765", "0.698488", "0.6948513", "0.694731", "0.69425464", "0.6929177", "0.6902573", "0.6899662", "0.6899662", "0.6878983", "0.6865711", "0.6861037", "0.6858774", "0.6847512", "0.6836162", "0.68129057", "0.68083996", "0.68082106", "0.6803853", "0.67966306", "0.6794222", "0.6794222", "0.6789979", "0.67861426", "0.678112", "0.677748", "0.67702436", "0.67625374", "0.6748088", "0.67475355", "0.67475355", "0.67446774", "0.6742005", "0.67374676", "0.6727497", "0.6714345", "0.6696231", "0.6693851", "0.6689907", "0.6689746", "0.6687102", "0.66870165", "0.6684574", "0.6670877", "0.66705006", "0.6667089", "0.6667089", "0.6663205", "0.66626745", "0.66603845", "0.66593564", "0.66560745", "0.66545844", "0.66447026", "0.6633528", "0.66319114", "0.66298395", "0.66298395", "0.6622365", "0.6621021", "0.66170275", "0.661664", "0.6612467", "0.66107714", "0.6608453", "0.65979743", "0.659645", "0.6596389", "0.6592672", "0.6591205", "0.6588125", "0.6582166", "0.6581656", "0.65811247", "0.65785724", "0.65782833", "0.6576397", "0.6570971", "0.6569483", "0.6568432", "0.656811", "0.6563493", "0.6563493", "0.65622604", "0.65602434", "0.65585065", "0.6557997", "0.65574414", "0.6556701", "0.65565753", "0.6556226", "0.6556107", "0.6549118", "0.65485924", "0.65463555" ]
0.0
-1
Update the specified resource in storage.
public function update(Request $r, $id) { /*$this->validate($request,['type'=>'required','name'=>'required','description'=>'required','background'=>'required','snake_color'=>'required']); ThematicSG::find($id)->update($request->all()); return redirect()->route('thematic.index')->with('success','Registro actualizado satisfactoriamente');*/ $thematic = ThematicSG::find($id); if($r->hasFile('background')){ $file = $r->file('background'); $name_bg = $file->getClientOriginalName(); $file->move(public_path().'/images/imagesSG', $name_bg); } $thematic->type = $r->type; $thematic->name = $r->name; $thematic->description = $r->description; if ($r->hasFile('background')) { $thematic->background = $name_bg; } $thematic->snake_color = $r->snake_color; $thematic->save(); return redirect()->route('ThematicSG.index'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function updateShopifyResource() {\n $this->saving();\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'PUT',\n 'DATA' => [\n static::getResourceSingularName() => $this->shopifyData\n ]\n ]);\n }", "public function update(Request $request, Resource $resource)\n {\n $request->validate([\n 'name' => 'required',\n 'description' => 'required|string',\n 'file' => 'required|mimes:jpg,jpeg,png,doc,docx,pdf,ppt,txt',\n ]);\n\n $resource->update($request->all());\n\n if ( $request->hasFile('file') ) {\n $resource = 'resource-'.time().'.'.$request->file('file')->extension();\n $request->file->storeAs('resources', $resource,'public');\n $resource->file = $resource;\n }\n\n if ( $resource->save() ) {\n return redirect()->route('admin.resources.index')->with('success', 'Resource updated');\n } else {\n return redirect()->route('admin.resources.index')->with('error', 'Something went wrong');\n }\n }", "public function update(Request $request, Resource $resource)\n {\n //\n }", "public function updateStream($resource);", "public function update(Request $request, Storage $storage)\n {\n $storage->product_id = $request->product_id;\n $storage->amount = $request->amount;\n\n $storage->save();\n\n return redirect()->route('storages.index');\n }", "protected function updateImageResource($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n $this->deleteResource($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }", "public function update(Storage $storage, UpdateStorageRequest $request)\n {\n $this->storage->update($storage, $request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource updated', ['name' => trans('product::storages.title.storages')]));\n }", "public function update(StoreStorage $request, Storage $storage)\n {\n $storage->fill($request->all())->save();\n $request->session()->flash('alert-success', 'Запись успешно обновлена!');\n return redirect()->route('storage.index');\n }", "public function update_asset($id, Request $request){\n \t\tif(!Auth::user()){\n\t\t\treturn redirect('/');\n\t\t}\n \t\t$asset = Storage::find($id);\n \t\t$asset->name = $request->name;\n \t\t$asset->quantity = $request->quantity;\n \t\t$asset->category_id = $request->category;\n \t\tif($request->file('image') != null){\n\t\t\t$image = $request->file('image');\n\t\t\t$image_name = time(). \".\" . $image->getClientOriginalExtension();\n\t\t\t$destination = \"images/\";\n\t\t\t$image->move($destination, $image_name);\n\t\t\t$asset->image_url = $destination.$image_name;\n\t\t} \n\t\t$asset->save();\n\t\tsession()->flash('success_message', 'Item Updated successfully');\n\t\treturn redirect(\"/storage\");\n \t}", "public function update(Request $request, Flight $exercise, FlightResource $resource)\n {\n $request->validate([\n 'display_name' => 'required|string|max:100',\n 'file' => 'nullable|file|max:10240|mimes:pdf',\n 'uri' => 'nullable|url|max:255',\n ]);\n\n if ($resource->type === 'file' && $request->file('file')) {\n Storage::drive('public')->delete($resource->resource);\n $resource->resource = $request->file('file')->store('smartcars/exercises/resources', ['disk' => 'public']);\n } elseif ($resource->type === 'uri' && $request->input('uri')) {\n $resource->resource = $request->input('uri');\n }\n\n $resource->save();\n\n return redirect()->route('adm.smartcars.exercises.resources.index', $exercise)\n ->with('success', 'Resource edited successfully.');\n }", "public function update(Request $request, $id)\n {\n $validator = Validator::make($request->all(), [\n 'title' => 'required|string',\n 'content' => 'required|string',\n 'mentoring_area_id' => 'required|integer',\n 'featured_image_uri' => 'string',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n \n $resource = Resource::find($id);\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->featured_image_uri = $request->get('featured_image_uri');\n $resource->updated_at = \\Carbon\\Carbon::now();\n $resource->mentoring_area_id = $request->get('mentoring_area_id');\n $resource->save();\n $data['resource'] = $resource;\n return APIHandler::response(1, \"Resource has been updated\");\n }", "protected function updateVideoResource($fileName, $videoId, $storage, $premium=1)\n {\n //Get video name and storage location for video\n $video = Video::where('id', '=', $videoId)->first();\n\n //Check the storage medium\n if($storage == 'vimeo' || $storage == 'youtube')\n {\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n else\n {\n if($video['storage'] == 'local' || $video['storage'] == 's3')\n {\n //Delete old video\n $this->deleteResource($video->name, $video->storage);\n }\n \n //Store the new video\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n }", "public function put($resource, $with=[]){\n return $this->fetch($resource, self::PUT, $with);\n }", "public function update($id, $resource) {\n SCA::$logger->log(\"update resource\");\n return $this->orders_service->update($id, $resource);\n }", "public function update($path);", "public function update($id, $resource)\n {\n SCA::$logger->log(\"Entering update()\");\n //check whether it is an sdo or an xml string.\n if ($resource instanceof SDO_DataObjectImpl) {\n //if the thing received is an sdo convert it to xml\n if ($this->xml_das !== null) {\n $xml = SCA_Helper::sdoToXml($this->xml_das, $resource);\n } else {\n throw new SCA_RuntimeException(\n 'Trying to update a resource with SDO but ' .\n 'no types specified for reference'\n );\n }\n } else {\n $xml = $resource;\n }\n\n $slash_if_needed = ('/' === $this->target_url[strlen($this->target_url)-1])?'':'/';\n\n $handle = curl_init($this->target_url.$slash_if_needed.\"$id\");\n curl_setopt($handle, CURLOPT_HEADER, false);\n curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($handle, CURLOPT_CUSTOMREQUEST, \"PUT\");\n curl_setopt($handle, CURLOPT_POSTFIELDS, $xml);\n\n //replace with Content-Type: atom whatever\n $headers = array(\"User-Agent: SCA\",\n \"Content-Type: text/xml;\",\n \"Accept: text/plain\");\n curl_setopt($handle, CURLOPT_HTTPHEADER, $headers);\n\n $result = curl_exec($handle);\n\n $response_http_code = curl_getinfo($handle, CURLINFO_HTTP_CODE);\n\n curl_close($handle);\n\n $response_exception = $this->buildResponseException($response_http_code, '200');\n\n if ($response_exception != null) {\n throw $response_exception;\n } else {\n //update does not return anything in the body\n return true;\n }\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'name' => 'required',\n 'link' => 'required',\n 'description' => 'required'\n ]);\n\n $resource = Resource::find($id);\n $resource->name = $request->name;\n $resource->type_id = $request->type_id;\n $resource->has_cost = ($request->has('has_cost')) ? 1 : 0;\n $resource->language_id = $request->language_id;\n $resource->link = $request->link;\n $resource->description = $request->description;\n $resource->tags = '';\n\n $resource->save();\n //return back()->with('success', 'Recurso actualizado satisfactoriamente');\n return redirect('/resource')->with('success', 'Recurso actualizado satisfactoriamente');\n }", "public function update(Request $request, $id)\n {\n $oldProduct = Product::findOrFail($id);\n $data = $request->all();\n if(isset($data['img'])){\n // $file = $request->file('photo');\n // return $file;\n $imgName = time().'.'.$request->img->extension();\n $data['img'] = $imgName;\n // Storage::putFile('spares', $file);\n $path = $request->img->storeAs('public/uploads', $imgName); //in Storage\n\n //delete old file\n if($oldProduct->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$oldProduct->img);\n // return 'deleted';\n }\n \n }else{\n $data['img'] = $oldProduct->img;\n }\n $oldProduct->update($data);\n return redirect()->route('product.index'); \n\n }", "public function update($request, $id) {\n\t\t\t$image = $request['photo'];\n\t\t\tif($image !== null) {\n\t\t\t\t$name = time().'.' . explode('/', explode(':', substr($image, 0, strpos($image, ';')))[1])[1];\n\t\t\t\t\\Image::make($request['photo'])->save(public_path('storage/products/').$name);\n\t\t\t\t$request['photo'] = $name;\n\t\t\t} else {\n\t\t\t\t$currenPhoto = Product::all()->where('id', $id)->first();\n\t\t\t\t$request['photo'] = $currenPhoto->photo;\n\t\t\t}\n return $this->product->update($id, $request);\n\t}", "public function updateStream($path, $resource, Config $config)\n {\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function updateResourceIndex(&$resource) {\n if ($this->connector != null) {\n\n // STEP 1: Update or insert this resource as a node:\n $this->logger->addDebug(\"Updating/Inserting Node into Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} }) SET a.title = {title}, a.version = {version}, a.href = {href}\n return a;\",\n [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n );\n\n // Check to see if anything was added\n $records = $result->getRecords();\n if (empty($records)) {\n // Must create this record instead\n $result = $this->connector->run(\"CREATE (n:Resource) SET n += {infos};\",\n [\n \"infos\" => [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n ]\n );\n }\n\n // STEP 2: Update or insert the resource's link to holding repository\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} })-[r:HIRELATION]->()\n return r;\",\n [\n 'id' => $resource->getID(),\n ]\n );\n $records = $result->getRecords();\n if (!empty($records)) {\n // delete the one there so that we can add the correct one (just in case)\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}})-[r:HIRELATION]->() delete r;\",\n [\n 'id' => $resource->getID()\n ]\n );\n\n }\n\n // If resource has a repository, then add a link\n if ($resource->getRepository() != null && $resource->getRepository()->getID() != null) {\n $this->connector->run(\"MATCH (a:Identity {id: {id1} }) MATCH (b:Resource {id: {id2} }) CREATE (b)-[r:HIRELATION]->(a);\",\n [\n 'id1' => (string) $resource->getRepository()->getID(),\n 'id2' => $resource->getID()\n ]);\n }\n }\n }", "public function update($data) {}", "public function update($data) {}", "public function putStream($resource);", "public function update(Request $request, NebulaResource $resource, $item): RedirectResponse\n {\n $this->authorize('update', $item);\n\n $validated = $request->validate($resource->rules(\n $resource->editFields()\n ));\n\n $resource->updateQuery($item, $validated);\n\n $this->toast(__(':Resource updated', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function update($entity);", "public function update($entity);", "public function setResource($resource);", "public function updateStream($path, $resource, Config $config)\n {\n return $this->upload($path, $resource, $config);\n }", "public function isUpdateResource();", "public function update(Request $request, $id)\n {\n $device = Device::findOrFail($id);\n $device->fill($request->all());\n if ($request->hasFile('icon')) {\n if ($device->hasMedia('icon')) {\n $device->deleteMedia($device->getFirstMedia('icon'));\n }\n $device->addMediaFromRequest('icon')->toMediaCollection('icon');\n }\n $device->save();\n return new DeviceResource($device);\n }", "public function update(Request $request, $id)\n {\n //\n $product = Product::findOrFail($id);\n \n $product->update($request->all());\n \n $file = $request->file('url_image')->move('upload', $request->file('url_image')->getClientOriginalName());\n\n Product::where('id',$id)->update(['url_image'=>$file]);\n \n \\Session::flash('flash_message', 'Edit product successfully.'); \n \n //cũ : return redirect('articles');\n return redirect()->route('products.index');\n }", "public function store($data, Resource $resource);", "public function update(Request $request, $id)\n {\n \n $product = Product::find($id);\n\n\n $product->fill($request->all())->save();\n\n //Verificamos que tenemos una imagen\n if($request->file('photo_1')){\n\n\n //En caso de tenerla la guardamos en la clase Storage en la carpeta public en la carpeta image.\n $path = Storage::disk('public')->put('photo_1',$request->file('photo_1'));\n\n //Actualizamos el Post que acabamos de crear\n $product->fill(['photo_1' => asset($path)])->save();\n\n }\n\n\n return redirect()->route('products.index')->with('info', 'Producto actualizado exitosamente!');\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n if (\\Input::hasFile('image')) {\n $this->imgsave($request, $product);\n }\n\n\n if (!empty($request->input('tags'))) {\n $product->tags()->sync($request->input('tags'));\n } else {\n $product->tags()->detach();\n }\n\n $product->update($request->all());\n\n return redirect()->to('dashboard/product')->with('message', 'update success');\n }", "public function put($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'PUT');\n }", "public function update($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'updateValidations')) {\n $this->request->validate($this->updateValidations());\n }\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Update the specified resource */\n $resource->update(Input::all());\n\n /* Redirect back */\n return redirect()->back()\n ->with(\n 'info',\n Lang::has($this->name . '.resource-updated') ?\n $this->name . '.resource-updated' :\n 'messages.alert.resource-updated'\n );\n }", "public function update(Request $request, $id)\n\n {\n ResourceManagement::findOrFail($id);\n $constraints = [\n 'title' => 'required|max:100',\n 'url'=> 'required|max:191',\n 'content' => 'required'\n ];\n\n $input = [\n 'title' => $request['title'],\n 'url' => $request['url'],\n 'content' => $request['content'],\n 'type' => $request['type'],\n 'level' => $request['level'],\n 'user_id' => $request['user']\n ];\n// $this->validate($input, $constraints);\n ResourceManagement::where('id', $id)\n ->update($input);\n\n return redirect()->intended('/resource-management');\n }", "public function putResponse($request)\n {\n $idSearched = $this->searcher->searchResourceIndex(\n $request, \n $this->db[$request['resource']]\n );\n if ($idSearched) {\n $resource = $this->db[$request['resource']][$idSearched];\n $bodyInput = json_decode($this->standardInput, true);\n $resource = BodyRequest::canApplyBody($bodyInput);\n $resource['id'] = (int)$request['param'];\n foreach($resource as $key => $value) {\n $this->db[$request['resource']][$idSearched][$key] = $value;\n }\n file_put_contents(DB_PATH, json_encode($this->db));\n }\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'title' => 'required',\n 'description' => 'required|string',\n 'price' => 'required|numeric',\n 'reference'=>'required'\n ]);\n \n $product = Product::find($id);\n $product->update($request->all());\n \n $im = $request->file('picture');\n \n if (!empty($im)) {\n \n $link = $request->file('picture')->store('images');\n \n \n $product->update([\n 'url_image' => $link,\n ]);\n } \n //dump($request->all());\n return redirect()->route('product.index')->with('message', 'Article modifié avec succès');\n }", "public function update(Storedataset $request, dataset $dataset){\n $dataset->title = $request->input('title');\n $dataset->caption = $request->input('caption');\n $dataset->file_url = $request->input('file_url');\n $dataset->type = $request->input('type');\n $dataset->status = $request->input('status');\n $dataset->publication_id = $request->input('publication_id');\n\n $dataset->save();\n\n return redirect()->route('datasets.show', ['dataset' => $dataset]);\n }", "public function update(StoreOrUpdateAsset $request, Asset $asset)\n {\n if (Storage::exists($asset->path) && !Storage::delete($asset->path)) {\n abort(500);\n }\n\n $file = $request->file('file');\n $path = $file->store('assets');\n\n if (!$path) {\n abort(500);\n }\n\n // We wonder if we should delete the old file or not...\n\n $asset->name = $file->getClientOriginalName();\n $asset->size = $file->getSize();\n $asset->type = $file->getMimeType();\n $asset->path = $path;\n\n if ($asset->save()) {\n flash('The asset has been saved.')->success();\n } else {\n abort(500);\n }\n\n return redirect('/admin/assets');\n }", "public function update(FoodRecipeRequest $request, $id)\n {\n $foodRecipe = FoodRecipe::with('ingredients','cookingProcesses')->findOrFail($id);\n if ($request->input('name')!= null)\n $foodRecipe->name = $request->input('name');\n if ($request->input('detail')!= null)\n $foodRecipe->detail = $request->input('detail');\n if($request->file('photo') != null) {\n $old_file = $foodRecipe->photo;\n if($old_file != null){\n $path = public_path().'/storage/'.$old_file;\n File::delete($path);\n }\n $file = $request->file('photo');\n $name = '/foodRecipe/' . Carbon::now()->format(\"dnY-Hisu\") . \".\" . $file->extension();\n $file->storePubliclyAs('public', $name);\n $foodRecipe->photo = $name;\n }\n $foodRecipe->save();\n return new FoodRecipeResource($foodRecipe);\n }", "public function update(StorageTypeRequest $request, $id)\n {\n try {\n $this->service->updateStorageType($request, $id);\n return $this->NoContent();\n } catch (EntityNotFoundException $e) {\n \\Log::error($e->getMessage());\n return $this->NotFound($e->getMessage());\n } catch(\\QueryException $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n } catch(Exception $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n }\n }", "public function update(Request $request, $id)\n {\n //validation\n $this->validate(request(),[\n 'image' => 'image'\n ]);\n\n $slider = HomeSliders::find($id);\n \n $slider->link = request('link');\n\n //get old image to delete if updated\n $oldImage = request('oldImage');\n //get the new image\n $NewImage=$request->file('image');\n\n if($NewImage)\n {\n $filenameToStore= helpers::updatePhoto('image','homeSliders',$request);\n $slider->image=$filenameToStore;\n\n Storage::delete('public/Images/homeSliders/'.$oldImage);\n }\n\n $slider->save();\n\n Alert::success(config('app.name'), trans('messages.Updated Successfully') );\n return redirect()->route('admin.homeSlider',$slider->type);\n }", "public function update(Qstore $request, $id)\n {\n //\n }", "public function update(IEntity $entity);", "public function update($request, $id);", "protected function performUpdate(): bool\n {\n // Abort if resource does not support update operations\n if (!$this->isUpdatable()) {\n throw new UnsupportedOperation(sprintf('API does not support update operation for %s resources', $this->resourceNameSingular()));\n }\n\n $id = $this->id();\n $prepared = $this->prepareBeforeUpdate($this->toArray());\n\n $payload = [\n $this->resourceNameSingular() => $prepared\n ];\n\n $response = $this\n ->request()\n ->put($this->endpoint($id), $payload);\n\n // Extract and (re)populate resource (if possible)\n // Note: Unlike the \"create\" method, Redmine does NOT\n // appear to send back a full resource when it has been\n // successfully updated.\n $this->fill(\n $this->decodeSingle($response)\n );\n\n return true;\n }", "function put($resource, $data = null) {\r\n\t\t\r\n\t\tif(isset($data)) {\r\n\t\t\t$this->request_body = $data;\r\n\t\t}\r\n\r\n\t\t// make the call chief\r\n\t\t$this->exec ( \"PUT\", '/' . $resource );\r\n\r\n\t\t// check the request status\r\n\t\tif($this->status_code != 200){\r\n\t\t\t$this->Logger->error(\r\n\t\t\t\tsprintf(\r\n\t\t\t\t\t'GET Call for resource \\'%s\\' Failed.\r\n\t\t\t\t\tStatus: %d,\r\n\t\t\t\t\tRequest: %s\r\n\t\t\t\t\tAPI Error Message: \r\n\t\t\t\t\t%s',\r\n\t\t\t\t\t$resource,\r\n\t\t\t\t\t$this->status_code,\r\n\t\t\t\t\t$this->request_body_raw,\r\n\t\t\t\t\t$this->response_body\r\n\t\t\t\t)\r\n\t\t\t);\r\n\t\t\tthrow new Exception($this->response_body);\r\n\t\t} else {\r\n\t\t\treturn $this->response_parsed;\r\n\t\t}\r\n\t}", "public function updateEntities($resource)\n {\n $json = [\n 'resource' => $resource,\n ];\n $request = $this->createRequest('PUT', '/entities', ['json' => $json]);\n $response = $this->send($request);\n return $response;\n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->writeStream($path, $resource, $config);\n }", "protected function handleUpdate()\n {\n $resource = $this->argument('resource');\n $action = $this->option('action');\n $startPage = (int)$this->option('startPage');\n $perPage = (int)$this->option('perPage');\n\n try {\n $harvest = Harvest::where('resource', $resource)->where('action', $action)->firstOrFail();\n } catch (\\Exception $e) {\n $this->info('There is no existing action for updating ' . ucwords($action) . ' ' . ucwords($resource) . '.');\n exit('Nothing was updated.');\n }\n\n $options = [\n 'startPage' => $startPage,\n 'perPage' => $perPage,\n 'lastRun' => $harvest->last_run_at\n ];\n\n // If a lastRun was given use that\n // OR if this has never been run before use 2001-01-01\n if (!empty($this->option('lastRun'))) {\n $options['lastRun'] = new Carbon($this->option('lastRun'));\n } elseif (is_null($options['lastRun'])) {\n $options['lastRun'] = new Carbon('2001-01-01');\n }\n\n $job = new UpdateResourceJob(\n $harvest,\n $options\n );\n\n $message = 'Updating ' . $action . ' ' . $resource . ' ' . $perPage . ' at a time';\n if (isset($lastRun)) {\n $message .= ' with entries updated since ' . $lastRun->format('r');\n }\n $this->info($message);\n $this->dispatch($job);\n }", "public function update(Request $request, $id)\n {\n\n $product = Product::findOrFail($id);\n $product->name = $request['name'];\n $product->price = $request['price'];\n $product->stock = $request['stock'];\n $product->description = $request['description'];\n\n $file = $request->file('image');\n $fileName = $file->getClientOriginalName();\n if($fileName != $product->image){\n $request->file('image')->move('images/',$fileName);\n $product->image = $fileName;\n }\n\n $product->save();\n\n return redirect()->route('products.show',\n $product->id)->with('flash_message',\n 'Article, '. $product->name.' updated');\n }", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "abstract public function put($data);", "public function testUpdateSupplierUsingPUT()\n {\n }", "public function update(Request $request, $id)\n {\n $skill = Skill::findOrFail($id);\n\n $skill->skill = $request->skill;\n\n if ($request->hasFile('image')) {\n \\Cloudder::upload($request->file('image'));\n $c=\\Cloudder::getResult();\n // $image = $request->file('image');\n // $filename = time() . '.' . $image->getClientOriginalExtension();\n // $location = public_path('images/' . $filename);\n // Image::make($image)->save($location);\n\n $skill->image = $c['url'];\n }\n\n $skill->save();\n\n Session::flash('success', 'Successsfully updated your skill!');\n return redirect()->route('skills.index');\n }", "public function update(Request $request, $id)\n {\n $storageplace = Storageplace::findOrFail($id);\n $storageplace->update($request->only(['storageplace']));\n return $storageplace;\n }", "public function updateStream($path, $resource, Config $config = null)\n {\n $contents = stream_get_contents($resource);\n\n return $this->write($path, $contents, $config);\n }", "public function updateRelatedImage(Request $request, $id)\n {\n // Delete display image in Storage\n Validator::make($request->all(), ['photos' => \"required|file|image|mimes:jpg,png,jpeg|max:5000\"])->validate();\n\n\n if ($request->hasFile(\"photos\")) {\n\n $photo = ProductsPhoto::find($id);\n $imageName = $photo->photos;\n $exists = Storage::disk('local')->exists(\"public/product_images/\" . $photo->photos);\n\n //delete old image\n if ($exists) {\n Storage::delete('public/product_images/' . $imageName);\n }\n\n //upload new image\n $ext = $request->file('photos')->getClientOriginalExtension(); //jpg\n\n $request->photos->storeAs(\"public/product_images/\", $imageName);\n\n $arrayToUpdate = array('photos' => $imageName);\n DB::table('products_photos')->where('id', $id)->update($arrayToUpdate);\n\n return redirect()->route(\"adminDisplayRelatedImageForm\", ['id' => $photo->product_id]);\n } else {\n\n $error = \"NO Image was Selected\";\n return $error;\n }\n }", "public static function update($id, $file)\n {\n Image::delete($id);\n\n Image::save($file);\n }", "public abstract function update($object);", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n $image = $product->image;\n if($request->hasFile('image')){\n $image = $request->file('image')->store('files');\n \\Storage::delete($product->image);\n } \n $product->name = $request->get('name');\n $product->price = $request->get('price');\n $product->description = $request->get('description');\n $product->additional_info = $request->get('additional_info');\n $product->category_id = $request->get('category');\n $product->subcategory_id = $request->get('subcategory');\n $product->image = $image;\n $product->save();\n return redirect()->back();\n }", "public function update(Request $request, $id)\n {\n $sli=Slider::find($id);\n $sli->sort_order=$request->input('sort_order');\n $image = $request->file('slider');\n if($image == ''){\n $image = $sli->slider;\n }else{\n $image = base64_encode(file_get_contents($request->file('slider')));\n }\n $sli->slider = $image;\n $sli->save();\n return redirect()->back();\n }", "public function update(ProductRequest $request, $id)\n {\n $input = Product::find($id);\n $data = $request->all();\n if ($file = $request->file('product_photo')){\n $name = time().$file->getClientOriginalName();\n $file->move('product_image',$name);\n $data['product_photo']=$name;\n// $input->update($data);\n }\n $input->update($data);\n return redirect('admin/products/');\n }", "public function update(Request $request, $id)\n {\n $volume = $this->findVolume($id);\n\n if(count($volume) > 0) {\n $volume->str_volume_name = $request->str_volume_name;\n\n $volume->save();\n }\n\n return response()\n ->json(\n array(\n 'message' => 'Volume is successfully updated.',\n 'volume' => $volume\n ),\n 201\n );\n }", "public function update(Request $request, $id)\n {\n $product = ProductModel::find($id);\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->stock = $request->stock;\n\n if($request->image!=null){\n $imageName = time().'.'.$request->image->extension();\n $request->image->move(public_path('images'), $imageName);\n $product->image = \"/images/\".$imageName;\n }\n $product->save();\n return redirect(\"/products/index\")->with('success','Product has been updated');\n }", "public function update()\n {\n $accessory = Accessories::find(request('id'));\n\n if ($accessory == null) {\n return response()->json([\"error\" => \"aksesuaras nerastas\"], 404);\n }\n\n $this->validateData();\n $path = $accessory->src;\n\n if (request()->hasFile('src')) {\n\n if (Storage::disk('public')->exists($accessory->src)) {\n Storage::disk('public')->delete($accessory->src);\n }\n $path = request()->file('src')->store('accessoriesImages', 'public');\n }\n\n $accessory->update(array_merge($this->validateData(), ['src' => $path]));\n\n return response()->json([\"data\" => $accessory], 200);\n }", "public function update(ProductStoreRequest $request,$id)\n {\n $data = $request->validated();\n $product = Product::where('id',$id);\n $product->update($data);\n return response(\"Producto actualizado con éxito\",200);\n }", "public function update($entity)\n {\n \n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->write($path,stream_get_contents($resource),$config);\n }", "public function update($id, $input);", "public function update($id, Request $request)\n {\n date_default_timezone_set('Asia/Taipei');\n $data = $request->all();\n $dbData = Product::find($id);\n $myfile = Storage::disk('local');\n if ($request->hasFile('img')) {\n $file = $request->file('img');\n $path = $myfile->putFile('public', $file);\n $data['img'] = $myfile->url($path);\n File::delete(public_path($dbData->img));\n }\n $dbData->update($data);\n\n if ($request->hasFile('imgs')) {\n // $this->fetchDestroyByProdId($id);\n $localS = Storage::disk('local');\n\n $fileS = $request->file('imgs');\n $imgs = [];\n foreach ($fileS as $i) {\n $pathS = $localS->putFile('public', $i);\n $imgs[] = $localS->url($pathS);\n }\n foreach ($imgs as $img) {\n ProductImg::create([\n 'product_id' => $id,\n 'img' => $img\n ]);\n }\n }\n\n return redirect()->route('admin');\n }", "public function update(Request $request, Product $product)\n { $remfile= $product->image;\n if($request->filep){\n $product->image=$request->filep;\n File::delete(storage_path('app/public/products/'.$remfile));\n }else{\n $product->image=$remfile;\n }\n //rmdir(storage_path('app/public/products/'.$remfile));\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->save();\n sleep(3);\n toast('Details updated successfully','info');\n return redirect('/products');\n }", "public function update(ProductRequest $request,int $id): ProductResource\n {\n $attributes = $request->only('supplier_id', 'name', 'warehouses');\n\n return new ProductResource($this->productRepository->update($id, $attributes)); }", "public function update(Request $request, $id)\n {/* dd($request->all()); */\n $acheivePic = $this->acheiveRepo->find($id);\n $acheive = $request->except('_method', '_token', 'photo', 'ar', 'en');\n $acheiveTrans = $request->only('ar', 'en');\n\n if ($request->hasFile('icon')) {\n // Delete old image first.\n $oldPic = public_path() . '/images/acheives/' . $acheivePic->icon;\n File::delete($oldPic);\n\n // Save the new one.\n $image = $request->file('icon');\n $imageName = $this->upload($image, 'acheives');\n $acheive['icon'] = $imageName;\n }\n\n $this->acheiveRepo->update($id, $acheive, $acheiveTrans);\n\n return redirect('admin-panel/widgets/acheive')->with('updated', 'updated');\n }", "public function update(Request $request, $id)\n {\n $slider=new Slider;\n $slider=$slider::find($id);\n \n \n if($file =$request->file('slider')){\n if(Storage::delete('public/slider/'.$slider->slider)){\n\n //Get file original name//\n \n$original_name=$file->getClientOriginalName();\n\n //Get just the file name\n$filename=pathinfo($original_name,PATHINFO_FILENAME);\n\n//Create new file name\n$name=$filename.'_'.time().'.'.$file->getClientOriginalExtension();\n\n $destination='public/slider';\n $path=$request->slider->storeAs($destination,$name);\n $slider->slider=$name;\n $slider->save();\n return redirect('Admin/slider');\n\n }\n }\n}", "public function update(Request $request, $id)\n {\n $data = $request->all();\n extract($data);\n\n $productVarient = new ProductVariant();\n $productVarient = $productVarient->find($id);\n $productVarient->vendor_id = auth()->user()->id;\n $productVarient->description = $prod_desc;\n $productVarient->price = $price;\n\n if(request()->hasFile('photo')){\n $image = request()->file('photo')->getClientOriginalName();\n $imageNewName = auth()->user()->id.'-'.$image;\n $file = request()->file('photo');\n $file->storeAs('images/product',$imageNewName, ['disk' => 'public']);\n $productVarient->image = $imageNewName;\n }\n \n $productVarient->save();\n\n return back()->withStatus(__('Product successfully updated.'));\n }", "public function update(Request $request, $id)\n {\n //if upload new image, delete old image\n $myfile=$request->old_photo;\n if($request->hasfile('photo'))\n {\n $imageName=time().'.'.$request->photo->extension();\n $name=$request->old_photo;\n\n if(file_exists(public_path($name))){\n unlink(public_path($name));\n $request->photo->move(public_path('backendtemplate/truefalseimg'),$imageName);\n $myfile='backendtemplate/truefalseimg/'.$imageName;\n }\n }\n //Update Data\n $truefalsequestion=TrueFalseQuestion::find($id);\n $truefalsequestion->name=$request->name;\n $truefalsequestion->photo=$myfile;\n $truefalsequestion->answer = $request->answer;\n $truefalsequestion->question_id = $request->question;\n $truefalsequestion->save();\n\n //Redirect\n return redirect()->route('truefalsequestions.index'); \n }", "public function update($id);", "public function update($id);", "public function update(Request $request, $id)\n {\n $request->validate([\n 'path_image'=>'image',\n 'status'=>'required|in:0,1'\n ]);\n $slider=Slider::whereId($id)->first();\n if (is_null($slider)){\n return redirect()->route('sliders.index')->with('error','Slider does not exist');\n }\n try {\n if ($request->hasFile('path_image')){\n $file = $request->file('path_image');\n\n $image_path= $file->store('/sliders',[\n 'disk'=>'uploads'\n ]);\n Storage::disk('uploads')->delete($slider->image);\n\n $request->merge([\n 'image'=>$image_path,\n ]);\n }\n\n $slider->update( $request->only(['status','image']));\n return redirect()->route('sliders.index')->with('success','Updated successful');\n }catch (\\Exception $exception){\n return redirect()->route('sliders.index')->with(['error'=>'Something error try again']);\n\n }\n }", "public function update() {\n $this->accessory->update($this->accessory_params());\n\n if ($this->accessory->is_valid()) {\n $this->update_accessory_image($this->accessory);\n redirect('/backend/accessories', ['notice' => 'Successfully updated.']);\n } else {\n redirect(\n '/backend/accessories/edit',\n ['error' => $this->accessory->errors_as_string()],\n ['id' => $this->accessory->id]\n );\n }\n }", "public function put($path, $data = null);", "private function update()\n {\n $this->data = $this->updateData($this->data, $this->actions);\n $this->actions = [];\n }", "public function update(Entity $entity);", "public function update(Request $request, $id)\n {\n $icon = SliderIcon::find($id);\n $data = $request->all();\n $data['active'] = $request->has('active') ? 1 : 0;\n if ($request->hasFile('img')) {\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $image = $request->file('img');\n $fileName = time().'_'.Str::lower(Str::random(5)).'.'.$image->getClientOriginalExtension();\n $path_to = '/upload/images/'.getfolderName();\n $image->storeAs('public'.$path_to, $fileName);\n $data['img'] = 'storage'.$path_to.'/'.$fileName;\n }\n $icon->update($data);\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества обнавлены');\n }", "public function update() {\n\t $this->layout = false;\n\t \n\t //set default response\n\t $response = array('status'=>'failed', 'message'=>'HTTP method not allowed');\n\t \n\t //check if HTTP method is PUT\n\t if($this->request->is('put')){\n\t //get data from request object\n\t $data = $this->request->input('json_decode', true);\n\t if (empty($data)) {\n\t $data = $this->request->data;\n\t }\n\t \n\t //check if product ID was provided\n\t if (!empty($data['id'])) {\n\t \n\t //set the product ID to update\n\t $this->Player->id = $data['id'];\n\t if ($this->Player->save($data)) {\n\t $response = array('status'=>'success','message'=>'Product successfully updated');\n\t } else {\n\t $response['message'] = \"Failed to update product\";\n\t }\n\t } else {\n\t $response['message'] = 'Please provide product ID';\n\t }\n\t }\n\t \n\t $this->response->type('application/json');\n\t $this->response->body(json_encode($response));\n\n\t return $this->response->send();\n\t}", "public function update(Request $request, $id)\n {\n //validate incoming request\n $request->validate([\n 'name' => 'string|max:100|nullable',\n 'picture' => 'max:2000|mimes:jpeg,jpg,png,svg|nullable', //max size 2mb,\n 'total' => 'integer|min:0|nullable', //value must be > 0\n 'selling_price' => 'numeric|min:0|nullable',\n 'cost_price' => 'numeric|min:0|nullable',\n 'category_id' => 'integer|nullable'\n ]);\n\n try {\n $product = Auth::user()->store->product()->findorFail($id);\n } catch (ModelNotFoundException $e) {\n return response()->json([\n \"message\" => \"Forbidden\"\n ], 403);\n }\n\n //if category id isnt null\n if ($category_id = $request->category_id) {\n if (!$this->isCategoryIdValid($category_id))\n return response()->json([\n \"message\" => \"Category Id is not valid\"\n ], 422);\n else\n $product->category_id = $request->category_id;\n }\n\n //if uploaded file exist\n if ($picture = $request->file(\"picture\")) {\n //if product already has logo\n if ($product->picture)\n Storage::delete(Product::$PICTURE_PATH . \"/\" . $product->picture);\n\n $picture_path = $picture->store(Product::$PICTURE_PATH);\n //remove folder name from path\n $product->picture = str_replace(Product::$PICTURE_PATH . \"/\", '', $picture_path);\n }\n\n $this->renewProduct($product, $request);\n $product->save();\n return response()->json(new ProductResource($product), 200);\n }", "public function update(Request $request, $id)\n {\n $request->validate([\n 'name' => 'required | min:3 | string',\n 'type' => 'required',\n 'producer' => 'required',\n 'image' => 'image | mimes:png,jpg,jpeg',\n 'price_input' => 'required | numeric | min:0 | max:300000000',\n 'promotion_price' => 'required | numeric | max:300000000',\n 'description' => 'required | string',\n\n ]);\n $product = Product::withTrashed()->findOrfail($id);\n $product->name = $request->name;\n $product->id_type = $request->type;\n $product->id_producer = $request->producer;\n\n $product->amount = $request->amount;\n if (request('image')) {\n $product->image = base64_encode(file_get_contents($request->file('image')->getRealPath()));\n }\n\n $product->price_input = $request->price_input;\n\n if ( $request->promotion_price >= 0 && $request->promotion_price < $product->price_input) {\n $product->promotion_price = $request->promotion_price;\n }else{\n return back()->with('error', '\n Do not enter a negative number');\n }\n $product->new = $request->new;\n\n $product->description = $request->description;\n\n $product->save();\n $product->size()->sync(request('size'));\n\n return redirect()->route('product.index')->with('success', 'Product Updated successfully');\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n $product->name = $request->input('name');\n $product->description = $request->input('description');\n $product->lastPrice = $product->price !== $request->input('price') ? $product->price : NULL;\n $product->price = $request->input('price');\n\n if ($request->hasFile('image')) { \n $currentImg = $product->image;\n if ($currentImg) {\n Storage::delete('/public/' . $currentImg);\n }\n $image = $request->file('image'); \n $path = $image->store('images','public');\n $product->image = $path;\n };\n\n $product->save(); \n\n $product_promotions = $request->input('promotion');\n\n $product->promotions()->sync($product_promotions);\n\n return redirect()->route('admin.modify');\n }", "public static function updateImage($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n ResourceHandler::delete($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }", "public function update($request, $id)\n {\n $this->checkExits($id);\n $data = $request->except(['_method','_token','photo']);\n\n if($request->photo)\n {\n try {\n $this->UploadFile($request);\n } catch (\\Exception $e) {\n //if has exception , don't has action\n }\n if ($this->img !== '') {\n $data['img'] = $this->img;\n }\n }\n\n $this->object->update($data);\n\n }", "public function updateProduct($request, $product)\n {\n $product->update($request->except(['_token', '_method', 'image']));\n if ($request->hasFile('image')) {\n $image = $request->file('image');\n $imageName = time() . '.' . $request->file('image')->extension();\n // $img = Image::make('public/foo.jpg');\n\n $image_resize = Image::make($image->getRealPath());\n $image_resize->resize(500, 500);\n $image_resize->save(public_path('images/') . $imageName, 100);\n $product->gallery = $imageName;\n $product->save();\n }\n $product->getTags()->sync($request->input('tags'));\n }" ]
[ "0.7424714", "0.70635", "0.7058482", "0.68981785", "0.6581708", "0.6451537", "0.634705", "0.62108016", "0.61452574", "0.61245036", "0.6117", "0.61005783", "0.6088965", "0.6055291", "0.6020192", "0.60089755", "0.5974869", "0.594607", "0.5940399", "0.5940387", "0.5893692", "0.5861878", "0.58555347", "0.58555347", "0.58521295", "0.5816296", "0.580588", "0.5754183", "0.5754183", "0.573585", "0.57248604", "0.57152486", "0.5696124", "0.56926364", "0.5686974", "0.56704843", "0.5657175", "0.5652319", "0.56505626", "0.56371164", "0.5636333", "0.5634292", "0.5633077", "0.56302124", "0.56226414", "0.5608414", "0.56038505", "0.55932486", "0.55845344", "0.55840373", "0.5583145", "0.55769825", "0.5572918", "0.5568501", "0.55649704", "0.5564084", "0.5562276", "0.5562276", "0.5562276", "0.5562276", "0.5562276", "0.5560055", "0.5556887", "0.5555794", "0.5555651", "0.55555624", "0.55542725", "0.5545186", "0.5545042", "0.554096", "0.5540548", "0.5537395", "0.55360836", "0.55359083", "0.55250585", "0.55194676", "0.55176675", "0.5514794", "0.55101085", "0.5510089", "0.5507262", "0.5504258", "0.55022335", "0.5501283", "0.5500848", "0.5499872", "0.5497986", "0.5497986", "0.5495836", "0.54956913", "0.5494868", "0.5494812", "0.5493479", "0.5484617", "0.54805785", "0.54803264", "0.54791373", "0.546626", "0.54649556", "0.5463194", "0.54580057" ]
0.0
-1
Remove the specified resource from storage.
public function destroy($id) { /*ThematicSG::find($id)->delete(); return redirect()->route('thematic.index')->with('success','Registro eliminado satisfactoriamente'); */ $thematic = ThematicSG::find($id); $thematic->delete(); return redirect()->route('ThematicSG.index'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function delete($resource){\n return $this->fetch($resource, self::DELETE);\n }", "public function destroy(Resource $resource)\n {\n //\n }", "public function removeResource($resourceID)\n\t\t{\n\t\t}", "public function unpublishResource(PersistentResource $resource)\n {\n $client = $this->getClient($this->name, $this->options);\n try {\n $client->delete(Path::fromString($this->getRelativePublicationPathAndFilename($resource)));\n } catch (FileDoesNotExistsException $exception) {\n }\n }", "public function deleteResource(&$resource) {\n\n if ($this->connector != null) {\n $this->logger->addDebug(\"Deleting Resource Node from Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}}) detach delete a;\",\n [\n 'id' => $resource->getID()\n ]\n );\n $this->logger->addDebug(\"Updated neo4j to remove resource\");\n }\n\n }", "public function deleteShopifyResource() {\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'DELETE',\n ]);\n }", "public function deleteResource()\n {\n $database = new Database();\n $id = $this->_params['id'];\n $database->deleteResource($id);\n $this->_f3->reroute('/Admin');\n }", "protected function deleteResource($fileName, $storage)\n {\n if (Storage::disk($storage)->exists($fileName)) \n {\n return Storage::disk($storage)->delete($fileName);\n }\n }", "public function delete()\n {\n persistableCollection::getInstance($this->resourceName)->deleteObject($this);\n }", "public function remove()\n {\n $this->_getBackend()->remove($this->_id);\n }", "public function remove()\n {\n if (! ftruncate($this->fileHandle, 0)) {\n throw new StorageException(\"Could not truncate $this->path\");\n }\n if (! unlink($this->path)) {\n throw new StorageException(\"Could not delete $this->path\");\n }\n }", "public function delete()\n\t{\n\t\t$s3 = AWS::createClient('s3');\n $s3->deleteObject(\n array(\n 'Bucket' => $this->bucket,\n 'Key' => $this->location\n )\n );\n\t\tif($this->local_file && file_exists($this->local_file)) {\n\t\t\tunlink($this->local_file);\n\t\t}\n $this->local_file = null;\n\t}", "public function delete()\n\t{\n\t\tsfCore::db->query(\"DELETE FROM `swoosh_file_storage` WHERE `id`='%i';\", $this->id);\n\t\t$this->fFile->delete();\n\t}", "public function delete(): void\n {\n unlink($this->getPath());\n }", "public function delete()\n {\n if($this->exists())\n unlink($this->getPath());\n }", "public function remove($path);", "function deleteFileFromStorage($path)\n{\n unlink(public_path($path));\n}", "public function delete(): void\n {\n unlink($this->path);\n }", "private function destroyResource(DrydockResource $resource) {\n $blueprint = $resource->getBlueprint();\n $blueprint->destroyResource($resource);\n\n $resource\n ->setStatus(DrydockResourceStatus::STATUS_DESTROYED)\n ->save();\n }", "public static function delete($fileName, $storage)\n {\n if (Storage::disk($storage)->exists($fileName)) \n {\n return Storage::disk($storage)->delete($fileName);\n }\n }", "public function remove() {}", "public function remove() {}", "public function remove();", "public function remove();", "public function remove();", "public function remove();", "function delete_resource($resource_id, $page)\n\t{\n\t\t//get resource data\n\t\t$table = \"resource\";\n\t\t$where = \"resource_id = \".$resource_id;\n\t\t\n\t\t$this->db->where($where);\n\t\t$resource_query = $this->db->get($table);\n\t\t$resource_row = $resource_query->row();\n\t\t$resource_path = $this->resource_path;\n\t\t\n\t\t$image_name = $resource_row->resource_image_name;\n\t\t\n\t\t//delete any other uploaded image\n\t\t$this->file_model->delete_file($resource_path.\"\\\\\".$image_name, $this->resource_path);\n\t\t\n\t\t//delete any other uploaded thumbnail\n\t\t$this->file_model->delete_file($resource_path.\"\\\\thumbnail_\".$image_name, $this->resource_path);\n\t\t\n\t\tif($this->resource_model->delete_resource($resource_id))\n\t\t{\n\t\t\t$this->session->set_userdata('success_message', 'resource has been deleted');\n\t\t}\n\t\t\n\t\telse\n\t\t{\n\t\t\t$this->session->set_userdata('error_message', 'resource could not be deleted');\n\t\t}\n\t\tredirect('resource/'.$page);\n\t}", "public function deleteImage(){\n\n\n Storage::delete($this->image);\n }", "public function del(string $resource): bool|string\n {\n $json = false;\n $fs = unserialize($_SESSION['rfe'][$this->getRoot()], ['allowed_classes' => false]);\n if (array_key_exists($resource, $fs)) {\n // if $item has children, delete all children too\n if (array_key_exists('dir', $fs[$resource])) {\n foreach ($fs as $key => $file) {\n if (isset($file['parId']) && $file['parId'] == $resource) {\n unset($fs[$key]);\n }\n }\n }\n unset($fs[$resource]);\n $_SESSION['rfe'][$this->getRoot()] = serialize($fs);\n $json = '[{\"msg\": \"item deleted\"}]';\n }\n return $json;\n }", "public function destroy()\n\t{\n\t\treturn unlink(self::filepath($this->name));\n\t}", "public function destroy($id) {\n $book = Book::find($id);\n // return unlink(storage_path(\"public/featured_images/\".$book->featured_image));\n Storage::delete(\"public/featured_images/\" . $book->featured_image);\n if ($book->delete()) {\n return $book;\n }\n\n }", "public function destroy($id)\n {\n Storageplace::findOrFail($id)->delete();\n }", "public function destroyResourceImage(): void\n\t{\n\t\tif (isset($this->image)) {\n\t\t\t@imagedestroy($this->image->getImageResource());\n\t\t}\n\t}", "public function deleteResource(PersistentResource $resource)\n {\n $pathAndFilename = $this->getStoragePathAndFilenameByHash($resource->getSha1());\n if (!file_exists($pathAndFilename)) {\n return true;\n }\n if (unlink($pathAndFilename) === false) {\n return false;\n }\n Files::removeEmptyDirectoriesOnPath(dirname($pathAndFilename));\n return true;\n }", "public function deleteImage(){\n \tStorage::delete($this->image);\n }", "public function destroy()\n {\n $file=public_path(config('larapages.media.folder')).Input::all()['folder'].'/'.Input::all()['file'];\n if (!file_exists($file)) die('File not found '.$file);\n unlink($file);\n }", "public function delete() \r\n {\r\n if($this->exists())\r\n {\r\n unlink($this->fullName());\r\n }\r\n }", "public function destroy($id)\n {\n Myfile::find($id)->delete();\n }", "public function destroy($delete = false)\n {\n if (null !== $this->resource) {\n $this->resource->clear();\n $this->resource->destroy();\n }\n\n $this->resource = null;\n clearstatcache();\n\n // If the $delete flag is passed, delete the image file.\n if (($delete) && file_exists($this->name)) {\n unlink($this->name);\n }\n }", "public static function delete($path){\r\n $currentDir = getcwd();\r\n $storageSubPath = \"/../../\".STORAGE_PATH;\r\n $file = $currentDir . $storageSubPath . '/' . $path;\r\n\r\n unlink($file);\r\n }", "public function destroy(Storage $storage)\n {\n return redirect()->route('storages.index');\n }", "public function remove() {\n //Check if there are thumbs and delete files and db\n foreach ($this->thumbs()->get() as $thumb) {\n $thumb->remove();\n } \n //Delete the attachable itself only if is not default\n if (strpos($this->url, '/defaults/') === false) {\n Storage::disk('public')->delete($this->getPath());\n }\n parent::delete(); //Remove db record\n }", "public function removeFile($uri){\n return Storage::disk('public')->delete($uri);\n }", "public function destroy(Resource $resource)\n {\n if( $resource->delete() ){\n return Response(['status'=>'success','message'=>'Resource deleted']); \n } else {\n return Response(['status'=>'error', 'message'=>'Something went wrong']);\n }\n }", "public function delete($path);", "public function delete($path);", "public function destroy($id)\n { \n File::find($id)->remove();\n \n return redirect()->route('files.index');\n }", "public function destroy($id)\n {\n $supplier = Supplier::find($id);\n $photo = $supplier->photo;\n if ($photo) {\n unlink($photo);\n }\n $supplier->delete();\n }", "public function destroy($id)\n {\n $student = Student::where('id', $id)->first();\n // $path = $student->image;\n unlink($student->image);\n Student::findOrFail($id)->delete();\n return response('Deleted!');\n }", "public function destroy($id)\n {\n $icon = SliderIcon::find($id);\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $icon->delete();\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества удалёны');\n }", "public function delete($path, $data = null);", "public function destroy($id)\n {\n $items=Items::find($id);\n // delete old file\n if ($items->photo) {\n $str=$items->photo;\n $pos = strpos($str,'/',1);\n $str = substr($str, $pos);\n $oldFile = storage_path('app\\public').$str;\n File::Delete($oldFile); \n }\n $items->delete();\n return redirect()->route('items.index');\n }", "public function destroy($id)\n {\n $carousel = Carousel::find($id);\n $image = $carousel->image;\n\n $basename ='img/carousel/' . basename($image);\n //Delete the file from disk\n if(file_exists($basename)){\n unlink($basename);\n }\n //With softDeletes, this is the way to permanently delete a record\n $carousel->delete();\n Session::flash('success','Product deleted permanently');\n return redirect()->back();\n }", "public function remove()\n {\n $fs = new Filesystem();\n $fs->remove($this->dir());\n }", "public static function destroy(int $resource_id)\n {\n try {\n $image_data = ListingImage::where('id', $resource_id)->first();\n self::delete_image($image_data->name);\n $delete = ListingImage::where('id', $resource_id)->delete();\n\n // activity()\n // ->causedBy(Auth::user()->id)\n // ->performedOn($delete)\n // ->withProperties(['id' => $delete->id])\n // ->log('listing image deleted');\n return response()->json(['status'=> 'ok', 'msg'=> 'Data deleted successfully']);\n } catch (Exception $e) {\n $e->getMessage();\n }\n }", "public function destroy(Storage $storage)\n {\n $this->storage->destroy($storage);\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource deleted', ['name' => trans('product::storages.title.storages')]));\n }", "public function del($path){\n\t\treturn $this->remove($path);\n\t}", "public function destroy($id)\n {\n //\n $product = Product::findOrFail($id);\n $product->delete();\n if($product->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$product->img);\n // return 'deleted';\n }\n return redirect()->route('product.index'); \n }", "public function removeUpload()\n{\n if ($file = $this->getAbsolutePath()) {\n unlink($file); \n }\n}", "public function destroy($id)\n {\n $image = Images::withTrashed()->find($id);\n\n Storage::disk('uploads')->delete(\"social-media/$image->filename\");\n\n $image->tags()->detach();\n $image->detachMedia(config('constants.media_tags'));\n $image->forceDelete();\n\n return redirect()->back()->with('success', 'The image was successfully deleted');\n }", "public function destroyByResourceId($resource_id)\n {\n// $online_party = $this->onlinetrack->where('resource_id', $resource_id)->get()->first();\n// $online_party->status = \"offline\";\n// $online_party->save();\n// return $online_party;\n return $this->onlinetrack->where('resource_id', $resource_id)->delete();\n }", "public function revoke($resource, $permission = null);", "public function destroy($id)\n {\n $data=Image::find($id);\n $image = $data->img;\n\n\n $filepath= public_path('images/');\n $imagepath = $filepath.$image;\n\n //dd($old_image);\n if (file_exists($imagepath)) {\n @unlink($imagepath);\n }\n\n\n $data->delete();\n\n return redirect()->route('image.index');\n }", "function delete($path);", "public function removeItem(int $id)\n\t{\n\t\t$this->storage->remove($id);\n\t}", "public function destroy(File $file)\n {\n //\n $v = Storage::delete($file->path);\n \n }", "public function destroyResource($resource)\n {\n if (!is_object($resource)) {\n return false;\n }\n\n $resource_type = get_class($resource);\n $resource_id = $resource->getKey();\n\n return Role::where('resource_type', $resource_type)\n ->where('resource_id', $resource_id)\n ->delete();\n }", "public function remove($filePath){\n return Storage::delete($filePath);\n }", "public function remove(): void\n {\n $file = $this->getAbsolutePath();\n if (!is_file($file) || !file_exists($file)) {\n return;\n }\n\n unlink($file);\n }", "public function destroy(Request $request, Storage $storage)\n {\n $storage->delete();\n $request->session()->flash('alert-success', 'Запись успешно удалена!');\n return redirect()->route('storage.index');\n }", "public function remove(Storable $entity): Storable\n {\n $this->getRepository(get_class($entity))->remove($entity);\n $this->detach($entity);\n\n return $entity;\n }", "public function processDeletedResource(EntityResource $resource)\n {\n /** @var AuthorizationRepository $repository */\n $repository = $this->entityManager->getRepository('Edweld\\AclBundle\\Entity\\Authorization');\n\n $repository->removeAuthorizationsForResource($resource);\n }", "function _unlink($resource, $exp_time = null)\n {\n if(file_exists($resource)) {\n return parent::_unlink($resource, $exp_time);\n }\n\n // file wasn't found, so it must be gone.\n return true;\n }", "public function remove($id);", "public function remove($id);", "public function deleted(Storage $storage)\n {\n //\n }", "public function destroy($id)\n {\n $data = Product::findOrFail($id);\n\n if(file_exists('uploads/product/'.$data->image1)){\n unlink('uploads/product/'.$data->image1);\n }\n\n if(file_exists('uploads/product/'.$data->image2)){\n unlink('uploads/product/'.$data->image2);\n }\n\n if(file_exists('uploads/product/'.$data->image3)){\n unlink('uploads/product/'.$data->image3);\n }\n $data->delete();\n }", "public function removeUpload()\n {\n $file = $this->getAbsolutePath();\n if ($file) {\n unlink($file);\n }\n }", "public function resources_delete($resource_id, Request $request) {\n if ($resource_id) {\n $resp = Resources::where('id', '=', $resource_id)->delete();\n if($resp){\n $msg = 'Resource has been deleted successfully.';\n $request->session()->flash('message', $msg);\n }\n }\n //return redirect()->route('admin-factor-list');\n return redirect()->to($_SERVER['HTTP_REFERER']);\n }", "public function delete()\n {\n try\n {\n $thumbnail = $this->getThumbnail();\n if($thumbnail)\n {\n $thumbnail->delete();\n }\n }\n catch(sfException $e){}\n \n // delete current file\n parent::delete();\n }", "function deleteResource($uuid){\n $data = callAPI(\"DELETE\",\"/urest/v1/resource/\".$uuid);\n return $data;\n}", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function remove_resource($idproject){\n\t\t\n\t\t// Load model and try to get project data\n\t\t$this->load->model('Projects_model', 'projects');\n\t\t\n\t\t// Update\n\t\t$this->projects->save_project(array(\"ext\" => \"\", \"vzaar_idvideo\" => \"0\", \"vzaar_processed\" => \"0\"), $idproject);\n\t}", "public function destroy($id){\n $file_data = Slider::findOrFail($id);\n File::delete(public_path('../storage/app/public/sliders/'.$file_data->path));\n $slider = Slider::destroy($id);\n return response()->json(null, 204);\n }", "public function delete()\n\t{\n\t\t@unlink($this->get_filepath());\n\t\t@unlink($this->get_filepath(true));\n\t\tparent::delete();\n\t}", "public function delete($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'DELETE');\n }", "public function destroy($id)\n {\n //Find Slider With Id\n $slider = Slider::findOrFail($id);\n // Check If The Image Exist\n if(file_exists('uploads/slider/'.$slider->image)){\n\n unlink( 'uploads/slider/'.$slider->image);\n }\n $slider->delete();\n return redirect()->back()->with('success','Slider Successfully Deleted');\n }" ]
[ "0.6672584", "0.6659381", "0.6635911", "0.6632799", "0.6626075", "0.65424126", "0.65416265", "0.64648265", "0.62882507", "0.6175931", "0.6129922", "0.60893893", "0.6054415", "0.60428125", "0.60064924", "0.59337646", "0.5930772", "0.59199584", "0.5919811", "0.5904504", "0.5897263", "0.58962846", "0.58951396", "0.58951396", "0.58951396", "0.58951396", "0.5880124", "0.58690923", "0.5863659", "0.5809161", "0.57735413", "0.5760811", "0.5753559", "0.57492644", "0.5741712", "0.57334286", "0.5726379", "0.57144034", "0.57096", "0.5707689", "0.5705895", "0.5705634", "0.5703902", "0.5696585", "0.5684331", "0.5684331", "0.56780374", "0.5677111", "0.5657287", "0.5648262", "0.5648085", "0.5648012", "0.5640759", "0.5637738", "0.5629985", "0.5619264", "0.56167465", "0.5606877", "0.56021434", "0.5601949", "0.55992156", "0.5598557", "0.55897516", "0.5581397", "0.5566926", "0.5566796", "0.55642897", "0.55641", "0.5556583", "0.5556536", "0.5550097", "0.5543172", "0.55422723", "0.5540013", "0.5540013", "0.55371785", "0.55365825", "0.55300397", "0.552969", "0.55275744", "0.55272335", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.5525997", "0.5525624", "0.5523911", "0.5521122", "0.5517412" ]
0.0
-1
Template laden und ausgeben
public function loadTemplate(){ $tpl = $this->template; $file = $this->path . DIRECTORY_SEPARATOR . $tpl . '.tmpl.php'; $exists = file_exists($file); // Wenn Template vorhanden if( $exists ){ ob_start(); include $file; $output = ob_get_contents(); ob_end_clean(); return $output; }else{ return 'Datei nicht gefunden!'; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function template();", "protected function content_template() {}", "protected function content_template() {}", "protected function content_template()\n {\n }", "protected function content_template()\n {\n }", "protected function content_template()\n {\n }", "protected function content_template()\n {\n }", "protected function content_template()\n {\n }", "protected function content_template()\n {\n }", "public function content_template()\n {\n }", "public function content_template()\n {\n }", "public function content_template()\n {\n }", "public function content_template()\n {\n }", "public function content_template()\n {\n }", "public function content_template()\n {\n }", "public function content_template()\n {\n }", "public function content_template()\n {\n }", "public function content_template()\n {\n }", "public function content_template()\n {\n }", "public function renderTemplate();", "public function initTemplate() {}", "protected function content_template() {\n\t}", "protected function content_template()\n\t{\n\t\t//\n\t}", "protected function _content_template()\n {\n\n }", "protected function setupTemplate() {\r\n \r\n }", "protected function _content_template() {\n \n }", "protected function _content_template() {\n\t}", "public function forTemplate() {\n\t\treturn; \n\t}", "public function get_template()\n {\n }", "public function get_template()\n {\n }", "public function getTemplate() {}", "public function loadTemplate()\n\t\t{\n\t\t}", "abstract public function getTemplate();", "protected function render_template()\n {\n }", "protected function render_template()\n {\n }", "protected function render_template()\n {\n }", "protected function render_template()\n {\n }", "public function getTemplate();", "public function getTemplate();", "public function getTemplate();", "public function getTemplate();", "public function getTemplate();", "public function getTemplate();", "function get_template()\n {\n }", "function getTemplate();", "public function tempalte()\n \t{\n \t\t$this->load->template('index-1');\n \t}", "public function getHtmlTemplate() {}", "protected function _content_template() { // phpcs:ignore PSR2.Methods.MethodDeclaration.Underscore \n\t\t$this->content_template();\n\t}", "public function print_template()\n {\n }", "public function print_template()\n {\n }", "public function ClassTemplate(){\n\t\t$this->template = new Template;\n\t}", "protected function _content_template() { // phpcs:ignore PSR2.Methods.MethodDeclaration.Underscore\n\t\t$this->content_template();\n\t}", "function Template()\r\n\t{\r\n\t\t$this->out = \"\";\r\n\t\t$this->objs = array();\r\n\t\t$this->vars = array();\r\n\t\t$this->data = &$data;\r\n\t\t$this->use_getvar = false;\r\n\t}", "function index()\n {\n //call some deafaults not to spoil template\n $data=$this->default_data();\n $this->template($data);\n\n }", "public function plantilla(){\n\n include \"views/template.php\";#include(): Se utiliza para invocar el archivo que contiene el código html (es decir, incluye el template que está en la carpeta views)\n }", "public function getTemplate(): string;", "public function getTemplate(): string;", "public function getTemplate(): string;", "public function getTemplate(): string;", "protected function _parseTemplate() {}", "abstract protected function template(): string;", "protected function template() {\n\t\treturn '';\n\t}", "public function getViewTemplate();", "public function template()\n {\n\n include './views/template.php';\n\n }", "public function showTemplate(){\n\t\tinclude \"view/template.php\";\n\t}", "public function getGathercontentTemplate();", "protected function initTemplate()\n {\n /** @var WorldState $state */\n /** @var ExecHelper $exec */\n $tplPhp = <<<EOS\nWorld. From: <?=\\$state->name?>\n\nExec URL: <?=\\$exec->url( 'someExec', ['a'=>1] )?><?php \\$formBody = \"<input type=\\\"text\\\" name=\\\"someInput\\\" value=\\\"2\\\">\\n\"?>\n\nExec Form:\n<?=\\$exec->wrapForm( 'otherExec', 'POST', \\$formBody ) ?>\nEOS;\n $this->template = new PhpTemplate( $this, null, $tplPhp );\n }", "function template($template=\"simple\"){\n\n\t\t// THE PHYSICAL TEMPLATE SHOULD BE IN THE RESPECTIVE \n\t\t// TEMPLATE/TYPE/$template.php\n\t\t$this->template = $template;\n\t}", "public final function print_template()\n {\n }", "private function prepareTemplate() {\r\n $template = $this->iTemplateFactory->createTemplate();\r\n $template->_control = $this->linkGenerator;\r\n $this->setTemplate($template);\r\n }", "protected function getDocumentTemplate() {}", "protected function getDocumentTemplate() {}", "protected function getDocumentTemplate() {}", "protected function getDocumentTemplate() {}", "protected function getDocumentTemplate() {}", "protected function getDocumentTemplate() {}", "protected function getDocumentTemplate() {}", "protected function getDocumentTemplate() {}", "protected function getDocumentTemplate() {}", "function index(){\n\t\t$this->template->run();\n\t}", "public function templateTelesales()\n {\n \treturn view();\n }", "public function getModuleTemplate() {}", "public function getModuleTemplate() {}", "public function processaTemplate() {\n return $this->fetch('ricerca_'.$this->_layout.'.tpl');\n }", "public function __viewTemplate()\n {\n $this->_context[2] = 'single';\n $this->addStylesheetToHead(self::$assets_base_url . 'editor.css');\n $this->addStylesheetToHead(self::$assets_base_url . 'highlighters/highlight-xsl.css');\n $this->addScriptToHead(self::$assets_base_url . 'editor.js');\n $this->addScriptToHead(self::$assets_base_url . 'highlighters/highlight-xsl.js');\n $name = $this->_context[1];\n $filename = $name . '.xsl';\n $title = $filename;\n $this->setTitle(__(('%1$s &ndash; %2$s &ndash; %3$s'), array($title, __('Pages'), __('Symphony'))));\n //$this->setPageType('table');\n $this->Body->setAttribute('spellcheck', 'false');\n $this->appendSubheading($title);\n $breadcrumbs = array(\n Widget::Anchor(__('Pages'), SYMPHONY_URL . '/blueprints/pages/'),\n new XMLElement('span', __(Helpers::capitalizeWords($name)))\n );\n $this->insertBreadcrumbs($breadcrumbs);\n \n $this->insertAction(\n Widget::Anchor(\n __('Edit Page'), \n SYMPHONY_URL . '/blueprints/pages/edit/' . PageManager::fetchIDFromHandle($name) . '/',\n __('Edit Page Configuration'),\n 'button'\n )\n );\n\n $this->Form->setAttribute('class', 'columns');\n $this->Form->setAttribute('action', SYMPHONY_URL . '/blueprints/pages/' . $name . '/');\n\n $fieldset = new XMLElement('fieldset');\n $fieldset->appendChild(Widget::Input('fields[name]', $filename, 'hidden'));\n $fieldset->appendChild($label);\n //$fieldset->appendChild((isset($this->_errors['name']) ? Widget::Error($label, $this->_errors['name']) : $label));\n\n $label = Widget::Label(__('Body'));\n $label->appendChild(\n Widget::Textarea(\n 'fields[body]',\n 30,\n 100,\n $filename ? htmlentities(file_get_contents(WORKSPACE . '/pages/' . $filename), ENT_COMPAT, 'UTF-8') : '',\n array('id' => 'text-area', 'class' => 'code hidden')\n )\n );\n //$fieldset->appendChild((isset($this->_errors['body']) ? Widget::Error($label, $this->_errors['body']) : $label));\n\n $fieldset->appendChild($label);\n $this->Form->appendChild($fieldset);\n\n $this->Form->appendChild(\n new XMLElement(\n 'div',\n new XMLElement('p', __('Saving')),\n array('id' => 'saving-popup')\n )\n );\n //$this->_context = array('edit', 'pages', 'single');\n $this->Form->appendChild(\n new XMLElement(\n 'div',\n Widget::Input(\n 'action[save]',\n __('Save Changes'),\n 'submit',\n array('class' => 'button', 'accesskey' => 's')\n ),\n array('class' => 'actions')\n )\n );\n }", "public function get_custom_templates()\n {\n }", "function Template()\r\n\t{\t\t\r\n\t\tglobal $_REQUEST;\t\t\r\n\t\t$theme = $this->theme;\r\n\t\t/*** Get Template By Page Id ***/\r\n\t\t$file = $this->get_template();\r\n\t\t\r\n\t\tif($_SETTINGS['debug'] == 1){\r\n\t\t\techo \"TEMPLATE: \".$file.\" <Br>\";\r\n\t\t}\r\n\t\t\r\n\t\t$websitepath = $this->website_path;\r\n\t\t//die(\"FILE: $file\");\r\n\t\t//exit();\r\n\t\tinclude''.$_SERVER['DOCUMENT_ROOT'].$websitepath.'themes/'.$theme.''.$file.'';\r\n\t}", "public function template()\n\t{\n\t\t$this->render(self::PATH_VIEWS . '/template', [\n\t\t\t'templates_availables' => $this->templates_availables,\n\t\t]);\n\t}", "public function setTemplate($val){ return $this->setField('template',$val); }", "public function contato() {\n $this->load_template('contato');\n }", "public function beforeTemplate(){\n\t\t//defaults to empty\n\t}", "protected function template()\n\t{\n\t\treturn Phpfox::getLib('template');\t\n\t}", "public function plantilla(){\n # se usa este include para incluir la vista que contiene el codigo html\n include \"view/template.php\";\n\n }", "protected function _content_template() { ?>\r\n <# if ( settings.list.length ) { #>\r\n <div class=\"DSMCA__slide swiper-container\">\r\n <div class=\"swiper-wrapper\">\r\n <# _.each( settings.list, function( item ) { #>\t\r\n <div class=\"DSMCA__item_slide swiper-slide\">\r\n <img class=\"DSMCA__item-image\" src=\" {{ item.imagen.url }} \">\r\n <h5 class=\"DSMCA__item-title\"> {{{ item.titulo }}} </h5> \r\n </div>\r\n <# }); #>\t\r\n </div>\r\n <div class=\"swiper-button-prev\"></div>\r\n <div class=\"swiper-button-next\"></div>\r\n </div>\r\n <# } #>\r\n <?php\r\n }", "public static function renderTemplate()\n {\n echo self::$template;\n }", "function getTemplate(){\n\t\treturn $this->html_result;\n\t}", "public function render_control_templates()\n {\n }", "public function fetch_builder_template()\n\t\t{\n\t\t $error = false;\n $name = isset($_POST['templateName']) ? $_POST['templateName'] : false;\n if(empty($name)) \n $error = true;\n \n $key = $this->generate_key($name);\n $template = $this->get_meta_values($key);\n \n if(empty($template)) $error = true;\n \n \n if($error)\n {\n echo \"avia_fetching_error\";\n }\n else\n {\n $text = str_replace('{{{'.$name.'}}}','',$template[0]);\n $return = $this->builder->text_to_interface($text);\n \n echo $return;\n }\n \n die();\n\t\t}", "private function renderTemplate(){\n\t\trequire($this->TemplateFile);\n\t}", "public function render() {\n $template = $this->template;\n $template->setFile(__DIR__ . '/QuestionControl.latte');\n $this->template->question = $this->questions->getById($this->questionId);\n $template->render();\n }", "public function plantilla(){\n //el include se utiliza para invocar el archivo que tiene el codigo html\n include \"View/template.php\";\n }" ]
[ "0.8131128", "0.80089295", "0.80089295", "0.7849565", "0.7849565", "0.7849565", "0.7849565", "0.7849565", "0.7849565", "0.78449994", "0.78449994", "0.78449994", "0.78449994", "0.78449994", "0.78449994", "0.78449994", "0.78449994", "0.78449994", "0.78449994", "0.7820331", "0.78180254", "0.77950007", "0.7757987", "0.7736063", "0.7722639", "0.77034825", "0.7700275", "0.76973504", "0.76951814", "0.76948774", "0.76879346", "0.7587797", "0.75405306", "0.74678046", "0.74678046", "0.74678046", "0.74667615", "0.74523276", "0.74523276", "0.74523276", "0.74523276", "0.74523276", "0.74523276", "0.7442498", "0.7416989", "0.73599994", "0.7309608", "0.7244309", "0.7227014", "0.7224343", "0.71733683", "0.7087695", "0.70645297", "0.6990706", "0.69741726", "0.6972863", "0.6972863", "0.6972863", "0.6972863", "0.6966252", "0.6943599", "0.69264454", "0.69135755", "0.6895522", "0.68582785", "0.68475574", "0.6846107", "0.6841939", "0.6836543", "0.6823373", "0.6818151", "0.6818151", "0.6818151", "0.6818151", "0.68168163", "0.68162036", "0.68162036", "0.6813844", "0.6813844", "0.67970616", "0.679234", "0.6775503", "0.6775503", "0.6755792", "0.67043763", "0.67014813", "0.67011476", "0.66942835", "0.6671578", "0.6660695", "0.6660367", "0.6654217", "0.6651467", "0.664443", "0.662921", "0.6627919", "0.66062766", "0.6598301", "0.65903664", "0.6585837", "0.6583831" ]
0.0
-1
Resolves the given path in the given namespace (or from the namespace of the given class). .. and . can be used to navigate upper in the namesapce. Either / ou \ can be used as namespace separator. If the path starts with a namespace separator, it will be considered absolute (then, the given namespace will effectively be ignored).
function relativeNamespace($ns, $path = null) { if (is_object($ns)) $ns = get_namespace($ns); $path = str_replace('\\', '/', $path); if (!$path || $path === '' || $path === '.') { return $ns; } else if ($path === '/') { return '\\'; } else { $pathParts = explode( '/', trim($path, '/') ); if (substr($path, 0, 1) === '/') { $parts = array(); } else { $parts = explode('\\', trim($ns, '\\')); } foreach ($pathParts as $p) { if (! ($p === '' || $p === '.' || $p === '\\')) { if ($p === '..') { if (count($parts) > 0) { array_pop($parts); } else { throw new IllegalStateException( "Path ($path) go upper than root on namespace: $ns" ); } } else { $parts[] = $p; } } } return implode('\\', $parts) . '\\'; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function resolve($path);", "public static function resolve(string $path): string\n {\n $n = 0;\n $aux = preg_replace(\"/\\/\\.\\//\", '/', $path);\n $parts = $aux == null ? [] : explode('/', $aux);\n $partsReverse = [];\n for ($i = count($parts) - 1; $i >= 0; --$i) {\n if (trim($parts[$i]) === '..') {\n ++$n;\n } else {\n if ($n > 0) {\n --$n;\n } else {\n $partsReverse[] = $parts[$i];\n }\n }\n }\n\n return implode('/', array_reverse($partsReverse));\n }", "public static function rebuildComponentPath(string $namespace, string $path)\n {\n $namespace = $namespace ?? '';\n $namespace_dir = Str::contains($namespace ?? '', '\\\\') ? Str::afterLast('\\\\', $namespace) : $namespace;\n if (Str::lower($namespace_dir) !== Str::lower(Path::new($path)->basename())) {\n // If the last part of both namespace and path are not the same\n $parts = array_reverse(explode('\\\\', $namespace));\n foreach ($parts as $value) {\n if (Str::contains($path, $value)) {\n $path = sprintf('%s%s%s', rtrim(\n $path,\n \\DIRECTORY_SEPARATOR\n ), \\DIRECTORY_SEPARATOR, ltrim(\n Str::replace(\n '\\\\',\n \\DIRECTORY_SEPARATOR,\n Str::afterLast($value, $namespace)\n ),\n \\DIRECTORY_SEPARATOR\n ));\n break;\n }\n }\n }\n\n return $path;\n }", "public function resolvePath($path)\n\t{\n\t\t$path = trim($path, '/\\\\');\n\t\treturn $this->base_path . DIRECTORY_SEPARATOR . $path;\n\t}", "public function loadClass($classname, $namespace = '\\\\', $path = '/');", "private function getNamespaceFromPath( $path )\n {\n foreach ( $this->getNamespaces() as $nsPath => $namespace ) {\n $path = str_replace( $nsPath, $namespace, $path );\n }\n return ltrim( str_replace( DIRECTORY_SEPARATOR, '\\\\', $path ), '\\\\');\n }", "public static function getNamespace($path, PackageSchema $package) {\n\t\t$autoload = $package->getAutoload();\n\t\t$suffix = '';\n\t\t$namespace = null;\n\t\t$path = new Path($path);\n\t\t$path->removeTrailingSeparator();\n\n\t\tdo {\n\t\t\t$pathname = $path->getPathname()->toString();\n\t\t\t\n\t\t\t// find namespace in psr-4\n\t\t\t$namespace = $autoload->getPsr4()->getNamespace($pathname);\n\t\t\tif ($namespace === null) {\n\t\t\t\t$namespace = $autoload->getPsr4()->getNamespace($pathname . '/');\n\t\t\t}\n\t\t\t\n\t\t\t// find namespace in psr-0\n\t\t\tif ($namespace === null) {\n\t\t\t\t$namespace = $autoload->getPsr0()->getNamespace($pathname);\n\t\t\t}\n\t\t\tif ($namespace === null) {\n\t\t\t\t$namespace = $autoload->getPsr0()->getNamespace($pathname . '/');\n\t\t\t}\n\t\t\t\n\t\t\t// keep track of suffix\n\t\t\t// shrink down path by one segment\n\t\t\tif ($namespace === null) {\n\t\t\t\t$suffix = $path->lastSegment() . (!empty($suffix) ? '\\\\' : '') . $suffix;\n\t\t\t\t$path = $path->upToSegment($path->segmentCount() - 1);\n\t\t\t}\n\t\t} while (!$path->isEmpty() xor $namespace !== null);\n\t\t\n\t\tif ($namespace === null) {\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\t$namespace = new Text($namespace . $suffix);\n\t\tif ($namespace->endsWith('\\\\')) {\n\t\t\t$namespace = $namespace->substring(0, -1);\n\t\t}\n\n\t\treturn $namespace->toString();\n\t}", "public static function getNamespace(string $path)\n {\n $namespace = str_replace(['/', '.'], ['\\\\', ''], Dir::getPathWithoutLast($path));\n\n if (!empty($namespace)) {\n $namespace = '\\\\'.$namespace;\n }\n\n return $namespace;\n }", "function resolve($path)\n {\n if (preg_match('{^\\.(/|\\\\\\\\)}', $path)) {\n $path = dirname($this->path) . DIRECTORY_SEPARATOR . $path;\n }\n\n # When resolving a directory either look for a file named\n # \"$dir/index.$ext\" or return the path to the directory (e.g.\n # for \"require_tree\").\n if (is_dir($path)) {\n $index = Path::join(array($path, \"index{$this->getExtension()}\"));\n\n if (file_exists($index)) {\n $path = $index;\n } else {\n $pathinfo = new PathInfo($path);\n\n if ($pathinfo->isAbsolute()) {\n return $path;\n }\n\n return $this->environment->loadPaths->find($path);\n }\n }\n\n $pathinfo = new PathInfo($path);\n\n if ($pathinfo->isAbsolute()) {\n return $path;\n }\n\n return $this->environment->loadPaths->find($path);\n }", "function resolve_path($path)\n {\n return PathResolver::resolve($path);\n }", "public function resolveResource($path);", "function path_to_namespace($path)\n {\n\t $stripped = preg_replace(\"#\".app_path().\"/#uism\", config('melon.app_name', 'App') . \"\\\\\", dirname($path));\n\n\t return str_replace('/', '\\\\', $stripped);\n }", "public function resolvePath($path, $relative_to = null);", "function namespace_to_path($namespace, $file = null)\n {\n\t $prefixed = preg_replace(\"#^\" . $this->getRoot() . \"#uism\", app_path(), $namespace);\n\n\t return trim(str_replace('\\\\', '/', $prefixed) . '/' . $file, '/');\n }", "protected function resolvePath($base, $path = '')\n {\n if (empty($path)) {\n return $base;\n }\n\n return $base . DIRECTORY_SEPARATOR . trim($path, '\\\\/');\n }", "private function find_in_namespaces($class)\n\t{\n\t\tif (empty($this->namespaces_dirs)) return false;\n\t\t$pos = strrpos($class, '\\\\');\n\t\tif ($pos!==false)\n\t\t{\n\t\t\t$namespace = substr($class, 0, $pos+1);\n\t\t\t$class_name = str_replace('_', DIRECTORY_SEPARATOR, substr($class, $pos+1));\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$class_name = str_replace('_', DIRECTORY_SEPARATOR, $class);\n\t\t\t$pos = strrpos($class_name, DIRECTORY_SEPARATOR);\n\t\t\t$namespace = str_replace(DIRECTORY_SEPARATOR, '\\\\', substr($class_name, 0, $pos+1));\n\t\t\t$class_name = substr($class_name, $pos+1);\n\t\t}\n\t\tif (count($this->namespaces_dirs) > 1)\n\t\t{\n\t\t\tforeach ($this->namespaces_dirs as $ns => $dir)\n\t\t\t{\n\t\t\t\tif (stripos($namespace, $ns)===0)\n\t\t\t\t{\n\t\t\t\t\t$filepath = $this->lookFileInNamespaceDir($namespace, $ns, $class_name, $dir);\n\t\t\t\t\tif (!empty($filepath)) return $filepath;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$dir = $this->namespaces_dirs[''];\n\t\t$filepath = $this->lookFileInNamespaceDir($namespace, '', $class_name, $dir);\n\t\tif (!empty($filepath)) return $filepath;\n\t\treturn false;\n\t}", "public static function convertPathToClassName($file, $namespace = '');", "public static function calculateCorrectNamespace($classPath, $path, $rootNamespace)\n {\n $p = explode(DIRECTORY_SEPARATOR, $classPath);\n array_pop($p);\n $p = implode('\\\\', $p);\n\n $path = str_replace('/', '\\\\', $path);\n\n return str_replace(trim($path, '\\\\'), trim($rootNamespace, '\\\\/'), $p);\n }", "public static function toNamespace($path) {\n $path = static::ds(static::stripExt($path));\n\n // Attempt to split path at source folder\n foreach (array('lib', 'src') as $folder) {\n if (mb_strpos($path, $folder . static::SEPARATOR) !== false) {\n $paths = explode($folder . static::SEPARATOR, $path);\n $path = $paths[1];\n }\n }\n\n return trim(str_replace('/', static::PACKAGE, $path), static::PACKAGE);\n }", "protected function calculateNamespaceFromPath($path): string\n {\n return $this->appNamespace . str_replace('/', '\\\\', rtrim($path, '/'));\n }", "public static function getSourcePath($namespace, PackageSchema $package) {\n\t\t$relativeSourcePath = null;\n\t\t$autoload = $package->getAutoload();\n\t\t\n\t\t$suffix = '';\n\t\t$ns = new Path(str_replace('\\\\', '/', $namespace));\n\t\t$ns->removeTrailingSeparator();\n\t\t\n\t\tdo {\n\t\t\t$namespace = $ns->getPathname()->replace('/', '\\\\')->toString();\n\t\t\t\n\t\t\t// find paths in psr-s\n\t\t\t$relativeSourcePath = $autoload->getPsr4()->getPath($namespace . '\\\\');\n\n\t\t\tif ($relativeSourcePath === null) {\n\t\t\t\t$relativeSourcePath = $autoload->getPsr0()->getPath($namespace);\n\t\t\t}\n\n\t\t\t// keep track of suffix\n\t\t\tif ($relativeSourcePath === null) {\n\t\t\t\t$suffix = $ns->lastSegment() . (!empty($suffix) ? '/' : '') . $suffix;\n\t\t\t\t$ns = $ns->upToSegment($ns->segmentCount() - 1);\n\t\t\t}\n\t\t} while (!$ns->isEmpty() xor $relativeSourcePath !== null);\n\t\t\n\t\tif ($relativeSourcePath === null) {\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\t$path = new Path($relativeSourcePath);\n\t\t$path->removeTrailingSeparator();\n\t\t$path = $path->append($suffix);\n\t\t$path->addTrailingSeparator();\n\t\t\n\t\treturn $path->getPathname()->toString();\n\t}", "public static function load($class)\n {\n $prefix = $class;\n\n // work backwards through the namespace names of the fully-qualified class name to find a mapped file name\n while (false !== ($pos = strrpos($prefix, '\\\\'))) {\n // retain the trailing namespace separator in the prefix\n $prefix = substr($class, 0, $pos + 1);\n\n // the rest is the relative class name\n $relative_class = substr($class, $pos + 1);\n\n // try to load a mapped file for the prefix and relative class\n $mapped_file = self::loadMappedFile($prefix, $relative_class);\n if ($mapped_file) {\n return $mapped_file;\n }\n\n // remove the trailing namespace separator for the next iteration of strrpos()\n $prefix = rtrim($prefix, '\\\\');\n }\n\n // fix for empty prefix\n if (isset(self::$map['\\\\']) && ($class[0] != '\\\\')) {\n return self::load('\\\\' . $class);\n }\n\n // backwards compatibility with old autoloader\n // :TODO: it should be removed\n if (strpos($class, '\\\\') !== false) {\n $relative_class = substr(strrchr($class, '\\\\'), 1); // Foo\\Bar\\ClassName -> ClassName\n $mapped_file = self::loadMappedFile('\\\\', $relative_class);\n if ($mapped_file) {\n return $mapped_file;\n }\n }\n\n return false;\n }", "protected static function resolveRelativeNamespace($relativeNamespace) {\n\t\t\t$count = 1;\n\t\t\t$result = $relativeNamespace;\n\t\t\twhile ($count > 0) {\n\t\t\t\t$count = 0;\n\t\t\t\t$result = preg_replace('/\\w+(\\\\\\.\\.\\\\\\)/', '', $result, 1, $count); //TODO: this also matches \\.a\\\n\t\t\t}\n\t\t\tif (substr($relativeNamespace, 0, 4) == '\\\\..\\\\' || substr($relativeNamespace, 0, 3) == '..\\\\') {\n\t\t\t\tthrow new \\Exception(sprintf(constant\\Error::COULD_NOT_RESOLVE_NAMESPACE, $result));\n\t\t\t}\n\t\t\treturn $result;\n\t\t}", "function resolveContext($path);", "protected static function find($class)\n\t{\n\t\t$file = str_replace('\\\\', '/', $class);\n\n\t\t$namespace = substr($class, 0, strpos($class, '\\\\'));\n\n\t\t// If the namespace has been detected as a PSR-0 compliant library,\n\t\t// we will load the library according to those naming conventions.\n\t\tif (array_key_exists($namespace, static::$libraries))\n\t\t{\n\t\t\treturn str_replace('_', '/', $file).EXT;\n\t\t}\n\n\t\tforeach (static::$paths as $path)\n\t\t{\n\t\t\tif (file_exists($path = $path.strtolower($file).EXT))\n\t\t\t{\n\t\t\t\treturn $path;\n\t\t\t}\n\t\t}\n\n\t\t// If the file exists according to the PSR-0 naming conventions,\n\t\t// we will add the namespace to the array of libraries and load\n\t\t// the class according to the PSR-0 conventions.\n\t\tif (file_exists($path = str_replace('_', '/', $file).EXT))\n\t\t{\n\t\t\tstatic::$libraries[] = $namespace;\n\n\t\t\treturn $path;\n\t\t}\n\t}", "protected static function find($class)\n\t{\n\t\t// After PHP namespaces were introduced, most libaries ditched underscores for\n\t\t// namespaces to indicate the class directory hierarchy. We will check for the\n\t\t// presence of namespace slashes to determine the directory separator.\n\t\t$separator = (strpos($class, '\\\\') !== false) ? '\\\\' : '_';\n\n\t\t$library = substr($class, 0, strpos($class, $separator));\n\n\t\t$file = str_replace('\\\\', '/', $class);\n\n\t\t// If the namespace has been registered as a PSR-0 compliant library, we will\n\t\t// load the library according to the PSR-0 naming standards, which state that\n\t\t// namespaces and underscores indicate the directory hierarchy of the class.\n\t\tif (isset(static::$libraries[$library]))\n\t\t{\n\t\t\treturn LIBRARY_PATH.str_replace('_', '/', $file).EXT;\n\t\t}\n\n\t\t// Next we will search through the common Laravel paths for the class file.\n\t\t// The Laravel framework path, along with the libraries and models paths\n\t\t// will be searched according to the Laravel class naming standard.\n\t\t$lower = strtolower($file);\n\n\t\tforeach (static::$paths as $path)\n\t\t{\n\t\t\tif (file_exists($path = $path.$lower.EXT))\n\t\t\t{\n\t\t\t\treturn $path;\n\t\t\t}\n\t\t}\n\n\t\t// If we could not find the class file in any of the auto-loaded locations\n\t\t// according to the Laravel naming standard, we will search the libraries\n\t\t// directory for the class according to the PSR-0 naming standard.\n\t\tif (file_exists($path = LIBRARY_PATH.str_replace('_', '/', $file).EXT))\n\t\t{\n\t\t\tstatic::$libraries[] = $library;\n\n\t\t\treturn $path;\n\t\t}\n\n\t\t// Since not all controllers will be resolved by the controller resolver,\n\t\t// we will do a quick check in the controller directory for the class.\n\t\t// For instance, since base controllers would not be resolved by the\n\t\t// controller class, we will need to resolve them here.\n\t\tif (strpos($class, '_Controller') !== false)\n\t\t{\n\t\t\t$controller = str_replace(array('_Controller', '_'), array('', '/'), $class);\n\n\t\t\tif (file_exists($path = strtolower(CONTROLLER_PATH.$controller.EXT)))\n\t\t\t{\n\t\t\t\treturn $path;\n\t\t\t}\n\t\t}\n\t}", "public static function resolve($class)\n\t{\n\t\tif(\\substr($class, 0, 1) !== '\\\\') {\n\t\t\t// Absolute path\n\t\t\treturn $class;\n\t\t} else {\n\t\t\t// Relative path, search through modules\n\t\t\t$config = \\glenn\\config\\Config::factory('classes.php');\n\t\t\tif(isset($config->$class)) {\n\t\t\t\treturn $config->$class;\n\t\t\t}\n\t\t\treturn 'glenn' . $class;\n\t\t}\n\t\treturn false;\n\t}", "public static function resolve() {\n $paths = func_get_args();\n if (count($paths)===1 && is_array($paths[0])) $paths = $paths[0];\n\n $prefix = [];\n $imploded = null;\n $stripped = [];\n\n // Strip all stream wrapper schemes, and prepend the\n // last found scheme to the resolved path.\n foreach($paths as $path) {\n $newPrefix = [];\n $path = self::stripScheme($path, $newPrefix);\n\n if (count($newPrefix)) {\n if ($imploded && $imploded!==implode('', $newPrefix)) {\n // Switched scheme, so skip previous paths (like a root change)\n $stripped = [];\n }\n\n $prefix = $newPrefix;\n $imploded = implode('', $prefix);\n }\n\n if ($path) $stripped[] = $path;\n }\n\n $nonDefault = array_filter($prefix, function($prefix){\n return $prefix!=='file://';\n });\n\n if (count($nonDefault)===0) $prefix = [];\n\n // Do a posix-style join for remote URLs and VFS streams\n $nonAbsolutable = array_filter($prefix, function($prefix){\n return $prefix==='vfs://' || !stream_is_local($prefix.'/foo');\n });\n\n if (count($nonAbsolutable)>0) {\n $method = 'join';\n $adapter = self::$posix;\n } else {\n $method = 'resolve';\n $adapter = self::$adapter;\n }\n\n $resolved = $adapter->$method($stripped);\n\n return implode('', $prefix) . $resolved;\n }", "protected function namespacePath(): string\n {\n return str_replace(\n [$this->applicationNamespace() . '\\\\', '\\\\'], \n ['', '/'], \n $this->fullNamespace()\n );\n }", "public static function resolveFromRelativePath($path, $additional)\n {\n $pathArray = array_filter(explode(DIRECTORY_SEPARATOR, $path));\n\n array_unshift($pathArray, self::getRootNamespace());\n\n $namespace = implode('\\\\', array_map('ucfirst', $pathArray));\n\n return Str::appendWith($namespace, ucfirst($additional), '\\\\');\n }", "private static function getClassname(string $path)\n {\n return self::NAMESPACE . str_replace('/', '\\\\', $path);\n }", "public function convertNamespaceToPath($namespace)\n {\n // remove the app namespace from the namespace if it is there\n $appNamespace = $this->getAppNamespace();\n\n if (substr($namespace, 0, strlen($appNamespace)) == $appNamespace) {\n $namespace = substr($namespace, strlen($appNamespace));\n }\n\n // trim and return the path\n return str_replace('\\\\', '/', trim($namespace, ' \\\\'));\n }", "protected function getNamespace(string $classPath, string $fileName): string\n {\n return Str::of($classPath)->match('/namespace (.*);/m')\n ->append('\\\\')\n ->append(Str::of($fileName)->replace('.php', ''))\n ->__toString();\n }", "protected function resolvePath($path)\n {\n $rootPath = defined('ROOT_PATH') ? ROOT_PATH : getcwd();\n\n return mb_substr($path, 0, 1) == '/' ? $path : $rootPath.'/'.$path;\n }", "public static function load(string $class): string|false\n {\n $prefix = $class;\n\n // work backwards through the namespace names of the fully-qualified class name to find a mapped file name\n while (false !== ($pos = strrpos($prefix, '\\\\'))) {\n // retain the trailing namespace separator in the prefix\n $prefix = substr($class, 0, $pos + 1);\n\n // the rest is the relative class name\n $relative_class = substr($class, $pos + 1);\n\n // try to load a mapped file for the prefix and relative class\n $mapped_file = self::loadMappedFile($prefix, $relative_class);\n if ($mapped_file) {\n return $mapped_file;\n }\n\n // remove the trailing namespace separator for the next iteration of strrpos()\n $prefix = rtrim($prefix, '\\\\');\n }\n\n // fix for empty prefix\n if (isset(self::$map['\\\\']) && ($class[0] != '\\\\')) {\n return self::load('\\\\' . $class);\n }\n\n if (str_contains($class, '\\\\')) {\n $relative_class = substr(strrchr($class, '\\\\'), 1); // Foo\\Bar\\ClassName -> ClassName\n $mapped_file = self::loadMappedFile('\\\\', $relative_class);\n if ($mapped_file) {\n return $mapped_file;\n }\n }\n\n return false;\n }", "public static function get($path) {\n $pathArray = explode('.', $path);\n $current = static::$config;\n if(static::exists($current, $pathArray[0])) {\n //check the namespace exists\n foreach($pathArray as $item) {\n if(static::exists($current, $item)) {\n $current = &$current[$item];\n }\n }\n return $current;\n }\n return null;\n }", "private static function resolveByDotNotation( array $array, $path, $default = null ) {\n\t\t$current = $array;\n\t\t$p = strtok( $path, '.' );\n\n\t\twhile ( $p !== false ) {\n\t\t\tif ( ! isset( $current[ $p ] ) ) {\n\t\t\t\treturn $default;\n\t\t\t}\n\t\t\t$current = $current[ $p ];\n\t\t\t$p = strtok( '.' );\n\t\t}\n\n\t\treturn $current;\n\t}", "function fn_normalize_path($path, $separator = '/')\n{\n $prefix = '';\n if (strpos($path, '://') !== false) { // url is passed\n list($prefix, $path) = explode('://', $path);\n $prefix .= '://';\n }\n\n $result = array();\n $path = preg_replace(\"/[\\\\\\\\\\/]+/S\", $separator, $path);\n $path_array = explode($separator, $path);\n if (!$path_array[0]) {\n $result[] = '';\n }\n\n foreach ($path_array as $key => $dir) {\n if ($dir == '..') {\n if (end($result) == '..') {\n $result[] = '..';\n } elseif (!array_pop($result)) {\n $result[] = '..';\n }\n } elseif ($dir != '' && $dir != '.') {\n $result[] = $dir;\n }\n }\n\n if (!end($path_array)) {\n $result[] = '';\n }\n\n return fn_is_empty($result) ? '' : $prefix . implode($separator, $result);\n}", "public function loadClass($class)\n\t{\n\t\t// $prefix will be stripped of possible relative class names\n\t\t// in while loop below\n\t\t$prefix = $class;\n\n\t\t// go backwards through the namespaced class name\n\t\t// to find a mapped file name\n\t\twhile (false !== $pos = strrpos($prefix, '\\\\')) {\n\t\t\t// retain trailing namespace separator in the prefix\n\t\t\t$prefix = substr($class, 0, $pos + 1);\n\n\t\t\t// the relative class name (can contain folder names)\n\t\t\t$relativeClass = substr($class, $pos + 1);\n\n\t\t\t// trying to load a file\n\t\t\t$mappedFile = $this->loadMappedFile($prefix, $relativeClass);\n\t\t\tif ($mappedFile) {\n\t\t\t\treturn $mappedFile;\n\t\t\t}\n\n\t\t\t// remove the trailing namespace separator for next iteration\n\t\t\t$prefix = rtrim($prefix, '\\\\');\n\t\t}\n\n\t\t// not found any file\n\t\treturn false;\n\t}", "public function find( &$className ) {\n\t\n\t\tif (empty( self::$paths ))\n\t\t\tthrow new aop_exception( \"path list is empty\" );\n\t\n\t\tforeach( self::$paths as $element ) {\n\t\t\n\t\t\t$liste = explode( PATH_SEPARATOR, $element );\n\t\t\tforeach( $liste as $path ) {\n\t\t\t\n\t\t\t\t// case 1\n\t\t\t\t$p = $path . DIRECTORY_SEPARATOR . $className . '.php';\n\t\t\t\t#echo \"1- Trying path: $p \\n\";\n\t\t\t\tif ( file_exists( $p ) )\n\t\t\t\t\treturn $p;\n\t\t\t\t\t\n\t\t\t\t// case 2\n\t\t\t\t$p = $path . DIRECTORY_SEPARATOR . $className . DIRECTORY_SEPARATOR . $className . '.php';\n\t\t\t\t#echo \"2- Trying path: $p \\n\";\t\t\n\t\t\t\tif ( file_exists( $p ) )\n\t\t\t\t\treturn $p;\n\t\t\t\t\t\n\t\t\t\t// case 3\n\t\t\t\t$bits = explode( \"_\", $className );\n\t\t\t\t$fragment_list = implode( DIRECTORY_SEPARATOR, $bits );\n\t\t\t\t$last_fragment = $bits[ count( $bits ) - 1 ];\n\t\t\t\t$p = $path . DIRECTORY_SEPARATOR . $fragment_list . '.php';\n\t\t\t\t#echo \"3- Trying path: $p \\n\";\t\t\t\n\t\t\t\tif ( file_exists( $p ) )\n\t\t\t\t\treturn $p;\n\t\t\t\t\n\t\t\t\t// case 4\n\t\t\t\t$p = $path . DIRECTORY_SEPARATOR . $fragment_list . DIRECTORY_SEPARATOR.$last_fragment.'.php';\n\t\t\t\t#echo \"4- Trying path: $p \\n\";\t\t\t\n\t\t\t\tif ( file_exists( $p ) )\n\t\t\t\t\treturn $p;\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn null;\n\t}", "public function resolve($class)\n {\n $class = Inflector::toNamespace($class);\n\n return $this->make($class);\n }", "public static function resolveFromAbsolutePath($path, $additional)\n {\n $appPathArray = array_filter(\n explode('/', Config::getInstance()->getAppPath())\n );\n\n $relativePath = array_diff(\n array_filter(explode(DIRECTORY_SEPARATOR, $path)),\n $appPathArray\n );\n\n array_unshift($relativePath, self::getRootNamespace());\n\n $namespace = implode('\\\\', array_map('ucfirst', $relativePath));\n\n return Str::appendWith($namespace, ucfirst($additional), '\\\\');\n }", "protected static function calculateClassFromFile($filePath, $basePath, $path, $rootNamespace)\n {\n $class = trim(Str::replaceFirst($basePath, '', $filePath), DIRECTORY_SEPARATOR);\n\n // remove .php from class path\n $withoutDotPhp = Str::replaceLast('.php', '', $class);\n // ensure backslash on windows\n $allBackSlash = str_replace(DIRECTORY_SEPARATOR, '\\\\', $withoutDotPhp);\n\n // replaces the base folder name with corresponding namespace\n return str_replace(rtrim($path, '/').'\\\\', $rootNamespace, $allBackSlash);\n }", "private static function autoLoader($namespace)\n {\n $filePath = explode('\\\\', $namespace);\n\n /**\n * To remove the Class name (Not class file name) from the end of the namespace.\n */\n array_pop($filePath);\n /**\n * to remove the root key from the beginning the namespace.\n */\n array_shift($filePath);\n \n /**\n * After taking and removing those stuffs, then we are converting namespace from array to an string .\n * using the directory separator that it can work perfectly in every OS (like: windows, linux, ...) .\n */\n $filePath = implode(DIRECTORY_SEPARATOR, $filePath);\n\n /**\n * Now we have just removed that root key from the beginning of the namespace that was extra and also\n * took the Class name (not its file name) from the namespace.\n * And now we have got the address to the class file from the root of the Framework.\n * \n * It means that with combining the (FILE_PATH) constant that gives us the absolute path to the Framework's root and having the address of the class name in the\n * Framework (that we it is) and adding the file extension to these things we can have the full path to that class that was called!\n */\n $filePath = FILE_PATH . $filePath . '.php';\n \n /*\n * We are checking to see whether that class exists or not,\n * If it exists then we are calling that class with using the (require_once) function.\n */\n if (is_readable($filePath))\n {\n require_once $filePath;\n self::registryInjection($namespace);\n\n return;\n }else\n {\n self::$registry->error->reportError(\"The Called Class File Does Not Exists! ({$filePath})\", __LINE__, __METHOD__, false);\n return;\n }\n return;\n }", "public function add(string $path, string $namespace): self;", "function mdl_find_namespace_component(array $values, $name)\n{\n foreach ($values as $value) {\n $directory = $value['directory'] ?? null;\n $local_name = isset($value['name']) ? preg_replace(\"/\\s+/\", \"\", $value['name']) : null;\n if (null === $local_name) {\n continue;\n }\n if (trim($directory ? mdl_create_sub_namespace('', $directory) . \"\\\\\" . $local_name : $local_name, '\\\\') === trim($name, '\\\\')) {\n return $value;\n }\n }\n return false;\n}", "protected function normalizeNS($package)\n {\n $package = ltrim($package, '.');\n\n if ($this->compiler->hasPackage($package)) {\n return $this->compiler->getPackage($package);\n }\n\n // Check the currently registered packages to find a root one\n $found = null;\n foreach ($this->compiler->getPackages() as $pkg=>$ns) {\n // Keep only the longest match\n if (0 === strpos($package, $pkg.'.') && strlen($found) < strlen($pkg)) {\n $found = $pkg;\n }\n }\n\n // If no matching package was found issue a warning and use the package name\n if (!$found) {\n $this->compiler->warning('Non tracked package name found \"' . $package . '\"');\n $namespace = str_replace('.', '\\\\', $package);\n } else {\n // Complete the namespace with the remaining package\n $namespace = $this->compiler->getPackage($found);\n $namespace .= substr($package, strlen($found));\n $namespace = str_replace('.', '\\\\', $namespace);\n // Set the newly found namespace in the registry\n $this->compiler->setPackage($package, $namespace);\n }\n\n return $namespace;\n }", "public static function resolve($dir, $additional = '')\n {\n $config = Config::getInstance();\n\n if ($config->has(['namespaces', $dir])) {\n $namespace = $config->namespaces->$dir;\n\n return Str::appendWith($namespace, ucfirst($additional), '\\\\');\n } elseif ($config->has(['application', $dir.'Dir'])) {\n return self::resolveFromRegisteredDir($dir, $additional);\n } else {\n return self::resolveFromRelativePath($dir, $additional);\n }\n }", "private function namespace_to_directory( $namespace ) {\n return str_replace( '\\\\', '/', $namespace );\n }", "public static function loadClass(string $class)\r\n {\r\n // the current namespace prefix\r\n $prefix = $class;\r\n while ( false !== $pos = strrpos($prefix, '\\\\') ) {\r\n // retain the trailing namespace separator in the prefix\r\n $prefix = substr($class, 0, $pos + 1);\r\n // the rest is the relative class name\r\n $relative_class = substr($class, $pos + 1);\r\n // try to load a mapped file for the prefix and relative class\r\n $mapped_file = self::loadMappedFile($prefix, $relative_class);\r\n if ( $mapped_file ) {\r\n return $mapped_file;\r\n }\r\n $prefix = rtrim($prefix, '\\\\');\r\n }\r\n return false;\r\n }", "public function loadAliasesFrom($path, $namespace, $key = 'aliases');", "protected function solveSymbolicPath(string $path): string\n {\n $path = trim($path, '/');\n\n // explode for slashes\n $array = explode('/', $path);\n\n // this will hold the path result\n $result = [];\n\n foreach ($array as $value) {\n if ($value === '') {\n continue;\n } elseif ($value === '.') {\n continue;\n } elseif ($value === '..' && count($result) === 0) {\n throw new Exception();\n } elseif (str_starts_with($value, '..')) {\n array_pop($result);\n } else {\n $result[] = $value;\n }\n }\n\n // return it\n return implode('/', $result);\n }", "protected function resolvePath($path)\n {\n /** @var BaseActiveRecord $model */\n $model = $this->owner;\n return preg_replace_callback('/{([^}]+)}/', function ($matches) use ($model) {\n $name = $matches[1];\n $attribute = ArrayHelper::getValue($model, $name);\n if (is_string($attribute) || is_numeric($attribute)) {\n return $attribute;\n } else {\n return $matches[0];\n }\n }, $path);\n }", "public function resolveClass($fullclass)\n {\n # echo \"Fullclass: \" . $fullclass . \"\\n\";\n foreach ($this->prefixes as $prefixMap) {\n list($prefix, $dirs) = $prefixMap;\n if (strpos($fullclass, $prefix) === 0) {\n $len = strlen($prefix);\n $classSuffix = substr($fullclass, $len);\n $subpath = str_replace('\\\\', DIRECTORY_SEPARATOR, $classSuffix) . '.php';\n\n foreach ($dirs as $dir) {\n $classPath = $dir . $subpath;\n if (file_exists($classPath)) {\n return $classPath;\n }\n }\n }\n }\n }", "public static function fixNamespace($namespace)\n {\n return str_replace('\\\\', '/', $namespace);\n }", "abstract function resolve($class);", "public static function load($class) {\n\t\t$prefix = 'src\\\\';\n\n\t\t$len = strlen($prefix);\n\t\tif (strncmp($prefix, $class, $len) !== 0) {\n\t\t\t// Another namespace.\n\t\t\treturn;\n\t\t}\n\n\t\t$class_name = substr($class, $len);\n\n\t\t$file = __DIR__ . DIRECTORY_SEPARATOR . strtr($class_name, '\\\\', DIRECTORY_SEPARATOR) . '.php';\n\n\t\tif (is_file($file)) {\n\t\t\trequire $file;\n\t\t}\n\t}", "protected function load($paths, $namespace = null)\n {\n $paths = collect($paths)\n ->unique()\n ->filter(function ($path) {\n return is_dir($path);\n })->map(function ($path) {\n return realpath($path);\n })->all();\n\n if (empty($paths)) {\n return;\n }\n\n $namespace = $namespace ?: app()->getNamespace();\n $path = starts_with($namespace, 'Nuwave\\\\Lighthouse')\n ? realpath(__DIR__.'/../../src/')\n : app_path();\n\n /** @var SplFileInfo $file */\n foreach ((new Finder())->in($paths)->files() as $file) {\n $className = $namespace.str_replace(\n ['/', '.php'],\n ['\\\\', ''],\n str_after($file->getPathname(), $path.DIRECTORY_SEPARATOR)\n );\n\n $this->tryRegisterClassName($className);\n }\n }", "private function getClassNamespace(string $baseNamespace, string $relativeNamespace = null): string\n {\n $ret = $baseNamespace;\n if (null !== $relativeNamespace) {\n $ret .= \"\\\\\" . $relativeNamespace;\n }\n return $ret;\n }", "protected function loadConstantsFrom($path, $namespace = null)\n {\n $constants = require $path;\n $prefix = $namespace ? \"$namespace\" : '';\n\n foreach ($constants as $constant => $value) {\n define(strtoupper(\"{$prefix}{$constant}\"), $value);\n }\n }", "public function normalizePath($path)\n {\n $path = str_replace(['\\\\', '//'], '/', $path);\n $prefix = preg_match('|^(?P<prefix>([a-zA-Z]+:)?//?)|', $path, $matches) ? $matches['prefix'] : '';\n $path = substr($path, strlen($prefix));\n $parts = array_filter(explode('/', $path), 'strlen');\n $tokens = [];\n\n foreach ($parts as $part) {\n if ('..' === $part) {\n array_pop($tokens);\n } elseif ('.' !== $part) {\n array_push($tokens, $part);\n }\n }\n\n return $prefix . implode('/', $tokens);\n }", "public function resolvePath(string $relativePath): string;", "private function fixpath(string $path): string {\n\t\t$path = $this->normalisePath($path);\n\n\t\t//problem with dirname() and file in the vfs root directory\n\t\tif ($path === \"{$this->protocolName}:\") {\n\t\t\treturn \"{$path}///\";\n\t\t}\n\n\t\t//never fix the path twice\n\t\tif (mb_strpos($path, $this->protocolName) === 0) {\n\t\t\treturn $path;\n\t\t}\n\n\t\tif ($this->inTransaction()) {\n\t\t\tif (mb_substr($path, 0, mb_strlen($this->baseDir)) === $this->baseDir) {\n\t\t\t\t$path = mb_substr($path, mb_strlen($this->baseDir));\n\t\t\t} else {\n\t\t\t\tthrow new InvalidArgumentException(\"Cannot access file path '{$path}' on the vfs, is not below base directory '{$this->baseDir}'\");\n\t\t\t}\n\n\t\t\t$path = \"{$this->protocolName}://{$path}\";\n\t\t}\n\n\t\treturn $path;\n\t}", "protected function compose($suffix, $path)\n\t{\n\t\t$name = ucfirst($this->word) . $suffix;\n\n\t\treturn $this->namespace . \"\\\\{$path}\\\\{$name}\";\n\t}", "public function findFile($class)\n\t{\n\t\tif('\\\\' == $class[0])\n\t\t{\n\t\t\t$class = \\substr($class, 1);\n\t\t}\n\n\t\tif(false !== $pos = \\strrpos($class, '\\\\'))\n\t\t{\n\t\t\t// namespaced class name\n\t\t\t$namespace = \\substr($class, 0, $pos);\n\n\t\t\tforeach($this->namespaces as $ns => $dirs)\n\t\t\t{\n\t\t\t\tif(0 !== \\strpos($namespace, $ns))\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tforeach($dirs as $dir)\n\t\t\t\t{\n\t\t\t\t\t$className = \\substr($class, $pos + 1);\n\t\t\t\t\t$file = $dir.\\DIRECTORY_SEPARATOR.\\str_replace('\\\\', \\DIRECTORY_SEPARATOR, $namespace).\\DIRECTORY_SEPARATOR.\\str_replace('_', \\DIRECTORY_SEPARATOR, $className).'.php';\n\n\t\t\t\t\tif(\\file_exists($file))\n\t\t\t\t\t{\n\t\t\t\t\t\treturn $file;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tforeach($this->namespaceFallbacks as $dir)\n\t\t\t{\n\t\t\t\t$file = $dir.\\DIRECTORY_SEPARATOR.\\str_replace('\\\\', \\DIRECTORY_SEPARATOR, $class).'.php';\n\n\t\t\t\tif(\\file_exists($file))\n\t\t\t\t{\n\t\t\t\t\treturn $file;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// PEAR-like class name\n\t\t\tforeach($this->prefixes as $prefix => $dirs)\n\t\t\t{\n\t\t\t\tif(0 !== \\strpos($class, $prefix))\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tforeach($dirs as $dir)\n\t\t\t\t{\n\t\t\t\t\t$file = $dir.\\DIRECTORY_SEPARATOR.\\str_replace('_', \\DIRECTORY_SEPARATOR, $class).'.php';\n\n\t\t\t\t\tif(\\file_exists($file))\n\t\t\t\t\t{\n\t\t\t\t\t\treturn $file;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tforeach($this->prefixFallbacks as $dir)\n\t\t\t{\n\t\t\t\t$file = $dir.\\DIRECTORY_SEPARATOR.\\str_replace('_', \\DIRECTORY_SEPARATOR, $class).'.php';\n\n\t\t\t\tif(\\file_exists($file))\n\t\t\t\t{\n\t\t\t\t\treturn $file;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function evaluateEntityNamespace(string $namespace)\n {\n /**\n * Trying to generate new entity given that the class is the entity\n * namespace.\n */\n if (class_exists($namespace)) {\n return $namespace;\n }\n\n /**\n * Trying to generate new entity given that the namespace is defined in\n * as a Container parameter.\n */\n $container = $this->container;\n if (\n $container->hasParameter($namespace) &&\n class_exists($container->getParameter($namespace))\n ) {\n $namespaceParameter = $container->getParameter($namespace);\n\n return $namespaceParameter;\n }\n\n $resolvedNamespace = explode(':', $namespace, 2);\n $bundles = $this->kernel->getBundles();\n\n /**\n * Trying to get entity using Doctrine short format.\n *\n * MyBundle:MyEntity\n *\n * To accept this format, entities must be at Entity/ folder in the\n * bundle root dir\n *\n * /MyBundle/Entity/MyEntity\n *\n * If entity definition is wrong, throw exception\n * If bundle not exists or is not actived, throw Exception\n */\n if (\n !(\n isset($resolvedNamespace[0]) &&\n isset($bundles[$resolvedNamespace[0]]) &&\n $bundles[$resolvedNamespace[0]] instanceof Bundle &&\n isset($resolvedNamespace[1])\n )\n ) {\n throw new ClassNotFoundException(\n $namespace,\n new ErrorException()\n );\n }\n\n /**\n * @var Bundle $bundle\n */\n $bundle = $bundles[$resolvedNamespace[0]];\n $bundleNamespace = $bundle->getNamespace();\n $namespace = $bundleNamespace . '\\\\Entity\\\\' . $resolvedNamespace[1];\n\n if (!class_exists($namespace)) {\n throw new ClassNotFoundException(\n $namespace,\n new ErrorException()\n );\n }\n\n /**\n * Otherwise, assume that class is namespace of class.\n */\n\n return $namespace;\n }", "public function dir( $namespace )\n\t{\n\t\tif( strpos( $namespace, '/ ') ) return rPop( $namespace );\n\n\t\treturn $this->rPop( dirname( $this->g( $namespace ) ), '/' ) ;\n\t}", "protected function loadTranslationsFrom($path, $namespace)\n\t{\n\t\t$this->app['translator']->addNamespace($namespace, $path);\n\t}", "public static function generateNameSpaceByPath(string $path):string{\n $parentNamespaces = self::getParentNameSpaces($path);\n $path = explode(DIRECTORY_SEPARATOR,$path);\n $result = '';\n $number = null;\n foreach($path as $num => $subPath){\n foreach($parentNamespaces as $key =>$parentNamespace){\n if($subPath == $parentNamespace){\n $number = $num;\n $result = $key;\n }\n }\n }\n if($result == ''){\n throw new Exception('Wrond Path');\n } else {\n for($i = $number + 1; $i < count($path); ++$i){\n $result .= \"\\\\\".$path[$i];\n }\n }\n return $result;\n }", "public function normalizeNamespace($class)\n {\n if ($class === null) {\n return null;\n }\n\n if (is_object($class)) {\n $class = get_class($class);\n }\n\n return ltrim($class, '\\\\');\n }", "public static function getPath\n\t(\n\t\t$class\t\t\t// <str> The name of the class to retrieve the path of\n\t)\t\t\t\t\t// RETURNS <str> Path to the class if found, or \"\" on failure.\n\t\n\t// $classPath = Classes_Meta::getPath($class);\n\t{\n\t\t// Prepare Values\n\t\t$class = Sanitize::variable($class);\n\t\t$slashClass = str_replace(\"_\", \"/\", $class);\n\t\t\n\t\t// Attempt to load an application class\n\t\tif(is_file(APP_PATH . \"/classes/\" . $slashClass . \"/\" . $class . \".config.php\"))\n\t\t{\n\t\t\treturn APP_PATH . \"/classes/\" . $slashClass;\n\t\t}\n\t\t\n\t\t// Attempt to load a core class\n\t\tif(is_file(SYS_PATH . \"/core-classes/\" . $slashClass . \"/\" . $class . \".config.php\"))\n\t\t{\n\t\t\treturn SYS_PATH . \"/core-classes/\" . $slashClass;\n\t\t}\n\t\t\n\t\t// Attempt to load an plugin class\n\t\tif(is_file(SYS_PATH . \"/plugin-classes/\" . $slashClass . \"/\" . $class . \".config.php\"))\n\t\t{\n\t\t\treturn SYS_PATH . \"/plugin-classes/\" . $slashClass;\n\t\t}\n\t\t\n\t\treturn \"\";\n\t}", "public static function scanDirectory($namespace_prefix, $path) {\n if (substr($namespace_prefix, -1) !== '\\\\') {\n throw new \\InvalidArgumentException(\"Namespace prefix for $path must contain a trailing namespace separator.\");\n }\n $flags = \\FilesystemIterator::UNIX_PATHS;\n $flags |= \\FilesystemIterator::SKIP_DOTS;\n $flags |= \\FilesystemIterator::FOLLOW_SYMLINKS;\n $flags |= \\FilesystemIterator::CURRENT_AS_SELF;\n $flags |= \\FilesystemIterator::KEY_AS_FILENAME;\n\n $iterator = new \\RecursiveDirectoryIterator($path, $flags);\n $filter = new \\RecursiveCallbackFilterIterator($iterator, function ($current, $file_name, $iterator) {\n if ($iterator->hasChildren()) {\n return TRUE;\n }\n // We don't want to discover abstract TestBase classes, traits or\n // interfaces. They can be deprecated and will call @trigger_error()\n // during discovery.\n return substr($file_name, -4) === '.php' &&\n substr($file_name, -12) !== 'TestBase.php' &&\n substr($file_name, -9) !== 'Trait.php' &&\n substr($file_name, -13) !== 'Interface.php';\n });\n $files = new \\RecursiveIteratorIterator($filter);\n $classes = [];\n foreach ($files as $fileinfo) {\n $class = $namespace_prefix;\n if ('' !== $subpath = $fileinfo->getSubPath()) {\n $class .= strtr($subpath, '/', '\\\\') . '\\\\';\n }\n $class .= $fileinfo->getBasename('.php');\n $classes[$class] = $fileinfo->getPathname();\n }\n return $classes;\n }", "private function parseName($name)\n {\n $rootNamespace = $this->laravel->getNamespace();\n\n if (starts_with($name, $rootNamespace)) {\n return $name;\n }\n\n if (str_contains($name, '/')) {\n $name = str_replace('/', '\\\\', $name);\n }\n\n return $this->parseName($this->getDefaultNamespace(trim($rootNamespace, '\\\\')) . '\\\\' . $name);\n }", "function __realpath($path) {\n\t$path = str_replace('\\\\','/',realpath($path));\n\tif ($path{1} == ':') {\n\t\t// We can't just check for C:/, because windows users may have the IIS webroot on X: or F:, etc.\n\t\t$path = substr($path,2);\n\t}\n\treturn $path;\n}", "public function addNamespace($namespace, $path)\n {\n if (is_dir($path) === false) {\n throw new Exception(\"path not found: $path\");\n }\n\n $this->_ns[$namespace] = $path;\n\n return $this;\n }", "public static function getNamespacePath($namespace) {\n\t\treturn app('path.media') . '/' . $namespace;\n\t}", "function resolve_href ($base, $href) {\n if (!$href) {\n return $base;\n }\n\n // href=\"http://...\" ==> href isn't relative\n $rel_parsed = parse_url($href);\n if (array_key_exists('scheme', $rel_parsed)) {\n return $href;\n }\n\n // add an extra character so that, if it ends in a /, we don't lose the last piece.\n $base_parsed = parse_url(\"$base \");\n // if it's just server.com and no path, then put a / there.\n if (!array_key_exists('path', $base_parsed)) {\n $base_parsed = parse_url(\"$base/ \");\n }\n\n // href=\"/ ==> throw away current path.\n if ($href{0} === \"/\") {\n $path = $href;\n } else {\n $path = dirname($base_parsed['path']) . \"/$href\";\n }\n\n // bla/./bloo ==> bla/bloo\n $path = preg_replace('~/\\./~', '/', $path);\n\n // resolve /../\n // loop through all the parts, popping whenever there's a .., pushing otherwise.\n $parts = array();\n foreach (\n explode('/', preg_replace('~/+~', '/', $path)) as $part\n ) if ($part === \"..\") {\n array_pop($parts);\n } elseif ($part!=\"\") {\n $parts[] = $part;\n }\n\n return (\n (array_key_exists('scheme', $base_parsed)) ?\n $base_parsed['scheme'] . '://' . $base_parsed['host'] : \"\"\n ) . \"/\" . implode(\"/\", $parts);\n\n}", "public function locatePath($path)\n {\n if (stripos($path, 'http') === 0) {\n return $path;\n }\n\n $url = $this->getMinkParameter('base_url');\n\n if (strpos($path, 'wp-admin') !== false || strpos($path, '.php') !== false) {\n $url = $this->getWordpressParameter('site_url');\n }\n\n return rtrim($url, '/') . '/' . ltrim($path, '/');\n }", "private function performFindAndReplaceInFile(\n string $path\n ): void {\n $this->findAndReplaceHelper->findReplace(\n 'use ' . RelationsGenerator::FIND_ENTITIES_NAMESPACE . '\\\\' . RelationsGenerator::FIND_ENTITY_NAME,\n \"use {$this->entityFqn}\",\n $path\n );\n $this->findAndReplaceHelper->findReplace(\n 'use ' .\n RelationsGenerator::FIND_ENTITY_INTERFACE_NAMESPACE .\n '\\\\' .\n RelationsGenerator::FIND_ENTITY_INTERFACE_NAME,\n \"use {$this->entityInterfaceFqn}\",\n $path\n );\n $this->findAndReplaceHelper->findReplaceRegex(\n '%use(.+?)Relations\\\\\\TemplateEntity(.+?);%',\n 'use ${1}Relations\\\\' . $this->singularNamespace . '${2};',\n $path\n );\n $this->findAndReplaceHelper->findReplaceRegex(\n '%use(.+?)Relations\\\\\\TemplateEntity(.+?);%',\n 'use ${1}Relations\\\\' . $this->pluralNamespace . '${2};',\n $path\n );\n $this->findAndReplaceHelper->findReplaceRegex(\n '%(Has|Reciprocates)(Required|)TemplateEntity%',\n '${1}${2}' . $this->singularNamespacedName,\n $path\n );\n $this->findAndReplaceHelper->findReplaceRegex(\n '%(Has|Reciprocates)(Required|)TemplateEntities%',\n '${1}${2}' . $this->pluralNamespacedName,\n $path\n );\n $this->findAndReplaceHelper->findReplace(\n RelationsGenerator::FIND_ENTITY_INTERFACE_NAME,\n $this->namespaceHelper->basename($this->entityInterfaceFqn),\n $path\n );\n $this->findAndReplaceHelper->replaceName($this->singularNamespacedName, $path);\n $this->findAndReplaceHelper->replacePluralName($this->pluralNamespacedName, $path);\n $this->findAndReplaceHelper->replaceProjectNamespace($this->projectRootNamespace, $path);\n }", "protected function loadViewsFrom($path, $namespace)\n\t{\n\t\tif (is_dir($appPath = $this->app->basePath().'/resources/views/vendor/'.$namespace)) {\n\t\t\t$this->app['view']->addNamespace($namespace, $appPath);\n\t\t}\n\n\t\t$this->app['view']->addNamespace($namespace, $path);\n\t}", "public function guessPackagePath()\n\t{\n\t\t$path = with(new \\ReflectionClass($this))->getFileName();\n\n\t\treturn realpath(dirname($path).'/../');\n\t}", "static function normalize( $path )\n {\n if( strtoupper( substr( PHP_OS, 0, 3 ) ) == \"WIN\" ){\n $path = preg_replace( '/([^\\\\\\])\\\\\\([^\\\\\\])/', \"$1/$2\", $path );\n if( substr( $path, -1 ) == \"\\\\\" ) $path = substr( $path, 0, -1 );\n if( substr( $path, 0, 1 ) == \"\\\\\" ) $path = \"/\" . substr( $path, 1 );\n }\n\n $path = preg_replace( '/\\/+/s', \"/\", $path );\n\n $path = \"/$path\";\n if( substr( $path, -1 ) != \"/\" )\n $path .= \"/\";\n\n $expr = '/\\/([^\\/]{1}|[^\\.\\/]{2}|[^\\/]{3,})\\/\\.\\.\\//s';\n while( preg_match( $expr, $path ) )\n $path = preg_replace( $expr, \"/\", $path );\n\n $path = substr( $path, 0, -1 );\n $path = substr( $path, 1 );\n return $path;\n }", "public function g( $namespace )\n\t{\n\t\t$namespace = trim( $namespace, '\\\\' ) ;\n\n\t\t$name = $this->lpop( $namespace );\n\n\t\tif( isset($this->map[$name]) )\n\t\t{\n\t\t\t$namespace = str_replace( $name, $this->map[$name], $namespace ) ;\n\t\t}\n\n\t\treturn str_replace( '\\\\', '/', $namespace );\n\t}", "public function getPath($path);", "public function qualifyClass($name)\n {\n $name = ltrim($name, '\\\\/');\n\n $name = str_replace('/', '\\\\', $name);\n\n $rootNamespace = $this->rootNamespace();\n \n if (Str::startsWith($name, $rootNamespace)) {\n return $name;\n }\n\n return $this->qualifyClass(\n $this->getDefaultNamespace(trim($rootNamespace, '\\\\')).'\\\\'.$name\n );\n }", "function getPathParser();", "protected function resolve(string $path): ClickhouseMigrationContract\n {\n $class = Str::studly(implode('_', array_slice(explode('_', $path), 4)));\n\n return app($class);\n }", "public function getLocalPath($path);", "function truepath($path){\n $unipath=strlen($path)==0 || $path[0]!='/';\n // attempts to detect if path is relative in which case, add cwd\n if(strpos($path,':')===false && $unipath)\n $path=getcwd().DIRECTORY_SEPARATOR.$path;\n // resolve path parts (single dot, double dot and double delimiters)\n $path = str_replace(array('/', '\\\\'), DIRECTORY_SEPARATOR, $path);\n $parts = array_filter(explode(DIRECTORY_SEPARATOR, $path), 'strlen');\n $absolutes = array();\n foreach ($parts as $part) {\n if ('.' == $part) continue;\n if ('..' == $part) {\n array_pop($absolutes);\n } else {\n $absolutes[] = $part;\n }\n }\n $path=implode(DIRECTORY_SEPARATOR, $absolutes);\n // resolve any symlinks\n if(file_exists($path) && linkinfo($path)>0)$path=readlink($path);\n // put initial separator that could have been lost\n $path=!$unipath ? '/'.$path : $path;\n return $path;\n}", "protected function changeDotToSlash($path)\n {\n $path = str_replace('.', '/', $path);\n\n return $path;\n }", "public static function normalizePath( $path ) {\n\t\t$segments = explode( '/', $path );\n\t\t$segments = array_reverse( $segments );\n\n\t\t$path = [];\n\t\t$path_len = 0;\n\n\t\twhile ( $segments ) {\n\t\t\t$segment = array_pop( $segments );\n\t\t\tswitch ( $segment ) {\n\n\t\t\t\tcase '.':\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase '..':\n\t\t\t\t\t// @phan-suppress-next-line PhanTypeInvalidDimOffset False positive\n\t\t\t\t\tif ( !$path_len || ( $path[$path_len - 1] === '..' ) ) {\n\t\t\t\t\t\t$path[] = $segment;\n\t\t\t\t\t\t$path_len++;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tarray_pop( $path );\n\t\t\t\t\t\t$path_len--;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\t\t$path[] = $segment;\n\t\t\t\t\t$path_len++;\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\treturn implode( '/', $path );\n\t}", "protected function findInNamespace($name)\n {\n // Split the namespace::name (or throw an exception)\n list($namespace, $name) = $this->getNamespaceSegments($name);\n\n // No exception, so we have known namespace. Find the file in its paths.\n return $this->findInPaths($name, $this->namespacePaths[$namespace]);\n }", "public function resolve(string $class)\n {\n if (array_key_exists($class, $this->aliases)) {\n $class = $this->aliases[$class];\n }\n\n if (array_key_exists($class, $this->bindings)) {\n $className = $this->bindings[$class];\n\n return $className($this->app);\n }\n\n if (array_key_exists($class, $this->singletons)) {\n $singleton = $this->singletons[$class];\n\n if (is_null($singleton[1])) {\n $this->singletons[$class][1] = $singleton[0]($this->app);\n return $this->resolve($class);\n }\n\n return $singleton[1];\n }\n\n throw new \\InvalidArgumentException(\"Aucun binding pour $class\");\n }", "public function camelizeNamespace($camelize);", "function translatePath($path) {\n global $synAdminPath;\n if (strpos($path,\"§syntaxRelativePath§\")!==false) $path=str_replace(\"§syntaxRelativePath§\",$synAdminPath,$path);\n return $path;\n }", "public function testLookupNamespaceReturnsStringWhenAddedToElementElementAndParentPrefixBoundToNamespace(): void\n {\n $parent = new ElementElement();\n $parent->setTypeElement($this->sut);\n $parent->bindNamespace('foo', 'http://example.org/foo');\n self::assertSame('http://example.org/foo', $this->sut->lookupNamespace('foo'));\n }", "public function locatePath($path)\n {\n $startUrl = rtrim($this->getMinkParameter('base_url'), '/') . '/';\n\n return 0 !== strpos($path, 'http') ? $startUrl . ltrim($path, '/') : $path;\n }", "static public function resolvePath($path) {\n\t\tif (!self::$mounts) {\n\t\t\t\\OC_Util::setupFS();\n\t\t}\n\t\t$mount = self::$mounts->find($path);\n\t\tif ($mount) {\n\t\t\treturn array($mount->getStorage(), $mount->getInternalPath($path));\n\t\t} else {\n\t\t\treturn array(null, null);\n\t\t}\n\t}", "static public function register($namespace, $path, $root = true): Autoloader {\n spl_autoload_register([\n $self = new self(\n $namespace .= '\\\\',\n $path,\n $root ? null : $namespace\n ),\n 'load',\n ], true, true);\n return $self;\n }", "protected function resolveTypoScriptPath($path) {\n\t\t$pathExploded = explode('.', trim($path));\n\t\t$depth = count($pathExploded);\n\t\t$pathBranch = $GLOBALS['TSFE']->tmpl->setup;\n\t\t$value = '';\n\n\t\tfor($i = 0; $i < $depth; $i++) {\n\t\t\tif ($i < ($depth -1 )) {\n\t\t\t\t$pathBranch = $pathBranch[$pathExploded[$i] . '.'];\n\t\t\t} elseif(empty($pathExploded[$i])) {\n\t\t\t\t\t// It ends with a dot. We return the rest of the array\n\t\t\t\t$value = $pathBranch;\n\t\t\t} else {\n\t\t\t\t\t// It endes without a dot. We return the value.\n\t\t\t\t$value = $pathBranch[$pathExploded[$i]];\n\t\t\t}\n\t\t}\n\n\t\treturn $value;\n\t}" ]
[ "0.59662414", "0.5954521", "0.59179664", "0.5859895", "0.58462346", "0.5745527", "0.5646439", "0.5627549", "0.56130826", "0.5540547", "0.54984045", "0.54783", "0.54587895", "0.54467314", "0.5393203", "0.5348637", "0.52708507", "0.5186164", "0.5183724", "0.5178166", "0.515982", "0.5149582", "0.5134781", "0.5045884", "0.5045681", "0.5016259", "0.50089025", "0.500693", "0.4949033", "0.49464068", "0.49276888", "0.49231628", "0.4911803", "0.4877459", "0.4874607", "0.4870595", "0.4863483", "0.48378345", "0.48303017", "0.47991946", "0.47661313", "0.47490555", "0.47317457", "0.47070584", "0.46940076", "0.46711618", "0.4664142", "0.46379662", "0.4634597", "0.46298176", "0.4599104", "0.45986602", "0.45888516", "0.45774767", "0.457289", "0.45588118", "0.4554078", "0.45503774", "0.45394844", "0.4518569", "0.45174035", "0.4511846", "0.45038903", "0.45022365", "0.4452124", "0.4444582", "0.44268098", "0.44229195", "0.44207957", "0.44158953", "0.44156882", "0.44155395", "0.44127843", "0.44098398", "0.44024754", "0.43754813", "0.43721664", "0.4371402", "0.43697676", "0.4366434", "0.43663198", "0.4359092", "0.4358234", "0.4354031", "0.43447033", "0.43386552", "0.4338513", "0.43383628", "0.4334786", "0.4328464", "0.43151516", "0.431159", "0.43044725", "0.4298927", "0.4296151", "0.42917338", "0.42885974", "0.42846638", "0.4282055", "0.42811215" ]
0.6234157
0
Run the database seeds.
public function run() { DB::table('roles')->insert([ ['nama_role'=>'admin'], ['nama_role'=>'kepalasekolah'], ['nama_role'=>'guru'], ['nama_role'=>'siswa'] ]); $id_role_admin = DB::table('roles')->where('nama_role','=','admin')->first(); $id_role_kepalasekolah = DB::table('roles')->where('nama_role','=','kepalasekolah')->first(); $id_role_guru = DB::table('roles')->where('nama_role','=','guru')->first(); $id_role_siswa = DB::table('roles')->where('nama_role','=','siswa')->first(); DB::table('users')->insert([ [ 'name'=>'admin', 'username'=>'admin', 'email'=>'admin@gmail.com', 'id_role'=>$id_role_admin->id, 'password'=>Hash::make('admin') ], [ 'name'=>'kepalasekolah', 'username'=>'kepalasekolah', 'email'=>'kepalasekolah@gmail.com', 'id_role'=>$id_role_kepalasekolah->id, 'password'=>Hash::make('kepalasekolah') ], [ 'name'=>'guru', 'username'=>'guru', 'email'=>'guru@gmail.com', 'id_role'=>$id_role_guru->id, 'password'=>Hash::make('guru') ], [ 'name'=>'siswa', 'username'=>'siswa', 'email'=>'siswa@gmail.com', 'id_role'=>$id_role_siswa->id, 'password'=>Hash::make('siswa') ] ]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function run()\n {\n // $this->call(UserTableSeeder::class);\n // $this->call(PostTableSeeder::class);\n // $this->call(TagTableSeeder::class);\n // $this->call(PostTagTableSeeder::class);\n\n /*AB - use faker to populate table see file ModelFactory.php */\n factory(App\\Editeur::class, 40) ->create();\n factory(App\\Auteur::class, 40) ->create();\n factory(App\\Livre::class, 80) ->create();\n\n for ($i = 1; $i < 41; $i++) {\n $number = rand(2, 8);\n for ($j = 1; $j <= $number; $j++) {\n DB::table('auteur_livre')->insert([\n 'livre_id' => rand(1, 40),\n 'auteur_id' => $i\n ]);\n }\n }\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n // Let's truncate our existing records to start from scratch.\n Assignation::truncate();\n\n $faker = \\Faker\\Factory::create();\n \n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 40; $i++) {\n Assignation::create([\n 'ad_id' => $faker->numberBetween(1,20),\n 'buyer_id' => $faker->numberBetween(1,6),\n 'seller_id' => $faker->numberBetween(6,11),\n 'state' => NULL,\n ]);\n }\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n \t$faker = Faker::create();\n\n \tfor($i=0; $i<20; $i++) {\n \t\t$post = new Post;\n \t\t$post->title = $faker->sentence();\n \t\t$post->body = $faker->paragraph();\n \t\t$post->category_id = rand(1, 5);\n \t\t$post->save();\n \t}\n\n \t$list = ['General', 'Technology', 'News', 'Internet', 'Mobile'];\n \tforeach($list as $name) {\n \t\t$category = new Category;\n \t\t$category->name = $name;\n \t\t$category->save();\n \t}\n\n \tfor($i=0; $i<20; $i++) {\n \t\t$comment = new Comment;\n \t\t$comment->comment = $faker->paragraph();\n \t\t$comment->post_id = rand(1,20);\n \t\t$comment->save();\n \t}\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n $this->call(RoleTableSeeder::class);\n $this->call(UserTableSeeder::class);\n \n factory('App\\Cat', 5)->create();\n $tags = factory('App\\Tag', 8)->create();\n\n factory(Post::class, 15)->create()->each(function($post) use ($tags){\n $post->comments()->save(factory(Comment::class)->make());\n $post->tags()->attach( $tags->random(mt_rand(1,4))->pluck('id')->toArray() );\n });\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::table('post')->insert(\n [\n 'title' => 'Test Post1',\n 'desc' => str_random(100).\" post1\",\n 'alias' => 'test1',\n 'keywords' => 'test1',\n ]\n );\n DB::table('post')->insert(\n [\n 'title' => 'Test Post2',\n 'desc' => str_random(100).\" post2\",\n 'alias' => 'test2',\n 'keywords' => 'test2',\n ]\n );\n DB::table('post')->insert(\n [\n 'title' => 'Test Post3',\n 'desc' => str_random(100).\" post3\",\n 'alias' => 'test3',\n 'keywords' => 'test3',\n ]\n );\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n \t$faker = Factory::create();\n \t\n \tforeach ($this->departments as $key => $department) {\n \t\tDepartment::create([\n \t\t\t'name' => $department\n \t\t]);\n \t}\n \tforeach ($this->collections as $key => $collection) {\n \t\tCollection::create([\n \t\t\t'name' => $collection\n \t\t]);\n \t}\n \t\n \t\n \tfor ($i=0; $i < 40; $i++) {\n \t\tUser::create([\n \t\t\t'name' \t=>\t$faker->name,\n \t\t\t'email' \t=>\t$faker->email,\n \t\t\t'password' \t=>\tbcrypt('123456'),\n \t\t]);\n \t} \n \t\n \t\n \tforeach ($this->departments as $key => $department) {\n \t\t//echo ($key + 1) . PHP_EOL;\n \t\t\n \t\tfor ($i=0; $i < 10; $i++) { \n \t\t\techo $faker->name . PHP_EOL;\n\n \t\t\tArt::create([\n \t\t\t\t'name'\t\t\t=> $faker->sentence(2),\n \t\t\t\t'img'\t\t\t=> $this->filenames[$i],\n \t\t\t\t'medium'\t\t=> 'canvas',\n \t\t\t\t'department_id'\t=> $key + 1,\n \t\t\t\t'user_id'\t\t=> $this->userIndex,\n \t\t\t\t'dimension'\t\t=> '18.0 x 24.0',\n\t\t\t\t]);\n \t\t\t\t\n \t\t\t\t$this->userIndex ++;\n \t\t}\n \t}\n \t\n \tdd(\"END\");\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // $this->dataCategory();\n factory(App\\Model\\Category::class, 70)->create();\n factory(App\\Model\\Producer::class, rand(5,10))->create();\n factory(App\\Model\\Provider::class, rand(5,10))->create();\n factory(App\\Model\\Product::class, 100)->create();\n factory(App\\Model\\Album::class, 300)->create();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n\n factory('App\\User', 10 )->create();\n\n $users= \\App\\User::all();\n $users->each(function($user){ factory('App\\Category', 1)->create(['user_id'=>$user->id]); });\n $users->each(function($user){ factory('App\\Tag', 3)->create(['user_id'=>$user->id]); });\n\n\n $users->each(function($user){\n factory('App\\Post', 10)->create([\n 'user_id'=>$user->id,\n 'category_id'=>rand(1,20)\n ]\n );\n });\n\n $posts= \\App\\Post::all();\n $posts->each(function ($post){\n\n $post->tags()->attach(array_unique([rand(1,20),rand(1,20),rand(1,20)]));\n });\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $types = factory(\\App\\Models\\Type::class, 5)->create();\n\n $cities = factory(\\App\\Models\\City::class, 10)->create();\n\n $cities->each(function ($city) {\n $districts = factory(\\App\\Models\\District::class, rand(2, 5))->create([\n 'city_id' => $city->id,\n ]);\n\n $districts->each(function ($district) {\n $properties = factory(\\App\\Models\\Property::class, rand(2, 5))->create([\n 'type_id' => rand(1, 5),\n 'district_id' => $district->id\n ]);\n\n $properties->each(function ($property) {\n $galleries = factory(\\App\\Models\\Gallery::class, rand(3, 10))->create([\n 'property_id' => $property->id\n ]);\n });\n });\n });\n }", "public function run()\n {\n $this->call(UsersTableSeeder::class);\n\n $categories = factory(App\\Models\\Category::class, 10)->create();\n\n $categories->each(function ($category) {\n $category\n ->posts()\n ->saveMany(\n factory(App\\Models\\Post::class, 3)->make()\n );\n });\n }", "public function run()\n {\n $this->call(CategoriesTableSeeder::class);\n\n $users = factory(App\\User::class, 5)->create();\n $recipes = factory(App\\Recipe::class, 30)->create();\n $preparations = factory(App\\Preparation::class, 70)->create();\n $photos = factory(App\\Photo::class, 90)->create();\n $comments = factory(App\\Comment::class, 200)->create();\n $flavours = factory(App\\Flavour::class, 25)->create();\n $flavour_recipe = factory(App\\FlavourRecipe::class, 50)->create();\n $tags = factory(App\\Tag::class, 25)->create();\n $recipe_tag = factory(App\\RecipeTag::class, 50)->create();\n $ingredients = factory(App\\Ingredient::class, 25)->create();\n $ingredient_preparation = factory(App\\IngredientPreparation::class, 300)->create();\n \n \n \n DB::table('users')->insert(['name' => 'SimpleUtilisateur', 'email' => 'simpleadressemail@mail.com', 'password' => bcrypt('SimpleMotDePasse')]);\n \n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n // Sample::truncate();\n // TestItem::truncate();\n // UOM::truncate();\n Role::truncate();\n User::truncate();\n\n // factory(Role::class, 4)->create();\n Role::create([\n 'name'=> 'Director',\n 'description'=> 'Director type'\n ]);\n\n Role::create([\n 'name'=> 'Admin',\n 'description'=> 'Admin type'\n ]);\n Role::create([\n 'name'=> 'Employee',\n 'description'=> 'Employee type'\n ]);\n Role::create([\n 'name'=> 'Technician',\n 'description'=> 'Technician type'\n ]);\n \n factory(User::class, 20)->create()->each(\n function ($user){\n $roles = \\App\\Role::all()->random(mt_rand(1, 2))->pluck('id');\n $user->roles()->attach($roles);\n }\n );\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n UsersLevel::create([\n 'name' => 'Administrator'\n ]);\n\n UsersLevel::create([\n 'name' => 'User'\n ]);\n\n User::create([\n 'username' => 'admin',\n 'password' => bcrypt('admin123'),\n 'level_id' => 1,\n 'fullname' => \"Super Admin\",\n 'email'=> \"admin@admin.com\"\n ]);\n\n\n \\App\\CategoryPosts::create([\n 'name' =>'Paket Trip'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' =>'Destinasi Kuliner'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' => 'Event'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' => 'Profil'\n ]);\n }", "public function run()\n {\n DB::table('users')->insert([\n 'name' => 'Admin',\n 'email' => 'admin@petstore.com',\n 'avatar' => \"avatar\",\n 'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi',\n ]);\n $this->call(CategorySeeder::class);\n // \\App\\Models\\Admin::factory(1)->create();\n \\App\\Models\\User::factory(10)->create();\n // \\App\\Models\\Category::factory(50)->create();\n \\App\\Models\\PetComment::factory(50)->create();\n $pets = \\App\\Models\\Pet::factory(50)->create();\n foreach ($pets as $pet) {\n \\App\\Models\\PetTag::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\PetPhotoUrl::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\Order::factory(1)->create(['pet_id' => $pet->id]);\n };\n }", "public function run()\n { \n\n $this->call(RoleSeeder::class);\n \n $this->call(UserSeeder::class);\n\n Storage::deleteDirectory('socials-icon');\n Storage::makeDirectory('socials-icon');\n $socials = Social::factory(7)->create();\n\n Storage::deleteDirectory('countries-flag');\n Storage::deleteDirectory('countries-firm');\n Storage::makeDirectory('countries-flag');\n Storage::makeDirectory('countries-firm');\n $countries = Country::factory(18)->create();\n\n // Se llenan datos de la tabla muchos a muchos - social_country\n foreach ($countries as $country) {\n foreach ($socials as $social) {\n\n $country->socials()->attach($social->id, [\n 'link' => 'https://www.facebook.com/ministeriopalabrayespiritu/'\n ]);\n }\n }\n\n Person::factory(50)->create();\n\n Category::factory(7)->create();\n\n Video::factory(25)->create(); \n\n $this->call(PostSeeder::class);\n\n Storage::deleteDirectory('documents');\n Storage::makeDirectory('documents');\n Document::factory(25)->create();\n\n }", "public function run()\n {\n $faker = Faker::create('id_ID');\n /**\n * Generate fake author data\n */\n for ($i=1; $i<=50; $i++) { \n DB::table('author')->insert([\n 'name' => $faker->name\n ]);\n }\n /**\n * Generate fake publisher data\n */\n for ($i=1; $i<=50; $i++) { \n DB::table('publisher')->insert([\n 'name' => $faker->name\n ]);\n }\n /**\n * Seeding payment method\n */\n DB::table('payment')->insert([\n ['name' => 'Mandiri'],\n ['name' => 'BCA'],\n ['name' => 'BRI'],\n ['name' => 'BNI'],\n ['name' => 'Pos Indonesia'],\n ['name' => 'BTN'],\n ['name' => 'Indomaret'],\n ['name' => 'Alfamart'],\n ['name' => 'OVO'],\n ['name' => 'Cash On Delivery']\n ]);\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n // MyList::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 3; $i++) {\n MyList::create([\n 'title' => 'List-'.($i+1),\n 'color' => $faker->sentence,\n 'icon' => $faker->randomDigitNotNull,\n 'index' => $faker->randomDigitNotNull,\n 'user_id' => 1,\n ]);\n }\n }", "public function run()\n {\n DatabaseSeeder::seedLearningStylesProbs();\n DatabaseSeeder::seedCampusProbs();\n DatabaseSeeder::seedGenderProbs();\n DatabaseSeeder::seedTypeStudentProbs();\n DatabaseSeeder::seedTypeProfessorProbs();\n DatabaseSeeder::seedNetworkProbs();\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n Products::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few products in our database:\n for ($i = 0; $i < 50; $i++) {\n Products::create([\n 'name' => $faker->word,\n 'sku' => $faker->randomNumber(7, false),\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n User::create([\n 'name' => 'Pablo Rosales',\n 'email' => 'prosales@researchmobile.co',\n 'password' => bcrypt('admin'),\n 'status' => 1,\n 'role_id' => 1,\n 'movil' => 0\n ]);\n\n User::create([\n 'name' => 'Usuario Movil',\n 'email' => 'movil@researchmobile.co',\n 'password' => bcrypt('secret'),\n 'status' => 1,\n 'role_id' => 3,\n 'movil' => 1\n ]);\n\n Roles::create([\n 'name' => 'Administrador'\n ]);\n Roles::create([\n 'name' => 'Operaciones'\n ]);\n Roles::create([\n 'name' => 'Comercial'\n ]);\n Roles::create([\n 'name' => 'Aseguramiento'\n ]);\n Roles::create([\n 'name' => 'Facturación'\n ]);\n Roles::create([\n 'name' => 'Creditos y Cobros'\n ]);\n\n factory(App\\Customers::class, 100)->create();\n }", "public function run()\n {\n // php artisan db:seed --class=StoreTableSeeder\n\n foreach(range(1,20) as $i){\n $faker = Faker::create();\n Store::create([\n 'name' => $faker->name,\n 'desc' => $faker->text,\n 'tags' => $faker->word,\n 'address' => $faker->address,\n 'longitude' => $faker->longitude($min = -180, $max = 180),\n 'latitude' => $faker->latitude($min = -90, $max = 90),\n 'created_by' => '1'\n ]);\n }\n\n }", "public function run()\n {\n DB::table('users')->insert([\n 'name'=>\"test\",\n 'password' => Hash::make('123'),\n 'email'=>'test@yandex.ru'\n ]);\n DB::table('tags')->insert(['name'=>'tags']);\n $this->call(UserSeed::class);\n $this->call(CategoriesSeed::class);\n $this->call(TopicsSeed::class);\n $this->call(CommentariesSeed::class);\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n echo 'seeding permission...', PHP_EOL;\n $permissions = [\n 'role-list',\n 'role-create',\n 'role-edit',\n 'role-delete',\n 'formation-list',\n 'formation-create',\n 'formation-edit',\n 'formation-delete',\n 'user-list',\n 'user-create',\n 'user-edit',\n 'user-delete'\n ];\n foreach ($permissions as $permission) {\n Permission::create(['name' => $permission]);\n }\n echo 'seeding users...', PHP_EOL;\n\n $user= User::create(\n [\n 'name' => 'Mr. admin',\n 'email' => 'admin@yahoo.com',\n 'password' => bcrypt('admin'),\n 'remember_token' => null,\n ]\n );\n echo 'Create Roles...', PHP_EOL;\n Role::create(['name' => 'former']);\n Role::create(['name' => 'learner']);\n Role::create(['name' => 'admin']);\n Role::create(['name' => 'manager']);\n Role::create(['name' => 'user']);\n\n echo 'seeding Role User...', PHP_EOL;\n $user->assignRole('admin');\n $role = $user->assignRole('admin');\n $role->givepermissionTo(Permission::all());\n\n \\DB::table('languages')->insert(['name' => 'English', 'code' => 'en']);\n \\DB::table('languages')->insert(['name' => 'Français', 'code' => 'fr']);\n }", "public function run()\n {\n $this->call(UsersTableSeeder::class);\n $this->call(PermissionsSeeder::class);\n $this->call(RolesSeeder::class);\n $this->call(ThemeSeeder::class);\n\n //\n\n DB::table('paypal_info')->insert([\n 'client_id' => '',\n 'client_secret' => '',\n 'currency' => '',\n ]);\n DB::table('contact_us')->insert([\n 'content' => '',\n ]);\n DB::table('setting')->insert([\n 'site_name' => ' ',\n ]);\n DB::table('terms_and_conditions')->insert(['terms_and_condition' => 'text']);\n }", "public function run()\n {\n $this->call([\n UserSeeder::class,\n ]);\n\n User::factory(20)->create();\n Author::factory(20)->create();\n Book::factory(60)->create();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // DB::table('roles')->insert(\n // [\n // ['name' => 'admin', 'description' => 'Administrator'],\n // ['name' => 'student', 'description' => 'Student'],\n // ['name' => 'lab_tech', 'description' => 'Lab Tech'],\n // ['name' => 'it_staff', 'description' => 'IT Staff Member'],\n // ['name' => 'it_manager', 'description' => 'IT Manager'],\n // ['name' => 'lab_manager', 'description' => 'Lab Manager'],\n // ]\n // );\n\n // DB::table('users')->insert(\n // [\n // 'username' => 'admin', \n // 'password' => Hash::make('password'), \n // 'active' => 1,\n // 'name' => 'Administrator',\n // 'email' => 'programmerlemar@gmail.com',\n // 'role_id' => \\App\\Role::where('name', 'admin')->first()->id\n // ]\n // );\n\n DB::table('status')->insert([\n // ['name' => 'Active'],\n // ['name' => 'Cancel'],\n // ['name' => 'Disable'],\n // ['name' => 'Open'],\n // ['name' => 'Closed'],\n // ['name' => 'Resolved'],\n ['name' => 'Used'],\n ]);\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(UserSeeder::class);\n $this->call(RolePermissionSeeder::class);\n $this->call(AppmodeSeeder::class);\n\n // \\App\\Models\\Appmode::factory(3)->create();\n \\App\\Models\\Doctor::factory(100)->create();\n \\App\\Models\\Unit::factory(50)->create();\n \\App\\Models\\Broker::factory(100)->create();\n \\App\\Models\\Patient::factory(100)->create();\n \\App\\Models\\Expence::factory(100)->create();\n \\App\\Models\\Testcategory::factory(100)->create();\n \\App\\Models\\Test::factory(50)->create();\n \\App\\Models\\Parameter::factory(50)->create();\n \\App\\Models\\Sale::factory(50)->create();\n \\App\\Models\\SaleItem::factory(100)->create();\n \\App\\Models\\Goption::factory(1)->create();\n \\App\\Models\\Pararesult::factory(50)->create();\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n factory(User::class)->create([\n 'name' => 'Qwerty',\n 'email' => 'qwerty@gmail.com',\n 'password' => bcrypt('secretpassw'),\n ]);\n\n factory(User::class, 59)->create([\n 'password' => bcrypt('secretpassw'),\n ]);\n\n for ($i = 1; $i < 11; $i++) {\n factory(Category::class)->create([\n 'name' => 'Category ' . $i,\n ]);\n }\n\n for ($i = 1; $i < 101; $i++) {\n factory(Product::class)->create([\n 'name' => 'Product ' . $i,\n ]);\n }\n }", "public function run()\n {\n\n \t// Making main admin role\n \tDB::table('roles')->insert([\n 'name' => 'Admin',\n ]);\n\n // Making main category\n \tDB::table('categories')->insert([\n 'name' => 'Other',\n ]);\n\n \t// Making main admin account for testing\n \tDB::table('users')->insert([\n 'name' \t\t=> 'Admin',\n 'email' \t=> 'admin@example.com',\n 'password' => bcrypt('12345'),\n 'role_id' => 1,\n 'created_at' => date('Y-m-d H:i:s' ,time()),\n 'updated_at' => date('Y-m-d H:i:s' ,time())\n ]);\n\n \t// Making random users and posts\n factory(App\\User::class, 10)->create();\n factory(App\\Post::class, 35)->create();\n }", "public function run()\n {\n $faker = Faker::create();\n\n \\DB::table('positions')->insert(array (\n 'codigo' => strtoupper($faker->randomLetter).$faker->postcode,\n 'nombre' => 'Chef',\n 'salario' => '15000.00'\n ));\n\n\t\t \\DB::table('positions')->insert(array (\n 'codigo' => strtoupper($faker->randomLetter).$faker->postcode,\n 'nombre' => 'Mesonero',\n 'salario' => '12000.00'\n ));\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker = \\Faker\\Factory::create();\n\n foreach (range(1,5) as $index) {\n Lista::create([\n 'name' => $faker->sentence(2),\n 'description' => $faker->sentence(10), \n ]);\n } \n\n foreach (range(1,20) as $index) {\n $n = $faker->sentence(2);\n \tTarea::create([\n \t\t'name' => $n,\n \t\t'description' => $faker->sentence(10),\n 'lista_id' => $faker->numberBetween(1,5),\n 'slug' => Str::slug($n),\n \t\t]);\n } \n }", "public function run()\n {\n $faker = Faker::create('lt_LT');\n\n DB::table('users')->insert([\n 'name' => 'user',\n 'email' => 'briedis@aa.bb',\n 'password' => Hash::make('123')\n ]);\n DB::table('users')->insert([\n 'name' => 'user2',\n 'email' => 'briedis2@aa.bb',\n 'password' => Hash::make('123')\n ]);\n\n foreach (range(1,100) as $val)\n DB::table('authors')->insert([\n 'name' => $faker->firstName(),\n 'surname' => $faker->lastName(),\n \n ]);\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(UsersTableSeeder::class);\n\n // DB::table('users')->insert([\n // 'name' => 'User1',\n // 'email' => 'admin@admin.com',\n // 'password' => bcrypt('password'),\n // ]);\n\n\n $faker = Faker::create();\n \n foreach (range(1,10) as $index){\n DB::table('companies')->insert([\n 'name' => $faker->company(),\n 'email' => $faker->email(10).'@gmail.com',\n 'logo' => $faker->image($dir = '/tmp', $width = 640, $height = 480),\n 'webiste' => $faker->domainName(),\n \n ]);\n }\n \n \n foreach (range(1,10) as $index){\n DB::table('employees')->insert([\n 'first_name' => $faker->firstName(),\n 'last_name' => $faker->lastName(),\n 'company' => $faker->company(),\n 'email' => $faker->str_random(10).'@gmail.com',\n 'phone' => $faker->e164PhoneNumber(),\n \n ]);\n }\n\n\n\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n Flight::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 100; $i++) {\n\n\n Flight::create([\n 'flightNumber' => $faker->randomNumber(5),\n 'depAirport' => $faker->city,\n 'destAirport' => $faker->city,\n 'reservedWeight' => $faker->numberBetween(1000 - 10000),\n 'deptTime' => $faker->dateTime('now'),\n 'arrivalTime' => $faker->dateTime('now'),\n 'reservedVolume' => $faker->numberBetween(1000 - 10000),\n 'airlineName' => $faker->colorName,\n ]);\n }\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->truncteTables([\n 'users',\n 'products'\n ]);\n\n $this->call(UsersSeeder::class);\n $this->call(ProductsSeeder::class);\n\n }", "public function run()\n {\n /**\n * Dummy seeds\n */\n DB::table('metas')->truncate();\n $faker = Faker::create();\n\n for ($i=0; $i < 10; $i++) { \n DB::table('metas')->insert([\n 'id_rel' => $faker->randomNumber(),\n 'titulo' => $faker->sentence,\n 'descricao' => $faker->paragraph,\n 'justificativa' => $faker->paragraph,\n 'valor_inicial' => $faker->numberBetween(0,100),\n 'valor_atual' => $faker->numberBetween(0,100),\n 'valor_final' => $faker->numberBetween(0,10),\n 'regras' => json_encode([$i => [\"values\" => $faker->words(3)]]),\n 'types' => json_encode([$i => [\"values\" => $faker->words(2)]]),\n 'categorias' => json_encode([$i => [\"values\" => $faker->words(4)]]),\n 'tags' => json_encode([$i => [\"values\" => $faker->words(5)]]),\n 'active' => true,\n ]);\n }\n\n\n }", "public function run()\n {\n // $this->call(UserTableSeeder::class);\n\n $faker = Faker::create();\n\n $lessonIds = Lesson::lists('id')->all(); // An array of ID's in that table [1, 2, 3, 4, 5, 7]\n $tagIds = Tag::lists('id')->all();\n\n foreach(range(1, 30) as $index)\n {\n // a real lesson id\n // a real tag id\n DB::table('lesson_tag')->insert([\n 'lesson_id' => $faker->randomElement($lessonIds),\n 'tag_id' => $faker->randomElement($tagIds),\n ]);\n }\n }", "public function run()\n {\n // \\DB::statement('SET_FOREIGN_KEY_CHECKS=0');\n \\DB::table('users')->truncate();\n \\DB::table('posts')->truncate();\n // \\DB::table('category')->truncate();\n \\DB::table('photos')->truncate();\n \\DB::table('comments')->truncate();\n \\DB::table('comment_replies')->truncate();\n\n \\App\\Models\\User::factory()->times(10)->hasPosts(1)->create();\n \\App\\Models\\Role::factory()->times(10)->create();\n \\App\\Models\\Category::factory()->times(10)->create();\n \\App\\Models\\Comment::factory()->times(10)->hasReplies(1)->create();\n \\App\\Models\\Photo::factory()->times(10)->create();\n\n \n // \\App\\Models\\User::factory(10)->create([\n // 'role_id'=>2,\n // 'is_active'=>1\n // ]);\n\n // factory(App\\Models\\Post::class, 10)->create();\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n Language::truncate();\n Reason::truncate();\n Report::truncate();\n Category::truncate();\n Position::truncate();\n\n $languageQuantity = 10;\n $reasonQuantity = 10;\n $reportQuantity = 10;\n $categoryQuantity = 10;\n $positionQuantity = 10;\n\n factory(Language::class,$languageQuantity)->create();\n factory(Reason::class,$reasonQuantity)->create();\n \n factory(Report::class,$reportQuantity)->create();\n \n factory(Category::class,$categoryQuantity)->create();\n \n factory(Position::class,$positionQuantity)->create();\n\n }", "public function run()\n {\n $this->call(CategoriasTableSeeder::class);\n $this->call(UfsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n $this->call(UserTiposTableSeeder::class);\n factory(App\\User::class, 2)->create();\n/* factory(App\\Models\\Categoria::class, 20)->create();*/\n/* factory(App\\Models\\Anuncio::class, 50)->create();*/\n }", "public function run()\n {\n $this->call([\n ArticleSeeder::class, \n TagSeeder::class,\n Arttagrel::class\n ]);\n // \\App\\Models\\User::factory(10)->create();\n \\App\\Models\\Article::factory()->count(7)->create();\n \\App\\Models\\Tag::factory()->count(15)->create(); \n \\App\\Models\\Arttagrel::factory()->count(15)->create(); \n }", "public function run()\n {\n $this->call(ArticulosTableSeeder::class);\n /*DB::table('articulos')->insert([\n 'titulo' => str_random(50),\n 'cuerpo' => str_random(200),\n ]);*/\n }", "public function run()\n {\n $this->call(CategoryTableSeeder::class);\n $this->call(ProductTableSeeder::class);\n\n \t\t\n\t\t\tDB::table('users')->insert([\n 'first_name' => 'Ignacio',\n 'last_name' => 'Garcia',\n 'email' => 'ignacio@dh.com',\n 'password' => bcrypt('123456'),\n 'role' => '1',\n 'avatar' => 'CGnABxNYYn8N23RWlvTTP6C2nRjOLTf8IJcbLqRP.jpeg',\n ]);\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(RoleSeeder::class);\n $this->call(UserSeeder::class);\n\n Medicamento::factory(50)->create();\n Reporte::factory(5)->create();\n Cliente::factory(200)->create();\n Asigna_valor::factory(200)->create();\n Carga::factory(200)->create();\n }", "public function run()\n {\n \\App\\Models\\Article::factory(20)->create();\n \\App\\Models\\Category::factory(5)->create();\n \\App\\Models\\Comment::factory(40)->create();\n\n \\App\\Models\\User::create([\n \"name\"=>\"Alice\",\n \"email\"=>'alice@gmail.com',\n 'password' => Hash::make('password'),\n ]);\n \\App\\Models\\User::create([\n \"name\"=>\"Bob\",\n \"email\"=>'bob@gmail.com',\n 'password' => Hash::make('password'),\n ]);\n }", "public function run()\n {\n $this->call([\n RoleSeeder::class,\n TicketSeeder::class\n ]);\n\n DB::table('departments')->insert([\n 'abbr' => 'IT',\n 'name' => 'Information Technologies',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ]);\n\n DB::table('users')->insert([\n 'name' => 'admin',\n 'email' => 'admin@gmail.com',\n 'email_verified_at' => Carbon::now(),\n 'password' => Hash::make('admin'),\n 'department_id' => 1,\n 'avatar' => 'default.png',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ]);\n\n DB::table('role_user')->insert([\n 'role_id' => 1,\n 'user_id' => 1\n ]);\n }", "public function run()\n {\n /** \n * Note: You must add these lines to your .env file for this Seeder to work (replace the values, obviously):\n SEEDER_USER_FIRST_NAME = 'Firstname'\n SEEDER_USER_LAST_NAME = 'Lastname'\n\t\tSEEDER_USER_DISPLAY_NAME = 'Firstname Lastname'\n\t\tSEEDER_USER_EMAIL = your.email@domain.com\n SEEDER_USER_PASSWORD = yourpassword\n */\n\t\tDB::table('users')->insert([\n 'user_first_name' => env('SEEDER_USER_FIRST_NAME'),\n 'user_last_name' => env('SEEDER_USER_LAST_NAME'),\n 'user_name' => env('SEEDER_USER_DISPLAY_NAME'),\n\t\t\t'user_email' => env('SEEDER_USER_EMAIL'),\n 'user_status' => 1,\n \t'password' => Hash::make((env('SEEDER_USER_PASSWORD'))),\n 'permission_fk' => 1,\n 'created_at' => Carbon::now()->format('Y-m-d H:i:s'),\n 'updated_at' => Carbon::now()->format('Y-m-d H:i:s')\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class,3)->create()->each(\n \tfunction($user)\n \t{\n \t\t$user->questions()\n \t\t->saveMany(\n \t\t\tfactory(App\\Question::class, rand(2,6))->make()\n \t\t)\n ->each(function ($q) {\n $q->answers()->saveMany(factory(App\\Answer::class, rand(1,5))->make());\n })\n \t}\n );\n }\n}", "public function run()\n {\n $faker = Faker::create();\n\n // $this->call(UsersTableSeeder::class);\n\n DB::table('posts')->insert([\n 'id'=>str_random(1),\n 'user_id'=> str_random(1),\n 'title' => $faker->name,\n 'body' => $faker->safeEmail,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ]);\n }", "public function run()\n\t{\n\t\tDB::table(self::TABLE_NAME)->delete();\n\n\t\tforeach (seed(self::TABLE_NAME) as $row)\n\t\t\t$records[] = [\n\t\t\t\t'id'\t\t\t\t=> $row->id,\n\t\t\t\t'created_at'\t\t=> $row->created_at ?? Carbon::now(),\n\t\t\t\t'updated_at'\t\t=> $row->updated_at ?? Carbon::now(),\n\n\t\t\t\t'sport_id'\t\t\t=> $row->sport_id,\n\t\t\t\t'gender_id'\t\t\t=> $row->gender_id,\n\t\t\t\t'tournamenttype_id'\t=> $row->tournamenttype_id ?? null,\n\n\t\t\t\t'name'\t\t\t\t=> $row->name,\n\t\t\t\t'external_id'\t\t=> $row->external_id ?? null,\n\t\t\t\t'is_top'\t\t\t=> $row->is_top ?? null,\n\t\t\t\t'logo'\t\t\t\t=> $row->logo ?? null,\n\t\t\t\t'position'\t\t\t=> $row->position ?? null,\n\t\t\t];\n\n\t\tinsert(self::TABLE_NAME, $records ?? []);\n\t}", "public function run()\n\t{\n\t\tDB::table('libros')->truncate();\n\n\t\t$faker = Faker\\Factory::create();\n\n\t\tfor ($i=0; $i < 10; $i++) { \n\t\t\tLibro::create([\n\n\t\t\t\t'titulo'\t\t=> $faker->text(40),\n\t\t\t\t'isbn'\t\t\t=> $faker->numberBetween(100,999),\n\t\t\t\t'precio'\t\t=> $faker->randomFloat(2,3,150),\n\t\t\t\t'publicado'\t\t=> $faker->numberBetween(0,1),\n\t\t\t\t'descripcion'\t=> $faker->text(400),\n\t\t\t\t'autor_id'\t\t=> $faker->numberBetween(1,3),\n\t\t\t\t'categoria_id'\t=> $faker->numberBetween(1,3)\n\n\t\t\t]);\n\t\t}\n\n\t\t// Uncomment the below to run the seeder\n\t\t// DB::table('libros')->insert($libros);\n\t}", "public function run()\n {\n // for($i=1;$i<11;$i++){\n // DB::table('post')->insert(\n // ['title' => 'Title'.$i,\n // 'post' => 'Post'.$i,\n // 'slug' => 'Slug'.$i]\n // );\n // }\n $faker = Faker\\Factory::create();\n \n for($i=1;$i<20;$i++){\n $dname = $faker->name;\n DB::table('post')->insert(\n ['title' => $dname,\n 'post' => $faker->text($maxNbChars = 200),\n 'slug' => str_slug($dname)]\n );\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class, 10)->create()->each(function ($user) {\n // Seed the relation with 5 purchases\n // $videos = factory(App\\Video::class, 5)->make();\n // $user->videos()->saveMany($videos);\n // $user->videos()->each(function ($video){\n // \t$video->videometa()->save(factory(App\\VideoMeta::class)->make());\n // \t// :( \n // });\n factory(App\\User::class, 10)->create()->each(function ($user) {\n\t\t\t factory(App\\Video::class, 5)->create(['user_id' => $user->id])->each(function ($video) {\n\t\t\t \tfactory(App\\VideoMeta::class, 1)->create(['video_id' => $video->id]);\n\t\t\t // $video->videometa()->save(factory(App\\VideoMeta::class)->create(['video_id' => $video->id]));\n\t\t\t });\n\t\t\t});\n\n });\n }", "public function run()\n {\n $this->call([\n CountryTableSeeder::class,\n ProvinceTableSeeder::class,\n TagTableSeeder::class\n ]);\n\n User::factory()->count(10)->create();\n Category::factory()->count(5)->create();\n Product::factory()->count(20)->create();\n Section::factory()->count(5)->create();\n Bundle::factory()->count(20)->create();\n\n $bundles = Bundle::all();\n // populate bundle-product table (morph many-to-many)\n Product::all()->each(function ($product) use ($bundles) {\n $product->bundles()->attach(\n $bundles->random(2)->pluck('id')->toArray(),\n ['default_quantity' => rand(1, 10)]\n );\n });\n // populate bundle-tags table (morph many-to-many)\n Tag::all()->each(function ($tag) use ($bundles) {\n $tag->bundles()->attach(\n $bundles->random(2)->pluck('id')->toArray()\n );\n });\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n Contract::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 50; $i++) {\n Contract::create([\n 'serialnumbers' => $faker->numberBetween($min = 1000000, $max = 2000000),\n 'address' => $faker->address,\n 'landholder' => $faker->lastName,\n 'renter' => $faker->lastName,\n 'price' => $faker->numberBetween($min = 10000, $max = 50000),\n 'rent_start' => $faker->date($format = 'Y-m-d', $max = 'now'),\n 'rent_end' => $faker->date($format = 'Y-m-d', $max = 'now'),\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker=Faker\\Factory::create();\n\n for($i=0;$i<100;$i++){\n \tApp\\Blog::create([\n \t\t'title' => $faker->catchPhrase,\n 'description' => $faker->text,\n 'showns' =>true\n \t\t]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0'); // TO PREVENT CHECKS FOR foreien key in seeding\n\n User::truncate();\n Category::truncate();\n Product::truncate();\n Transaction::truncate();\n\n DB::table('category_product')->truncate();\n\n User::flushEventListeners();\n Category::flushEventListeners();\n Product::flushEventListeners();\n Transaction::flushEventListeners();\n\n $usersQuantities = 1000;\n $categoriesQuantities = 30;\n $productsQuantities = 1000;\n $transactionsQuantities = 1000;\n\n factory(User::class, $usersQuantities)->create();\n factory(Category::class, $categoriesQuantities)->create();\n\n factory(Product::class, $productsQuantities)->create()->each(\n function ($product) {\n $categories = Category::all()->random(mt_rand(1, 5))->pluck('id');\n $product->categories()->attach($categories);\n });\n\n factory(Transaction::class, $transactionsQuantities)->create();\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n $this->call(PermissionsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n\n $this->call(BusinessTableSeeder::class);\n $this->call(PrinterTableSeeder::class);\n factory(App\\Tag::class,10)->create();\n factory(App\\Category::class,10)->create();\n factory(App\\Subcategory::class,50)->create();\n factory(App\\Provider::class,10)->create();\n factory(App\\Product::class,24)->create()->each(function($product){\n\n $product->images()->saveMany(factory(App\\Image::class, 4)->make());\n\n });\n\n\n factory(App\\Client::class,10)->create();\n }", "public function run()\n {\n Article::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 50; $i++) {\n Article::create([\n 'name' => $faker->sentence,\n 'sku' => $faker->paragraph,\n 'price' => $faker->number,\n ]);\n }\n }", "public function run()\n {\n Storage::deleteDirectory('public/products');\n Storage::makeDirectory('public/products');\n\n $this->call(UserSeeder::class);\n Category::factory(4)->create();\n $this->call(ProductSeeder::class);\n Order::factory(4)->create();\n Order_Detail::factory(4)->create();\n Size::factory(100)->create();\n }", "public function run()\n\t{\n\t\t\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n\t\t$faker = \\Faker\\Factory::create();\n\n\t\tTodolist::truncate();\n\n\t\tforeach(range(1, 50) as $index)\n\t\t{\n\n\t\t\t$user = User::create([\n\t\t\t\t'name' => $faker->name,\n\t\t\t\t'email' => $faker->email,\n\t\t\t\t'password' => 'password',\n\t\t\t\t'confirmation_code' => mt_rand(0, 9),\n\t\t\t\t'confirmation' => rand(0,1) == 1\n\t\t\t]);\n\n\t\t\t$list = Todolist::create([\n\t\t\t\t'name' => $faker->sentence(2),\n\t\t\t\t'description' => $faker->sentence(4),\n\t\t\t]);\n\n\t\t\t// BUILD SOME TASKS FOR EACH LIST ITEM\n\t\t\tforeach(range(1, 10) as $index) \n\t\t\t{\n\t\t\t\t$task = new Task;\n\t\t\t\t$task->name = $faker->sentence(2);\n\t\t\t\t$task->description = $faker->sentence(4);\n\t\t\t\t$list->tasks()->save($task);\n\t\t\t}\n\n\t\t}\n\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS = 1'); \n\n\t}", "public function run()\n {\n $this->call(RolSeeder::class);\n\n $this->call(UserSeeder::class);\n Category::factory(4)->create();\n Doctor::factory(25)->create();\n Patient::factory(50)->create();\n Status::factory(3)->create();\n Appointment::factory(100)->create();\n }", "public function run()\n {\n Campus::truncate();\n Canteen::truncate();\n Dorm::truncate();\n\n $faker = Faker\\Factory::create();\n $schools = School::all();\n foreach ($schools as $school) {\n \tforeach (range(1, 2) as $index) {\n\t \t$campus = Campus::create([\n\t \t\t'school_id' => $school->id,\n\t \t\t'name' => $faker->word . '校区',\n\t \t\t]);\n\n \t$campus->canteens()->saveMany(factory(Canteen::class, mt_rand(2,3))->make());\n $campus->dorms()->saveMany(factory(Dorm::class, mt_rand(2,3))->make());\n\n }\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::table('users')->insert([\n 'name' => 'admin',\n 'email' => 'admin@gmail.com',\n 'password' => bcrypt('admin'),\n 'seq_q'=>'1',\n 'seq_a'=>'admin'\n ]);\n\n // DB::table('bloods')->insert([\n // ['name' => 'A+'],\n // ['name' => 'A-'],\n // ['name' => 'B+'],\n // ['name' => 'B-'],\n // ['name' => 'AB+'],\n // ['name' => 'AB-'],\n // ['name' => 'O+'],\n // ['name' => 'O-'],\n // ]);\n\n \n }", "public function run()\n {\n //\n DB::table('foods')->delete();\n\n Foods::create(array(\n 'name' => 'Chicken Wing',\n 'author' => 'Bambang',\n 'overview' => 'a deep-fried chicken wing, not in spicy sauce'\n ));\n\n Foods::create(array(\n 'name' => 'Beef ribs',\n 'author' => 'Frank',\n 'overview' => 'Slow baked beef ribs rubbed in spices'\n ));\n\n Foods::create(array(\n 'name' => 'Ice cream',\n 'author' => 'Lou',\n 'overview' => ' A sweetened frozen food typically eaten as a snack or dessert.'\n ));\n\n }", "public function run()\n {\n // $this->call(UserTableSeeder::class);\n \\App\\User::create([\n 'name'=>'PAPE SAMBA NDOUR',\n 'email'=>'papesambandour@hotmail.com',\n 'password'=>bcrypt('Admin1122'),\n ]);\n\n $faker = Faker::create();\n\n for ($i = 0; $i < 100 ; $i++)\n {\n $firstName = $faker->firstName;\n $lastName = $faker->lastName;\n $niveau = \\App\\Niveau::inRandomOrder()->first();\n \\App\\Etudiant::create([\n 'prenom'=>$firstName,\n 'nom'=>$lastName,\n 'niveau_id'=>$niveau->id\n ]);\n }\n\n\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n News::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 10; $i++) {\n News::create([\n 'title' => $faker->sentence,\n 'summary' => $faker->sentence,\n 'content' => $faker->paragraph,\n 'imagePath' => '/img/exclamation_mark.png'\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class, 3)->create();\n factory(App\\Models\\Category::class, 3)\n ->create()\n ->each(function ($u) {\n $u->courses()->saveMany(factory(App\\Models\\Course::class,3)->make())->each(function ($c){\n $c->exams()->saveMany(factory(\\App\\Models\\Exam::class,3)->make())->each(function ($e){\n $e->questions()->saveMany(factory(\\App\\Models\\Question::class,4)->make())->each(function ($q){\n $q->answers()->saveMany(factory(\\App\\Models\\Answer::class,4)->make())->each(function ($a){\n $a->correctAnswer()->save(factory(\\App\\Models\\Correct_answer::class)->make());\n });\n });\n });\n });\n\n });\n\n }", "public function run()\n {\n \\DB::table('employees')->delete();\n\n $faker = \\Faker\\Factory::create('ja_JP');\n\n $role_id = ['1','2','3'];\n\n for ($i = 0; $i < 10; $i++) {\n \\App\\Models\\Employee::create([\n 'last_name' =>$faker->lastName() ,\n 'first_name' => $faker->firstName(),\n 'mail' => $faker->email(),\n 'password' => Hash::make( \"password.$i\"),\n 'birthday' => $faker->date($format='Y-m-d',$max='now'),\n 'role_id' => $faker->randomElement($role_id)\n ]);\n }\n }", "public function run()\n {\n\n DB::table('clients')->delete();\n DB::table('trips')->delete();\n error_log('empty tables done.');\n\n $random_cities = City::inRandomOrder()->select('ar_name')->limit(5)->get();\n $GLOBALS[\"random_cities\"] = $random_cities->pluck('ar_name')->toArray();\n\n $random_airlines = Airline::inRandomOrder()->select('code')->limit(5)->get();\n $GLOBALS[\"random_airlines\"] = $random_airlines->pluck('code')->toArray();\n\n factory(App\\Client::class, 5)->create();\n error_log('Client seed done.');\n\n\n factory(App\\Trip::class, 50)->create();\n error_log('Trip seed done.');\n\n\n factory(App\\Quicksearch::class, 10)->create();\n error_log('Quicksearch seed done.');\n }", "public function run()\n {\n // Admins\n User::factory()->create([\n 'name' => 'Zaiman Noris',\n 'username' => 'rognales',\n 'email' => 'rognales@gmail.com',\n 'active' => true,\n ]);\n\n User::factory()->create([\n 'name' => 'Affiq Rashid',\n 'username' => 'affiqr',\n 'email' => 'sonic21danger@gmail.com',\n 'active' => true,\n ]);\n\n // Only seed test data in non-prod\n if (! app()->isProduction()) {\n Member::factory()->count(1000)->create();\n Staff::factory()->count(1000)->create();\n\n Participant::factory()\n ->addSpouse()\n ->addChildren()\n ->addInfant()\n ->addOthers()\n ->count(500)\n ->hasUploads(2)\n ->create();\n }\n }", "public function run()\n {\n $this->call([\n RoleSeeder::class,\n UserSeeder::class,\n ]);\n\n \\App\\Models\\Category::factory(4)->create();\n \\App\\Models\\View::factory(6)->create();\n \\App\\Models\\Room::factory(8)->create();\n \n $rooms = \\App\\Models\\Room::all();\n // \\App\\Models\\User::all()->each(function ($user) use ($rooms) { \n // $user->rooms()->attach(\n // $rooms->random(rand(1, \\App\\Models\\Room::max('id')))->pluck('id')->toArray()\n // ); \n // });\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n Employee::factory()->create(['email' => 'sovon.kucse@gmail.com']);\n Brand::factory()->count(3)->create();\n $this->call([\n TagSeeder::class,\n AttributeSeeder::class,\n AttributeValueSeeder::class,\n ProductSeeder::class,\n ]);\n }", "public function run()\n {\n $this->call(RolesTableSeeder::class); // crée les rôles\n $this->call(PermissionsTableSeeder::class); // crée les permissions\n\n factory(Employee::class,3)->create();\n factory(Provider::class,1)->create();\n\n $user = User::create([\n 'name'=>'Alioune Bada Ndoye',\n 'email'=>'abada@gmail.com',\n 'phone'=>'773012470',\n 'password'=>bcrypt('123'),\n ]);\n Employee::create([\n 'job'=>'Informaticien',\n 'user_id'=>User::where('email','abada@gmail.com')->first()->id,\n 'point_id'=>Point::find(1)->id,\n ]);\n $user->assignRole('admin');\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n factory(User::class, 1)\n \t->create(['email' => 'eddyjaair@gmail.com']);\n\n factory(Category::class, 5)->create();\n }", "public function run()\n {\n //$this->call(UsersTableSeeder::class);\n $this->call(rootSeed::class);\n factory(App\\Models\\Egresado::class,'hombre',15)->create();\n factory(App\\Models\\Egresado::class,'mujer',15)->create();\n factory(App\\Models\\Administrador::class,5)->create();\n factory(App\\Models\\Notificacion::class,'post',10)->create();\n factory(App\\Models\\Notificacion::class,'mensaje',5)->create();\n factory(App\\Models\\Egresado::class,'bajaM',5)->create();\n factory(App\\Models\\Egresado::class,'bajaF',5)->create();\n factory(App\\Models\\Egresado::class,'suscritam',5)->create();\n factory(App\\Models\\Egresado::class,'suscritaf',5)->create();\n }", "public function run()\n {\n // $faker=Faker::create();\n // foreach(range(1,100) as $index)\n // {\n // DB::table('products')->insert([\n // 'name' => $faker->name,\n // 'price' => rand(10,100000)/100\n // ]);\n // }\n }", "public function run()\n {\n \n User::factory(1)->create([\n 'rol'=>'EPS'\n ]);\n Person::factory(10)->create();\n $this->call(EPSSeeder::class);\n $this->call(OfficialSeeder::class);\n $this->call(VVCSeeder::class);\n $this->call(VaccineSeeder::class);\n }", "public function run()\n {\n $this->call([\n LanguagesTableSeeder::class,\n ListingAvailabilitiesTableSeeder::class,\n ListingTypesTableSeeder::class,\n RoomTypesTableSeeder::class,\n AmenitiesTableSeeder::class,\n UsersTableSeeder::class,\n UserLanguagesTableSeeder::class,\n ListingsTableSeeder::class,\n WishlistsTableSeeder::class,\n StaysTableSeeder::class,\n GuestsTableSeeder::class,\n TripsTableSeeder::class,\n ReviewsTableSeeder::class,\n RatingsTableSeeder::class,\n PopularDestinationsTableSeeder::class,\n ImagesTableSeeder::class,\n ]);\n\n // factory(App\\User::class, 5)->states('host')->create();\n // factory(App\\User::class, 10)->states('hostee')->create();\n\n // factory(App\\User::class, 10)->create();\n // factory(App\\Models\\Listing::class, 30)->create();\n }", "public function run()\n {\n Schema::disableForeignKeyConstraints();\n Grade::truncate();\n Schema::enableForeignKeyConstraints();\n\n $faker = \\Faker\\Factory::create();\n\n for ($i = 0; $i < 10; $i++) {\n Grade::create([\n 'letter' => $faker->randomElement(['а', 'б', 'в']),\n 'school_id' => $faker->unique()->numberBetween(1, School::count()),\n 'level' => 1\n ]);\n }\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n factory(App\\User::class,5)->create();//5 User created\n factory(App\\Model\\Genre::class,5)->create();//5 genres\n factory(App\\Model\\Film::class,6)->create();//6 films\n factory(App\\Model\\Comment::class, 20)->create();// 20 comments\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n User::create([\n 'name' => 'jose luis',\n 'email' => 'barbozagonzalesjose@gmail.com',\n 'password' => bcrypt('xxxxxx'),\n 'role' => 'admin',\n ]);\n\n Category::create([\n 'name' => 'inpods',\n 'description' => 'auriculares inalambricos que funcionan con blouthue genial'\n ]);\n\n Category::create([\n 'name' => 'other',\n 'description' => 'otra cosa diferente a un inpods'\n ]);\n\n\n /* Create 10 products */\n Product::factory(10)->create();\n }", "public function run()\n {\n\n $this->call(UserSeeder::class);\n factory(Empresa::class,10)->create();\n factory(Empleado::class,50)->create();\n }", "public function run()\n {\n $user_ids = [1,2,3];\n $faker = app(\\Faker\\Generator::class);\n $posts = factory(\\App\\Post::class)->times(50)->make()->each(function($post) use ($user_ids,$faker){\n $post->user_id = $faker->randomElement($user_ids);\n });\n \\App\\Post::insert($posts->toArray());\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(User::class)->create([\n 'email' => 'russell@gmail.com',\n 'name' => 'Russell'\n ]);\n\n factory(User::class)->create([\n 'email' => 'bitfumes@gmail.com',\n 'name' => 'Bitfumes'\n ]);\n\n factory(User::class)->create([\n 'email' => 'paul@gmail.com',\n 'name' => 'Paul'\n ]);\n }", "public function run()\n {\n // Vaciar la tabla.\n Favorite::truncate();\n $faker = \\Faker\\Factory::create();\n // Crear artículos ficticios en la tabla\n\n // factory(App\\Models\\User::class, 2)->create()->each(function ($user) {\n // $user->users()->saveMany(factory(App\\Models\\User::class, 25)->make());\n //});\n }", "public function run()\n\t{\n\t\t$this->call(ProductsTableSeeder::class);\n\t\t$this->call(CategoriesTableSeeder::class);\n\t\t$this->call(BrandsTableSeeder::class);\n\t\t$this->call(ColorsTableSeeder::class);\n\n\t\t$products = \\App\\Product::all();\n \t$categories = \\App\\Category::all();\n \t$brands = \\App\\Brand::all();\n \t$colors = \\App\\Color::all();\n\n\t\tforeach ($products as $product) {\n\t\t\t$product->colors()->sync($colors->random(3));\n\n\t\t\t$product->category()->associate($categories->random(1)->first());\n\t\t\t$product->brand()->associate($brands->random(1)->first());\n\n\t\t\t$product->save();\n\t\t}\n\n\t\t// for ($i = 0; $i < count($products); $i++) {\n\t\t// \t$cat = $categories[rand(0,5)];\n\t\t// \t$bra = $brands[rand(0,7)];\n\t\t// \t$cat->products()->save($products[$i]);\n\t\t// \t$bra->products()->save($products[$i]);\n\t\t// }\n\n\t\t// $products = factory(App\\Product::class)->times(20)->create();\n\t\t// $categories = factory(App\\Category::class)->times(6)->create();\n\t\t// $brands = factory(App\\Brand::class)->times(8)->create();\n\t\t// $colors = factory(App\\Color::class)->times(15)->create();\n\t}", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker = Faker::create();\n foreach (range(1,200) as $index) {\n DB::table('users')->insert([\n 'name' => $faker->name,\n 'email' => $faker->email,\n 'phone' => $faker->randomDigitNotNull,\n 'address'=> $faker->streetAddress,\n 'password' => bcrypt('secret'),\n ]);\n }\n }", "public function run()\n {\n /*$this->call(UsersTableSeeder::class);\n $this->call(GroupsTableSeeder::class);\n $this->call(TopicsTableSeeder::class);\n $this->call(CommentsTableSeeder::class);*/\n DB::table('users')->insert([\n 'name' => 'pkw',\n 'email' => 'pkw@pkw.com',\n 'password' => bcrypt('secret'),\n 'type' => '1'\n ]);\n }", "public function run()\n {\n $this->call(UsersSeeder::class);\n User::factory(2)->create();\n Company::factory(2)->create();\n\n }", "public function run()\n {\n echo PHP_EOL , 'seeding roles...';\n\n Role::create(\n [\n 'name' => 'Admin',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Principal',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Teacher',\n 'deletable' => false,\n ]\n );\n\n Role::create(\n [\n 'name' => 'Student',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Parents',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Accountant',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Librarian',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Receptionist',\n 'deletable' => false,\n ]\n );\n\n\n }", "public function run()\n {\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 5; $i++) {\n Runner::create([\n 'external_id' => $faker->uuid,\n 'name' => $faker->name,\n 'race_id' =>rand(1,5),\n 'age' => rand(30, 45),\n 'sex' => $faker->randomElement(['male', 'female']),\n 'color' => $faker->randomElement(['#ecbcb4', '#d1a3a4']),\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // $this->call(QuestionTableSeed::class);\n\n $this->call([\n QuestionTableSeed::class,\n AlternativeTableSeed::class,\n ScheduleActionTableSeeder::class,\n UserTableSeeder::class,\n CompanyClassificationTableSeed::class,\n ]);\n // DB::table('clients')->insert([\n // 'name' => 'Empresa-02',\n // 'email' => 'empresa02@gmail.com',\n // 'password' => bcrypt('07.052.477/0001-60'),\n // ]);\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n\n User::factory()->create([\n 'name' => 'Carlos',\n 'email' => 'carlos@email.com',\n 'email_verified_at' => now(),\n 'password' => bcrypt('123456'), // password\n 'remember_token' => Str::random(10),\n ]);\n \n $this->call([PostsTableSeeder::class]);\n $this->call([TagTableSeeder::class]);\n\n }", "public function run()\n {\n $this->call(AlumnoSeeder::class);\n //Alumnos::factory()->count(30)->create();\n //DB::table('alumnos')->insert([\n // 'dni_al' => '13189079',\n // 'nom_al' => 'Jose',\n // 'ape_al' => 'Araujo',\n // 'rep_al' => 'Principal',\n // 'esp_al' => 'Tecnologia',\n // 'lnac_al' => 'Valencia'\n //]);\n }", "public function run()\n {\n Eloquent::unguard();\n\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n\n // $this->call([\n // CountriesTableSeeder::class,\n // ]);\n\n factory(App\\User::class, 100)->create();\n factory(App\\Type::class, 10)->create();\n factory(App\\Item::class, 100)->create();\n factory(App\\Order::class, 1000)->create();\n\n $items = App\\Item::all();\n\n App\\Order::all()->each(function($order) use ($items) {\n\n $n = rand(1, 10);\n\n $order->items()->attach(\n $items->random($n)->pluck('id')->toArray()\n , ['quantity' => $n]);\n\n $order->total = $order->items->sum(function($item) {\n return $item->price * $item->pivot->quantity;\n });\n\n $order->save();\n\n });\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n factory(User::class)->create(\n [\n 'email'=>'izzanniroshlei@gmail.com',\n 'name'=>'izzanni',\n \n ]\n );\n factory(User::class)->create(\n [\n 'email'=>'aina@gmail.com',\n 'name'=>'aina',\n\n ]\n );\n factory(User::class)->create(\n [\n 'email'=>'sab@gmail.com',\n 'name'=>'sab',\n\n ]\n );\n }", "public function run()\n {\n\n factory('App\\Models\\Pessoa', 60)->create();\n factory('App\\Models\\Profissional', 10)->create();\n factory('App\\Models\\Paciente', 50)->create();\n $this->call(UsersTableSeeder::class);\n $this->call(ProcedimentoTableSeeder::class);\n // $this->call(PessoaTableSeeder::class);\n // $this->call(ProfissionalTableSeeder::class);\n // $this->call(PacienteTableSeeder::class);\n // $this->call(AgendaProfissionalTableSeeder::class);\n }", "public function run()\n {\n \t// DB::table('categories')->truncate();\n // factory(App\\Models\\Category::class, 10)->create();\n Schema::disableForeignKeyConstraints();\n Category::truncate();\n $faker = Faker\\Factory::create();\n\n $categories = ['SAMSUNG','NOKIA','APPLE','BLACK BERRY'];\n foreach ($categories as $key => $value) {\n Category::create([\n 'name'=>$value,\n 'description'=> 'This is '.$value,\n 'markup'=> rand(10,100),\n 'category_id'=> null,\n 'UUID' => $faker->uuid,\n ]);\n }\n }", "public function run()\n {\n \t$roles = DB::table('roles')->pluck('id');\n \t$sexes = DB::table('sexes')->pluck('id');\n \t$faker = \\Faker\\Factory::create();\n\n \tforeach (range(1,20) as $item) {\n \t\tDB::table('users')->insert([\n \t\t\t'role_id' => $faker->randomElement($roles),\n \t\t\t'sex_id' => $faker->randomElement($sexes),\n \t\t\t'name' => $faker->firstName . ' ' . $faker->lastName,\n \t\t\t'dob' => $faker->date,\n \t\t\t'bio' => $faker->text,\n \t\t\t'created_at' => now(),\n \t\t\t'updated_at' => now()\n \t\t]);\n \t} \n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n //nhập liệu mẫu cho bảng users\n DB::table('users')->insert([\n \t['id'=>'1001', 'name'=>'Phan Thị Hiền', 'email'=>'hienphan18112015@gmail.com', 'password'=>'123456', 'isadmin'=>1],\n \t['id'=>'1002', 'name'=>'Phan Thị Hà', 'email'=>'haphan@gmail.com', 'password'=>'111111', 'isadmin'=>0]\n ]);\n\n\n //nhập liệu mẫu cho bảng suppliers\n DB::table('suppliers')->insert([\n \t['name'=>'FPT', 'address'=>'151 Hùng Vương, TP. Đà Nẵng', 'phonenum'=>'0971455395'],\n \t['name'=>'Điện Máy Xanh', 'address'=>'169 Phan Châu Trinh, TP. Đà Nẵng', 'phonenum'=>'0379456011']\n ]);\n\n\n //Bảng phiếu bảo hành\n }" ]
[ "0.80138505", "0.79804975", "0.7977927", "0.7954003", "0.7951511", "0.79507065", "0.79449123", "0.794312", "0.7938865", "0.79372203", "0.79340154", "0.7892169", "0.7881411", "0.7879766", "0.78787434", "0.7875771", "0.7870809", "0.7870481", "0.7852045", "0.7851101", "0.784159", "0.78346395", "0.7827439", "0.7818506", "0.78085804", "0.7803168", "0.7803112", "0.7800874", "0.78000623", "0.77964896", "0.7790986", "0.77893186", "0.7786942", "0.7779508", "0.77773196", "0.7766297", "0.7762858", "0.77619725", "0.7761802", "0.77617735", "0.7760563", "0.77588934", "0.7757106", "0.77538526", "0.7750399", "0.7749764", "0.77460176", "0.7729847", "0.77295387", "0.77283424", "0.7717115", "0.7715115", "0.77147174", "0.77134794", "0.7713354", "0.7712908", "0.77113235", "0.7711319", "0.77109134", "0.7710318", "0.77056116", "0.770521", "0.77040505", "0.7704028", "0.7702745", "0.7702163", "0.77015257", "0.7699154", "0.76988846", "0.7698059", "0.76972497", "0.76941127", "0.7692912", "0.76910675", "0.7690705", "0.7687825", "0.7687763", "0.76870334", "0.76862305", "0.7684728", "0.76843387", "0.7680029", "0.76790416", "0.7678002", "0.76777124", "0.76734155", "0.7670605", "0.7669205", "0.7668748", "0.766868", "0.7666607", "0.76631796", "0.7662515", "0.7661419", "0.76591927", "0.7656439", "0.7654022", "0.76532", "0.76526594", "0.7652528", "0.765247" ]
0.0
-1
/ Extension MIME Type .doc application/msword .dot application/msword .docx application/vnd.openxmlformatsofficedocument.wordprocessingml.document .dotx application/vnd.openxmlformatsofficedocument.wordprocessingml.template .docm application/vnd.msword.document.macroEnabled.12 .dotm application/vnd.msword.template.macroEnabled.12 .xls application/vnd.msexcel .xlt application/vnd.msexcel .xla application/vnd.msexcel .xlsx application/vnd.openxmlformatsofficedocument.spreadsheetml.sheet .xltx application/vnd.openxmlformatsofficedocument.spreadsheetml.template .xlsm application/vnd.msexcel.sheet.macroEnabled.12 .xltm application/vnd.msexcel.template.macroEnabled.12 .xlam application/vnd.msexcel.addin.macroEnabled.12 .xlsb application/vnd.msexcel.sheet.binary.macroEnabled.12 .ppt application/vnd.mspowerpoint .pot application/vnd.mspowerpoint .pps application/vnd.mspowerpoint .ppa application/vnd.mspowerpoint .pptx application/vnd.openxmlformatsofficedocument.presentationml.presentation .potx application/vnd.openxmlformatsofficedocument.presentationml.template .ppsx application/vnd.openxmlformatsofficedocument.presentationml.slideshow .ppam application/vnd.mspowerpoint.addin.macroEnabled.12 .pptm application/vnd.mspowerpoint.presentation.macroEnabled.12 .potm application/vnd.mspowerpoint.template.macroEnabled.12 .ppsm application/vnd.mspowerpoint.slideshow.macroEnabled.12 .mdb application/vnd.msaccess
public function buildForm(FormBuilderInterface $builder, array $options) { //dump($options);die(); $builder ->add('description', TextType::class, array( 'data' => $options['data']->getDescription(), 'label' => "File description", 'constraints'=>array( new Assert\NotBlank( array( 'message' => 'This value should not be empty!', ) ) ), 'attr' => array( //'style' => 'width:250px', ) ) ) //more constraints here: https://symfony.com/doc/2.7/reference/constraints/File.html //complete list of mimes: https://www.sitepoint.com/mime-types-complete-list/ ->add('userfile', FileType::class, array( //'data_class' => 'Symfony\Component\HttpFoundation\File\File', //'block_name'=>'Upload', 'label' => 'Choose a file!', 'mapped' =>false, 'constraints'=>array( new Assert\File( array( 'maxSize' => "5M", 'mimeTypes' => array( "image/jpeg", "image/gif", "image/png", "image/tiff", "mage/x-tiff", // "application/pdf", // "application/x-pdf", // // "application/excel", // "application/vnd.ms-excel", // "application/x-excel", // "application/x-msexcel", // "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", // "application/vnd.openxmlformats-officedocument.spreadsheetml.template", // "application/vnd.ms-excel.sheet.macroEnabled.12", // "application/vnd.ms-excel.template.macroEnabled.12", // "application/vnd.ms-excel.addin.macroEnabled.12", // "application/vnd.ms-excel.sheet.binary.macroEnabled.12", // // "application/vnd.ms-powerpoint", // "application/vnd.ms-powerpoint", // "application/vnd.ms-powerpoint", // "application/vnd.ms-powerpoint", // // "application/vnd.openxmlformats-officedocument.presentationml.presentation", // "application/vnd.openxmlformats-officedocument.presentationml.template", // "application/vnd.openxmlformats-officedocument.presentationml.slideshow", // "application/vnd.ms-powerpoint.addin.macroEnabled.12", // "application/vnd.ms-powerpoint.presentation.macroEnabled.12", // "application/vnd.ms-powerpoint.template.macroEnabled.12", // "application/vnd.ms-powerpoint.slideshow.macroEnabled.12", // // "application/vnd.ms-access", // // "application/msword", // "application/vnd.openxmlformats-officedocument.wordprocessingml.document", // "application/vnd.openxmlformats-officedocument.wordprocessingml.template", // "application/vnd.ms-word.document.macroEnabled.12", // "application/vnd.ms-word.template.macroEnabled.12", // // "text/plain", ), 'maxSizeMessage' => "Maximum allowed size is 5MB.", 'mimeTypesMessage' => "This type of file is not allowed!", 'uploadErrorMessage'=>"The file could not be uploaded!", 'disallowEmptyMessage'=>"Choose a file!", ) ) ) ) ) ->add('upload', SubmitType::class, array('label' => 'Upload')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function mimeTypeExtensions ()\r\n\t{\r\n\t\t# Define the MIME Types; list taken from www.mimetype.org\r\n\t\t$mimeTypes = '\r\n\t\tapplication/SLA\tstl\r\n\t\tapplication/STEP\tstep\r\n\t\tapplication/STEP\tstp\r\n\t\tapplication/acad\tdwg\r\n\t\tapplication/andrew-inset\tez\r\n\t\tapplication/clariscad\tccad\r\n\t\tapplication/drafting\tdrw\r\n\t\tapplication/dsptype\ttsp\r\n\t\tapplication/dxf\tdxf\r\n\t\tapplication/excel\txls\r\n\t\tapplication/i-deas\tunv\r\n\t\tapplication/java-archive\tjar\r\n\t\tapplication/mac-binhex40\thqx\r\n\t\tapplication/mac-compactpro\tcpt\r\n\t\tapplication/vnd.ms-powerpoint\tpot\r\n\t\tapplication/vnd.ms-powerpoint\tpps\r\n\t\tapplication/vnd.ms-powerpoint\tppt\r\n\t\tapplication/vnd.ms-powerpoint\tppz\r\n\t\tapplication/msword\tdoc\r\n\t\tapplication/octet-stream\tbin\r\n\t\tapplication/octet-stream\tclass\r\n\t\tapplication/octet-stream\tdms\r\n\t\tapplication/octet-stream\texe\r\n\t\tapplication/octet-stream\tlha\r\n\t\tapplication/octet-stream\tlzh\r\n\t\tapplication/oda\toda\r\n\t\tapplication/ogg\togg\r\n\t\tapplication/ogg\togm\r\n\t\tapplication/pdf\tpdf\r\n\t\tapplication/pgp\tpgp\r\n\t\tapplication/postscript\tai\r\n\t\tapplication/postscript\teps\r\n\t\tapplication/postscript\tps\r\n\t\tapplication/pro_eng\tprt\r\n\t\tapplication/rtf\trtf\r\n\t\tapplication/set\tset\r\n\t\tapplication/smil\tsmi\r\n\t\tapplication/smil\tsmil\r\n\t\tapplication/solids\tsol\r\n\t\tapplication/vda\tvda\r\n\t\tapplication/vnd.mif\tmif\r\n\t\tapplication/vnd.ms-excel\txlc\r\n\t\tapplication/vnd.ms-excel\txll\r\n\t\tapplication/vnd.ms-excel\txlm\r\n\t\tapplication/vnd.ms-excel\txls\r\n\t\tapplication/vnd.ms-excel\txlw\r\n\t\tapplication/vnd.rim.cod\tcod\r\n\t\tapplication/x-arj-compressed\tarj\r\n\t\tapplication/x-bcpio\tbcpio\r\n\t\tapplication/x-cdlink\tvcd\r\n\t\tapplication/x-chess-pgn\tpgn\r\n\t\tapplication/x-cpio\tcpio\r\n\t\tapplication/x-csh\tcsh\r\n\t\tapplication/x-debian-package\tdeb\r\n\t\tapplication/x-director\tdcr\r\n\t\tapplication/x-director\tdir\r\n\t\tapplication/x-director\tdxr\r\n\t\tapplication/x-dvi\tdvi\r\n\t\tapplication/x-freelance\tpre\r\n\t\tapplication/x-futuresplash\tspl\r\n\t\tapplication/x-gtar\tgtar\r\n\t\tapplication/x-gunzip\tgz\r\n\t\tapplication/x-gzip\tgz\r\n\t\tapplication/x-hdf\thdf\r\n\t\tapplication/x-ipix\tipx\r\n\t\tapplication/x-ipscript\tips\r\n\t\tapplication/x-javascript\tjs\r\n\t\tapplication/x-koan\tskd\r\n\t\tapplication/x-koan\tskm\r\n\t\tapplication/x-koan\tskp\r\n\t\tapplication/x-koan\tskt\r\n\t\tapplication/x-latex\tlatex\r\n\t\tapplication/x-lisp\tlsp\r\n\t\tapplication/x-lotusscreencam\tscm\r\n\t\tapplication/x-mif\tmif\r\n\t\tapplication/x-msdos-program\tbat\r\n\t\tapplication/x-msdos-program\tcom\r\n\t\tapplication/x-msdos-program\texe\r\n\t\tapplication/x-netcdf\tcdf\r\n\t\tapplication/x-netcdf\tnc\r\n\t\tapplication/x-perl\tpl\r\n\t\tapplication/x-perl\tpm\r\n\t\tapplication/x-rar-compressed\trar\r\n\t\tapplication/x-sh\tsh\r\n\t\tapplication/x-shar\tshar\r\n\t\tapplication/x-shockwave-flash\tswf\r\n\t\tapplication/x-stuffit\tsit\r\n\t\tapplication/x-sv4cpio\tsv4cpio\r\n\t\tapplication/x-sv4crc\tsv4crc\r\n\t\tapplication/x-tar-gz\ttar.gz\r\n\t\tapplication/x-tar-gz\ttgz\r\n\t\tapplication/x-tar\ttar\r\n\t\tapplication/x-tcl\ttcl\r\n\t\tapplication/x-tex\ttex\r\n\t\tapplication/x-texinfo\ttexi\r\n\t\tapplication/x-texinfo\ttexinfo\r\n\t\tapplication/x-troff-man\tman\r\n\t\tapplication/x-troff-me\tme\r\n\t\tapplication/x-troff-ms\tms\r\n\t\tapplication/x-troff\troff\r\n\t\tapplication/x-troff\tt\r\n\t\tapplication/x-troff\ttr\r\n\t\tapplication/x-ustar\tustar\r\n\t\tapplication/x-wais-source\tsrc\r\n\t\tapplication/x-zip-compressed\tzip\r\n\t\tapplication/zip\tzip\r\n\t\taudio/TSP-audio\ttsi\r\n\t\taudio/basic\tau\r\n\t\taudio/basic\tsnd\r\n\t\taudio/midi\tkar\r\n\t\taudio/midi\tmid\r\n\t\taudio/midi\tmidi\r\n\t\taudio/mpeg\tmp2\r\n\t\taudio/mpeg\tmp3\r\n\t\taudio/mpeg\tmpga\r\n\t\taudio/ulaw\tau\r\n\t\taudio/x-aiff\taif\r\n\t\taudio/x-aiff\taifc\r\n\t\taudio/x-aiff\taiff\r\n\t\taudio/x-mpegurl\tm3u\r\n\t\taudio/x-ms-wax\twax\r\n\t\taudio/x-ms-wma\twma\r\n\t\taudio/x-pn-realaudio-plugin\trpm\r\n\t\taudio/x-pn-realaudio\tram\r\n\t\taudio/x-pn-realaudio\trm\r\n\t\taudio/x-realaudio\tra\r\n\t\taudio/x-wav\twav\r\n\t\tchemical/x-pdb\tpdb\r\n\t\tchemical/x-pdb\txyz\r\n\t\timage/cmu-raster\tras\r\n\t\timage/gif\tgif\r\n\t\timage/ief\tief\r\n\t\timage/jpeg\tjpe\r\n\t\timage/jpeg\tjpeg\r\n\t\timage/jpeg\tjpg\r\n\t\timage/png\tpng\r\n\t\timage/tiff\ttif tiff\r\n\t\timage/tiff\ttif\r\n\t\timage/tiff\ttiff\r\n\t\timage/x-cmu-raster\tras\r\n\t\timage/x-portable-anymap\tpnm\r\n\t\timage/x-portable-bitmap\tpbm\r\n\t\timage/x-portable-graymap\tpgm\r\n\t\timage/x-portable-pixmap\tppm\r\n\t\timage/x-rgb\trgb\r\n\t\timage/x-xbitmap\txbm\r\n\t\timage/x-xpixmap\txpm\r\n\t\timage/x-xwindowdump\txwd\r\n\t\tmodel/iges\tiges\r\n\t\tmodel/iges\tigs\r\n\t\tmodel/mesh\tmesh\r\n\t\tmodel/mesh\tmsh\r\n\t\tmodel/mesh\tsilo\r\n\t\tmodel/vrml\tvrml\r\n\t\tmodel/vrml\twrl\r\n\t\ttext/css\tcss\r\n\t\ttext/html\thtm\r\n\t\ttext/html\thtml htm\r\n\t\ttext/html\thtml\r\n\t\ttext/plain\tasc txt\r\n\t\ttext/plain\tasc\r\n\t\ttext/plain\tc\r\n\t\ttext/plain\tcc\r\n\t\ttext/plain\tf90\r\n\t\ttext/plain\tf\r\n\t\ttext/plain\th\r\n\t\ttext/plain\thh\r\n\t\ttext/plain\tm\r\n\t\ttext/plain\ttxt\r\n\t\ttext/richtext\trtx\r\n\t\ttext/rtf\trtf\r\n\t\ttext/sgml\tsgm\r\n\t\ttext/sgml\tsgml\r\n\t\ttext/tab-separated-values\ttsv\r\n\t\ttext/vnd.sun.j2me.app-descriptor\tjad\r\n\t\ttext/x-setext\tetx\r\n\t\ttext/xml\txml// This is disabled because XML has several different MIME Types\r\n\t\tvideo/dl\tdl\r\n\t\tvideo/fli\tfli\r\n\t\tvideo/flv\tflv\r\n\t\tvideo/gl\tgl\r\n\t\tvideo/mpeg\tmp2\r\n\t\tvideo/mpeg\tmpe\r\n\t\tvideo/mpeg\tmpeg\r\n\t\tvideo/mpeg\tmpg\r\n\t\tvideo/quicktime\tmov\r\n\t\tvideo/quicktime\tqt\r\n\t\tvideo/vnd.vivo\tviv\r\n\t\tvideo/vnd.vivo\tvivo\r\n\t\tvideo/x-fli\tfli\r\n\t\tvideo/x-ms-asf\tasf\r\n\t\tvideo/x-ms-asx\tasx\r\n\t\tvideo/x-ms-wmv\twmv\r\n\t\tvideo/x-ms-wmx\twmx\r\n\t\tvideo/x-ms-wvx\twvx\r\n\t\tvideo/x-msvideo\tavi\r\n\t\tvideo/x-sgi-movie\tmovie\r\n\t\twww/mime\tmime\r\n\t\tx-conference/x-cooltalk\tice\r\n\t\tx-world/x-vrml\tvrm\r\n\t\tx-world/x-vrml\tvrml';\r\n\t\t\r\n\t\t# Parse the list as array ($extension => $mimeType, ... )\r\n\t\t$list = array ();\r\n\t\t$mimeTypes = explode (\"\\n\", trim ($mimeTypes));\r\n\t\tforeach ($mimeTypes as $index => $line) {\r\n\t\t\tlist ($mimeType, $extension) = explode (\"\\t\", trim ($line), 2);\r\n\t\t\tif (substr_count ($extension, ' ')) {continue;}\t// Limit of 2 for some extensions in the source listing have two listed, e.g. \"asc txt\"\r\n\t\t\t$list[$extension] = $mimeType;\r\n\t\t}\r\n\t\t\r\n\t\t# Return the list\r\n\t\treturn $list;\r\n\t}", "public static function _mime_types($ext = '')\n {\n $mimes = array(\n 'xl' => 'application/excel',\n 'js' => 'application/javascript',\n 'hqx' => 'application/mac-binhex40',\n 'cpt' => 'application/mac-compactpro',\n 'bin' => 'application/macbinary',\n 'doc' => 'application/msword',\n 'word' => 'application/msword',\n 'xlsx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',\n 'xltx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.template',\n 'potx' => 'application/vnd.openxmlformats-officedocument.presentationml.template',\n 'ppsx' => 'application/vnd.openxmlformats-officedocument.presentationml.slideshow',\n 'pptx' => 'application/vnd.openxmlformats-officedocument.presentationml.presentation',\n 'sldx' => 'application/vnd.openxmlformats-officedocument.presentationml.slide',\n 'docx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',\n 'dotx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.template',\n 'xlam' => 'application/vnd.ms-excel.addin.macroEnabled.12',\n 'xlsb' => 'application/vnd.ms-excel.sheet.binary.macroEnabled.12',\n 'class' => 'application/octet-stream',\n 'dll' => 'application/octet-stream',\n 'dms' => 'application/octet-stream',\n 'exe' => 'application/octet-stream',\n 'lha' => 'application/octet-stream',\n 'lzh' => 'application/octet-stream',\n 'psd' => 'application/octet-stream',\n 'sea' => 'application/octet-stream',\n 'so' => 'application/octet-stream',\n 'oda' => 'application/oda',\n 'pdf' => 'application/pdf',\n 'ai' => 'application/postscript',\n 'eps' => 'application/postscript',\n 'ps' => 'application/postscript',\n 'smi' => 'application/smil',\n 'smil' => 'application/smil',\n 'mif' => 'application/vnd.mif',\n 'xls' => 'application/vnd.ms-excel',\n 'ppt' => 'application/vnd.ms-powerpoint',\n 'wbxml' => 'application/vnd.wap.wbxml',\n 'wmlc' => 'application/vnd.wap.wmlc',\n 'dcr' => 'application/x-director',\n 'dir' => 'application/x-director',\n 'dxr' => 'application/x-director',\n 'dvi' => 'application/x-dvi',\n 'gtar' => 'application/x-gtar',\n 'php3' => 'application/x-httpd-php',\n 'php4' => 'application/x-httpd-php',\n 'php' => 'application/x-httpd-php',\n 'phtml' => 'application/x-httpd-php',\n 'phps' => 'application/x-httpd-php-source',\n 'swf' => 'application/x-shockwave-flash',\n 'sit' => 'application/x-stuffit',\n 'tar' => 'application/x-tar',\n 'tgz' => 'application/x-tar',\n 'xht' => 'application/xhtml+xml',\n 'xhtml' => 'application/xhtml+xml',\n 'zip' => 'application/zip',\n 'mid' => 'audio/midi',\n 'midi' => 'audio/midi',\n 'mp2' => 'audio/mpeg',\n 'mp3' => 'audio/mpeg',\n 'mpga' => 'audio/mpeg',\n 'aif' => 'audio/x-aiff',\n 'aifc' => 'audio/x-aiff',\n 'aiff' => 'audio/x-aiff',\n 'ram' => 'audio/x-pn-realaudio',\n 'rm' => 'audio/x-pn-realaudio',\n 'rpm' => 'audio/x-pn-realaudio-plugin',\n 'ra' => 'audio/x-realaudio',\n 'wav' => 'audio/x-wav',\n 'bmp' => 'image/bmp',\n 'gif' => 'image/gif',\n 'jpeg' => 'image/jpeg',\n 'jpe' => 'image/jpeg',\n 'jpg' => 'image/jpeg',\n 'png' => 'image/png',\n 'tiff' => 'image/tiff',\n 'tif' => 'image/tiff',\n 'eml' => 'message/rfc822',\n 'css' => 'text/css',\n 'html' => 'text/html',\n 'htm' => 'text/html',\n 'shtml' => 'text/html',\n 'log' => 'text/plain',\n 'text' => 'text/plain',\n 'txt' => 'text/plain',\n 'rtx' => 'text/richtext',\n 'rtf' => 'text/rtf',\n 'vcf' => 'text/vcard',\n 'vcard' => 'text/vcard',\n 'xml' => 'text/xml',\n 'xsl' => 'text/xml',\n 'mpeg' => 'video/mpeg',\n 'mpe' => 'video/mpeg',\n 'mpg' => 'video/mpeg',\n 'mov' => 'video/quicktime',\n 'qt' => 'video/quicktime',\n 'rv' => 'video/vnd.rn-realvideo',\n 'avi' => 'video/x-msvideo',\n 'movie' => 'video/x-sgi-movie'\n );\n if (array_key_exists(strtolower($ext), $mimes)) {\n return $mimes[strtolower($ext)];\n }\n return 'application/octet-stream';\n }", "static function get_mime_type($file) {\n $mime_types = array(\n \"pdf\" => \"application/pdf\"\n , \"exe\" => \"application/octet-stream\"\n , \"zip\" => \"application/zip\"\n // ,\"docx\"=>\"application/msword\"\n , \"docx\" => \"application/vnd.openxmlformats-officedocument.wordprocessingml.document\"\n , \"doc\" => \"application/msword\"\n , \"rtf\" => \"text/rtf\"\n , \"txt\" => \"text/plain\"\n , \"xls\" => \"application/vnd.ms-excel\"\n , \"ppt\" => \"application/vnd.ms-powerpoint\"\n , \"pptx\" => \"application/vnd.openxmlformats-officedocument.presentationml.presentation\"\n , \"gif\" => \"image/gif\"\n , \"png\" => \"image/png\"\n , \"jpeg\" => \"image/jpg\"\n , \"jpg\" => \"image/jpg\"\n , \"mp3\" => \"audio/mpeg\"\n , \"wav\" => \"audio/x-wav\"\n , \"mpeg\" => \"video/mpeg\"\n , \"mpg\" => \"video/mpeg\"\n , \"mpe\" => \"video/mpeg\"\n , \"mov\" => \"video/quicktime\"\n , \"avi\" => \"video/x-msvideo\"\n , \"3gp\" => \"video/3gpp\"\n , \"css\" => \"text/css\"\n , \"jsc\" => \"application/javascript\"\n , \"js\" => \"application/javascript\"\n , \"php\" => \"text/html\"\n , \"htm\" => \"text/html\"\n , \"html\" => \"text/html\"\n , \"xlsx\" => \"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet\"\n , \"xltx\" => \"application/vnd.openxmlformats-officedocument.spreadsheetml.template\"\n , \"potx\" => \"application/vnd.openxmlformats-officedocument.presentationml.template\"\n , \"ppsx\" => \"application/vnd.openxmlformats-officedocument.presentationml.slideshow\"\n , \"pptx\" => \"application/vnd.openxmlformats-officedocument.presentationml.presentation\"\n , \"sldx\" => \"application/vnd.openxmlformats-officedocument.presentationml.slide\"\n , \"docx\" => \"application/vnd.openxmlformats-officedocument.wordprocessingml.document\"\n , \"dotx\" => \"application/vnd.openxmlformats-officedocument.wordprocessingml.template\"\n , \"xlam\" => \"application/vnd.ms-excel.addin.macroEnabled.12\"\n , \"xlsb\" => \"application/vnd.ms-excel.sheet.binary.macroEnabled.12\"\n );\n $extention = explode('.', $file);\n $extension = end($extention);\n $extension = strtolower($extension);\n return $mime_types[$extension];\n }", "protected function mimeType($extension) {\n\t\t$extension = strtolower($extension);\n\t\t$mimeTypes = array(\n\t\t\t'ez'\t\t=> 'application/andrew-inset',\n\t\t\t'hqx'\t\t=> 'application/mac-binhex40',\n\t\t\t'cpt'\t\t=> 'application/mac-compactpro',\n\t\t\t'doc'\t\t=> 'application/msword',\n\t\t\t'bin'\t\t=> 'application/octet-stream',\n\t\t\t'dms'\t\t=> 'application/octet-stream',\n\t\t\t'lha'\t\t=> 'application/octet-stream',\n\t\t\t'lzh'\t\t=> 'application/octet-stream',\n\t\t\t'exe'\t\t=> 'application/octet-stream',\n\t\t\t'class'\t\t=> 'application/octet-stream',\n\t\t\t'so'\t\t=> 'application/octet-stream',\n\t\t\t'dll'\t\t=> 'application/octet-stream',\n\t\t\t'oda'\t\t=> 'application/oda',\n\t\t\t'odc'\t\t=> 'application/vnd.oasis.opendocument.chart',\n\t\t\t'odf'\t\t=> 'application/vnd.oasis.opendocument.formula',\n\t\t\t'odg'\t\t=> 'application/vnd.oasis.opendocument.graphics',\n\t\t\t'odi'\t\t=> 'application/vnd.oasis.opendocument.image',\n\t\t\t'odm'\t\t=> 'application/vnd.oasis.opendocument.text-master',\n\t\t\t'odp'\t\t=> 'application/vnd.oasis.opendocument.presentation',\n\t\t\t'ods'\t\t=> 'application/vnd.oasis.opendocument.spreadsheet',\n\t\t\t'odt'\t\t=> 'application/vnd.oasis.opendocument.text',\t\t\t\n\t\t\t'pdf'\t\t=> 'application/pdf',\n\t\t\t'ai'\t\t=> 'application/postscript',\n\t\t\t'eps'\t\t=> 'application/postscript',\n\t\t\t'ps'\t\t=> 'application/postscript',\n\t\t\t'smi'\t\t=> 'application/smil',\n\t\t\t'smil'\t\t=> 'application/smil',\n\t\t\t'mif'\t\t=> 'application/vnd.mif',\n\t\t\t'xls'\t\t=> 'application/vnd.ms-excel',\n\t\t\t'ppt'\t\t=> 'application/vnd.ms-powerpoint',\n\t\t\t'wbxml'\t\t=> 'application/vnd.wap.wbxml',\n\t\t\t'wmlc'\t\t=> 'application/vnd.wap.wmlc',\n\t\t\t'wmlsc'\t\t=> 'application/vnd.wap.wmlscriptc',\n\t\t\t'bcpio'\t\t=> 'application/x-bcpio',\n\t\t\t'vcd'\t\t=> 'application/x-cdlink',\n\t\t\t'pgn'\t\t=> 'application/x-chess-pgn',\n\t\t\t'cpio'\t\t=> 'application/x-cpio',\n\t\t\t'csh'\t\t=> 'application/x-csh',\n\t\t\t'dcr'\t\t=> 'application/x-director',\n\t\t\t'dir'\t\t=> 'application/x-director',\n\t\t\t'dxr'\t\t=> 'application/x-director',\n\t\t\t'dvi'\t\t=> 'application/x-dvi',\n\t\t\t'spl'\t\t=> 'application/x-futuresplash',\n\t\t\t'gtar'\t\t=> 'application/x-gtar',\n\t\t\t'hdf'\t\t=> 'application/x-hdf',\n\t\t\t'js'\t\t=> 'application/x-javascript',\n\t\t\t'skp'\t\t=> 'application/x-koan',\n\t\t\t'skd'\t\t=> 'application/x-koan',\n\t\t\t'skt'\t\t=> 'application/x-koan',\n\t\t\t'skm'\t\t=> 'application/x-koan',\n\t\t\t'latex'\t\t=> 'application/x-latex',\n\t\t\t'nc'\t\t=> 'application/x-netcdf',\n\t\t\t'cdf'\t\t=> 'application/x-netcdf',\n\t\t\t'sh'\t\t=> 'application/x-sh',\n\t\t\t'shar'\t\t=> 'application/x-shar',\n\t\t\t'swf'\t\t=> 'application/x-shockwave-flash',\n\t\t\t'sit'\t\t=> 'application/x-stuffit',\n\t\t\t'sv4cpio'\t=> 'application/x-sv4cpio',\n\t\t\t'sv4crc'\t=> 'application/x-sv4crc',\n\t\t\t'tar'\t\t=> 'application/x-tar',\n\t\t\t'tcl'\t\t=> 'application/x-tcl',\n\t\t\t'tex'\t\t=> 'application/x-tex',\n\t\t\t'texinfo'\t=> 'application/x-texinfo',\n\t\t\t'texi'\t\t=> 'application/x-texinfo',\n\t\t\t't'\t\t\t=> 'application/x-troff',\n\t\t\t'tr'\t\t=> 'application/x-troff',\n\t\t\t'roff'\t\t=> 'application/x-troff',\n\t\t\t'man'\t\t=> 'application/x-troff-man',\n\t\t\t'me'\t\t=> 'application/x-troff-me',\n\t\t\t'ms'\t\t=> 'application/x-troff-ms',\n\t\t\t'ustar'\t\t=> 'application/x-ustar',\n\t\t\t'src'\t\t=> 'application/x-wais-source',\n\t\t\t'xhtml'\t\t=> 'application/xhtml+xml',\n\t\t\t'xht'\t\t=> 'application/xhtml+xml',\n\t\t\t'zip'\t\t=> 'application/zip',\n\t\t\t'au'\t\t=> 'audio/basic',\n\t\t\t'snd'\t\t=> 'audio/basic',\n\t\t\t'mid'\t\t=> 'audio/midi',\n\t\t\t'midi'\t\t=> 'audio/midi',\n\t\t\t'kar'\t\t=> 'audio/midi',\n\t\t\t'mpga'\t\t=> 'audio/mpeg',\n\t\t\t'mp2'\t\t=> 'audio/mpeg',\n\t\t\t'mp3'\t\t=> 'audio/mpeg',\n\t\t\t'aif'\t\t=> 'audio/x-aiff',\n\t\t\t'aiff'\t\t=> 'audio/x-aiff',\n\t\t\t'aifc'\t\t=> 'audio/x-aiff',\n\t\t\t'm3u'\t\t=> 'audio/x-mpegurl',\n\t\t\t'ram'\t\t=> 'audio/x-pn-realaudio',\n\t\t\t'rm'\t\t=> 'audio/x-pn-realaudio',\n\t\t\t'rpm'\t\t=> 'audio/x-pn-realaudio-plugin',\n\t\t\t'ra'\t\t=> 'audio/x-realaudio',\n\t\t\t'wav'\t\t=> 'audio/x-wav',\n\t\t\t'pdb'\t\t=> 'chemical/x-pdb',\n\t\t\t'xyz'\t\t=> 'chemical/x-xyz',\n\t\t\t'bmp'\t\t=> 'image/bmp',\n\t\t\t'gif'\t\t=> 'image/gif',\n\t\t\t'ief'\t\t=> 'image/ief',\n\t\t\t'jpeg'\t\t=> 'image/jpeg',\n\t\t\t'jpg'\t\t=> 'image/jpeg',\n\t\t\t'jpe'\t\t=> 'image/jpeg',\n\t\t\t'png'\t\t=> 'image/png',\n\t\t\t'tiff'\t\t=> 'image/tiff',\n\t\t\t'tif'\t\t=> 'image/tiff',\n\t\t\t'djvu'\t\t=> 'image/vnd.djvu',\n\t\t\t'djv'\t\t=> 'image/vnd.djvu',\n\t\t\t'wbmp'\t\t=> 'image/vnd.wap.wbmp',\n\t\t\t'ras'\t\t=> 'image/x-cmu-raster',\n\t\t\t'pnm'\t\t=> 'image/x-portable-anymap',\n\t\t\t'pbm'\t\t=> 'image/x-portable-bitmap',\n\t\t\t'pgm'\t\t=> 'image/x-portable-graymap',\n\t\t\t'ppm'\t\t=> 'image/x-portable-pixmap',\n\t\t\t'rgb'\t\t=> 'image/x-rgb',\n\t\t\t'xbm'\t\t=> 'image/x-xbitmap',\n\t\t\t'xpm'\t\t=> 'image/x-xpixmap',\n\t\t\t'xwd'\t\t=> 'image/x-xwindowdump',\n\t\t\t'igs'\t\t=> 'model/iges',\n\t\t\t'iges'\t\t=> 'model/iges',\n\t\t\t'msh'\t\t=> 'model/mesh',\n\t\t\t'mesh'\t\t=> 'model/mesh',\n\t\t\t'silo'\t\t=> 'model/mesh',\n\t\t\t'wrl'\t\t=> 'model/vrml',\n\t\t\t'vrml'\t\t=> 'model/vrml',\n\t\t\t'css'\t\t=> 'text/css',\n\t\t\t'html'\t\t=> 'text/html',\n\t\t\t'htm'\t\t=> 'text/html',\n\t\t\t'asc'\t\t=> 'text/plain',\n\t\t\t'txt'\t\t=> 'text/plain',\n\t\t\t'rtx'\t\t=> 'text/richtext',\n\t\t\t'rtf'\t\t=> 'text/rtf',\n\t\t\t'sgml'\t\t=> 'text/sgml',\n\t\t\t'sgm'\t\t=> 'text/sgml',\n\t\t\t'tsv'\t\t=> 'text/tab-separated-values',\n\t\t\t'wml'\t\t=> 'text/vnd.wap.wml',\n\t\t\t'wmls'\t\t=> 'text/vnd.wap.wmlscript',\n\t\t\t'etx'\t\t=> 'text/x-setext',\n\t\t\t'xsl'\t\t=> 'text/xml',\n\t\t\t'xml'\t\t=> 'text/xml',\n\t\t\t'mpeg'\t\t=> 'video/mpeg',\n\t\t\t'mpg'\t\t=> 'video/mpeg',\n\t\t\t'mpe'\t\t=> 'video/mpeg',\n\t\t\t'qt'\t\t=> 'video/quicktime',\n\t\t\t'mov'\t\t=> 'video/quicktime',\n\t\t\t'mxu'\t\t=> 'video/vnd.mpegurl',\n\t\t\t'avi'\t\t=> 'video/x-msvideo',\n\t\t\t'movie'\t\t=> 'video/x-sgi-movie',\n\t\t\t'ice'\t\t=> 'x-conference/x-cooltalk',\n\t\t);\n\t\tif(isset($mimeTypes[$extension])) {\n\t\t\treturn $mimeTypes[$extension];\n\t\t}\n\t\telse {\n\t\t\treturn $this->_mailMimeFileTypeDefault;\n\t\t}\n\t}", "function mime2ext($mime){\n\t $all_mimes = '{\"png\":[\"image\\/png\",\"image\\/x-png\"],\"bmp\":[\"image\\/bmp\",\"image\\/x-bmp\",\n\t \"image\\/x-bitmap\",\"image\\/x-xbitmap\",\"image\\/x-win-bitmap\",\"image\\/x-windows-bmp\",\n\t \"image\\/ms-bmp\",\"image\\/x-ms-bmp\",\"application\\/bmp\",\"application\\/x-bmp\",\n\t \"application\\/x-win-bitmap\"],\"gif\":[\"image\\/gif\"],\"jpeg\":[\"image\\/jpeg\",\n\t \"image\\/pjpeg\"],\"xspf\":[\"application\\/xspf+xml\"],\"vlc\":[\"application\\/videolan\"],\n\t \"wmv\":[\"video\\/x-ms-wmv\",\"video\\/x-ms-asf\"],\"au\":[\"audio\\/x-au\"],\n\t \"ac3\":[\"audio\\/ac3\"],\"flac\":[\"audio\\/x-flac\"],\"ogg\":[\"audio\\/ogg\",\n\t \"video\\/ogg\",\"application\\/ogg\"],\"kmz\":[\"application\\/vnd.google-earth.kmz\"],\n\t \"kml\":[\"application\\/vnd.google-earth.kml+xml\"],\"rtx\":[\"text\\/richtext\"],\n\t \"rtf\":[\"text\\/rtf\"],\"jar\":[\"application\\/java-archive\",\"application\\/x-java-application\",\n\t \"application\\/x-jar\"],\"zip\":[\"application\\/x-zip\",\"application\\/zip\",\n\t \"application\\/x-zip-compressed\",\"application\\/s-compressed\",\"multipart\\/x-zip\"],\n\t \"7zip\":[\"application\\/x-compressed\"],\"xml\":[\"application\\/xml\",\"text\\/xml\"],\n\t \"svg\":[\"image\\/svg+xml\"],\"3g2\":[\"video\\/3gpp2\"],\"3gp\":[\"video\\/3gp\",\"video\\/3gpp\"],\n\t \"mp4\":[\"video\\/mp4\"],\"m4a\":[\"audio\\/x-m4a\"],\"f4v\":[\"video\\/x-f4v\"],\"flv\":[\"video\\/x-flv\"],\n\t \"webm\":[\"video\\/webm\"],\"aac\":[\"audio\\/x-acc\"],\"m4u\":[\"application\\/vnd.mpegurl\"],\n\t \"pdf\":[\"application\\/pdf\",\"application\\/octet-stream\"],\n\t \"pptx\":[\"application\\/vnd.openxmlformats-officedocument.presentationml.presentation\"],\n\t \"ppt\":[\"application\\/powerpoint\",\"application\\/vnd.ms-powerpoint\",\"application\\/vnd.ms-office\",\n\t \"application\\/msword\"],\"docx\":[\"application\\/vnd.openxmlformats-officedocument.wordprocessingml.document\"],\n\t \"xlsx\":[\"application\\/vnd.openxmlformats-officedocument.spreadsheetml.sheet\",\"application\\/vnd.ms-excel\"],\n\t \"xl\":[\"application\\/excel\"],\"xls\":[\"application\\/msexcel\",\"application\\/x-msexcel\",\"application\\/x-ms-excel\",\n\t \"application\\/x-excel\",\"application\\/x-dos_ms_excel\",\"application\\/xls\",\"application\\/x-xls\"],\n\t \"xsl\":[\"text\\/xsl\"],\"mpeg\":[\"video\\/mpeg\"],\"mov\":[\"video\\/quicktime\"],\"avi\":[\"video\\/x-msvideo\",\n\t \"video\\/msvideo\",\"video\\/avi\",\"application\\/x-troff-msvideo\"],\"movie\":[\"video\\/x-sgi-movie\"],\n\t \"log\":[\"text\\/x-log\"],\"txt\":[\"text\\/plain\"],\"css\":[\"text\\/css\"],\"html\":[\"text\\/html\"],\n\t \"wav\":[\"audio\\/x-wav\",\"audio\\/wave\",\"audio\\/wav\"],\"xhtml\":[\"application\\/xhtml+xml\"],\n\t \"tar\":[\"application\\/x-tar\"],\"tgz\":[\"application\\/x-gzip-compressed\"],\"psd\":[\"application\\/x-photoshop\",\n\t \"image\\/vnd.adobe.photoshop\"],\"exe\":[\"application\\/x-msdownload\"],\"js\":[\"application\\/x-javascript\"],\n\t \"mp3\":[\"audio\\/mpeg\",\"audio\\/mpg\",\"audio\\/mpeg3\",\"audio\\/mp3\"],\"rar\":[\"application\\/x-rar\",\"application\\/rar\",\n\t \"application\\/x-rar-compressed\"],\"gzip\":[\"application\\/x-gzip\"],\"hqx\":[\"application\\/mac-binhex40\",\n\t \"application\\/mac-binhex\",\"application\\/x-binhex40\",\"application\\/x-mac-binhex40\"],\n\t \"cpt\":[\"application\\/mac-compactpro\"],\"bin\":[\"application\\/macbinary\",\"application\\/mac-binary\",\n\t \"application\\/x-binary\",\"application\\/x-macbinary\"],\"oda\":[\"application\\/oda\"],\n\t \"ai\":[\"application\\/postscript\"],\"smil\":[\"application\\/smil\"],\"mif\":[\"application\\/vnd.mif\"],\n\t \"wbxml\":[\"application\\/wbxml\"],\"wmlc\":[\"application\\/wmlc\"],\"dcr\":[\"application\\/x-director\"],\n\t \"dvi\":[\"application\\/x-dvi\"],\"gtar\":[\"application\\/x-gtar\"],\"php\":[\"application\\/x-httpd-php\",\n\t \"application\\/php\",\"application\\/x-php\",\"text\\/php\",\"text\\/x-php\",\"application\\/x-httpd-php-source\"],\n\t \"swf\":[\"application\\/x-shockwave-flash\"],\"sit\":[\"application\\/x-stuffit\"],\"z\":[\"application\\/x-compress\"],\n\t \"mid\":[\"audio\\/midi\"],\"aif\":[\"audio\\/x-aiff\",\"audio\\/aiff\"],\"ram\":[\"audio\\/x-pn-realaudio\"],\n\t \"rpm\":[\"audio\\/x-pn-realaudio-plugin\"],\"ra\":[\"audio\\/x-realaudio\"],\"rv\":[\"video\\/vnd.rn-realvideo\"],\n\t \"jp2\":[\"image\\/jp2\",\"video\\/mj2\",\"image\\/jpx\",\"image\\/jpm\"],\"tiff\":[\"image\\/tiff\"],\n\t \"eml\":[\"message\\/rfc822\"],\"pem\":[\"application\\/x-x509-user-cert\",\"application\\/x-pem-file\"],\n\t \"p10\":[\"application\\/x-pkcs10\",\"application\\/pkcs10\"],\"p12\":[\"application\\/x-pkcs12\"],\n\t \"p7a\":[\"application\\/x-pkcs7-signature\"],\"p7c\":[\"application\\/pkcs7-mime\",\"application\\/x-pkcs7-mime\"],\"p7r\":[\"application\\/x-pkcs7-certreqresp\"],\"p7s\":[\"application\\/pkcs7-signature\"],\"crt\":[\"application\\/x-x509-ca-cert\",\"application\\/pkix-cert\"],\"crl\":[\"application\\/pkix-crl\",\"application\\/pkcs-crl\"],\"pgp\":[\"application\\/pgp\"],\"gpg\":[\"application\\/gpg-keys\"],\"rsa\":[\"application\\/x-pkcs7\"],\"ics\":[\"text\\/calendar\"],\"zsh\":[\"text\\/x-scriptzsh\"],\"cdr\":[\"application\\/cdr\",\"application\\/coreldraw\",\"application\\/x-cdr\",\"application\\/x-coreldraw\",\"image\\/cdr\",\"image\\/x-cdr\",\"zz-application\\/zz-winassoc-cdr\"],\"wma\":[\"audio\\/x-ms-wma\"],\"vcf\":[\"text\\/x-vcard\"],\"srt\":[\"text\\/srt\"],\"vtt\":[\"text\\/vtt\"],\"ico\":[\"image\\/x-icon\",\"image\\/x-ico\",\"image\\/vnd.microsoft.icon\"],\"csv\":[\"text\\/x-comma-separated-values\",\"text\\/comma-separated-values\",\"application\\/vnd.msexcel\"],\"json\":[\"application\\/json\",\"text\\/json\"]}';\n\t $all_mimes = json_decode($all_mimes,true);\n\t foreach ($all_mimes as $key => $value) {\n\t if(array_search($mime,$value) !== false) return $key;\n\t }\n\t return false;\n\t}", "function atkGetMimeTypeFromFileExtension($filename)\n {\n $ext = strtolower(end(explode('.',$filename )));\n\n $mimetypes = array(\n 'ai' =>'application/postscript',\n 'aif' =>'audio/x-aiff',\n 'aifc' =>'audio/x-aiff',\n 'aiff' =>'audio/x-aiff',\n 'asc' =>'text/plain',\n 'atom' =>'application/atom+xml',\n 'avi' =>'video/x-msvideo',\n 'bcpio' =>'application/x-bcpio',\n 'bmp' =>'image/bmp',\n 'cdf' =>'application/x-netcdf',\n 'cgm' =>'image/cgm',\n 'cpio' =>'application/x-cpio',\n 'cpt' =>'application/mac-compactpro',\n 'crl' =>'application/x-pkcs7-crl',\n 'crt' =>'application/x-x509-ca-cert',\n 'csh' =>'application/x-csh',\n 'css' =>'text/css',\n 'dcr' =>'application/x-director',\n 'dir' =>'application/x-director',\n 'djv' =>'image/vnd.djvu',\n 'djvu' =>'image/vnd.djvu',\n 'doc' =>'application/msword',\n 'dtd' =>'application/xml-dtd',\n 'dvi' =>'application/x-dvi',\n 'dxr' =>'application/x-director',\n 'eps' =>'application/postscript',\n 'etx' =>'text/x-setext',\n 'ez' =>'application/andrew-inset',\n 'gif' =>'image/gif',\n 'gram' =>'application/srgs',\n 'grxml' =>'application/srgs+xml',\n 'gtar' =>'application/x-gtar',\n 'hdf' =>'application/x-hdf',\n 'hqx' =>'application/mac-binhex40',\n 'html' =>'text/html',\n 'html' =>'text/html',\n 'ice' =>'x-conference/x-cooltalk',\n 'ico' =>'image/x-icon',\n 'ics' =>'text/calendar',\n 'ief' =>'image/ief',\n 'ifb' =>'text/calendar',\n 'iges' =>'model/iges',\n 'igs' =>'model/iges',\n 'jpe' =>'image/jpeg',\n 'jpeg' =>'image/jpeg',\n 'jpg' =>'image/jpeg',\n 'js' =>'application/x-javascript',\n 'kar' =>'audio/midi',\n 'latex' =>'application/x-latex',\n 'm3u' =>'audio/x-mpegurl',\n 'man' =>'application/x-troff-man',\n 'mathml' =>'application/mathml+xml',\n 'me' =>'application/x-troff-me',\n 'mesh' =>'model/mesh',\n 'mid' =>'audio/midi',\n 'midi' =>'audio/midi',\n 'mif' =>'application/vnd.mif',\n 'mov' =>'video/quicktime',\n 'movie' =>'video/x-sgi-movie',\n 'mp2' =>'audio/mpeg',\n 'mp3' =>'audio/mpeg',\n 'mpe' =>'video/mpeg',\n 'mpeg' =>'video/mpeg',\n 'mpg' =>'video/mpeg',\n 'mpga' =>'audio/mpeg',\n 'ms' =>'application/x-troff-ms',\n 'msh' =>'model/mesh',\n 'mxu m4u' =>'video/vnd.mpegurl',\n 'nc' =>'application/x-netcdf',\n 'oda' =>'application/oda',\n 'ogg' =>'application/ogg',\n 'pbm' =>'image/x-portable-bitmap',\n 'pdb' =>'chemical/x-pdb',\n 'pdf' =>'application/pdf',\n 'pgm' =>'image/x-portable-graymap',\n 'pgn' =>'application/x-chess-pgn',\n 'php' =>'application/x-httpd-php',\n 'php4' =>'application/x-httpd-php',\n 'php3' =>'application/x-httpd-php',\n 'phtml' =>'application/x-httpd-php',\n 'phps' =>'application/x-httpd-php-source',\n 'png' =>'image/png',\n 'pnm' =>'image/x-portable-anymap',\n 'ppm' =>'image/x-portable-pixmap',\n 'ppt' =>'application/vnd.ms-powerpoint',\n 'ps' =>'application/postscript',\n 'qt' =>'video/quicktime',\n 'ra' =>'audio/x-pn-realaudio',\n 'ram' =>'audio/x-pn-realaudio',\n 'ras' =>'image/x-cmu-raster',\n 'rdf' =>'application/rdf+xml',\n 'rgb' =>'image/x-rgb',\n 'rm' =>'application/vnd.rn-realmedia',\n 'roff' =>'application/x-troff',\n 'rtf' =>'text/rtf',\n 'rtx' =>'text/richtext',\n 'sgm' =>'text/sgml',\n 'sgml' =>'text/sgml',\n 'sh' =>'application/x-sh',\n 'shar' =>'application/x-shar',\n 'shtml' =>'text/html',\n 'silo' =>'model/mesh',\n 'sit' =>'application/x-stuffit',\n 'skd' =>'application/x-koan',\n 'skm' =>'application/x-koan',\n 'skp' =>'application/x-koan',\n 'skt' =>'application/x-koan',\n 'smi' =>'application/smil',\n 'smil' =>'application/smil',\n 'snd' =>'audio/basic',\n 'spl' =>'application/x-futuresplash',\n 'src' =>'application/x-wais-source',\n 'sv4cpio' =>'application/x-sv4cpio',\n 'sv4crc' =>'application/x-sv4crc',\n 'svg' =>'image/svg+xml',\n 'swf' =>'application/x-shockwave-flash',\n 't' =>'application/x-troff',\n 'tar' =>'application/x-tar',\n 'tcl' =>'application/x-tcl',\n 'tex' =>'application/x-tex',\n 'texi' =>'application/x-texinfo',\n 'texinfo' =>'application/x-texinfo',\n 'tgz' =>'application/x-tar',\n 'tif' =>'image/tiff',\n 'tiff' =>'image/tiff',\n 'tr' =>'application/x-troff',\n 'tsv' =>'text/tab-separated-values',\n 'txt' =>'text/plain',\n 'ustar' =>'application/x-ustar',\n 'vcd' =>'application/x-cdlink',\n 'vrml' =>'model/vrml',\n 'vxml' =>'application/voicexml+xml',\n 'wav' =>'audio/x-wav',\n 'wbmp' =>'image/vnd.wap.wbmp',\n 'wbxml' =>'application/vnd.wap.wbxml',\n 'wml' =>'text/vnd.wap.wml',\n 'wmlc' =>'application/vnd.wap.wmlc',\n 'wmlc' =>'application/vnd.wap.wmlc',\n 'wmls' =>'text/vnd.wap.wmlscript',\n 'wmlsc' =>'application/vnd.wap.wmlscriptc',\n 'wmlsc' =>'application/vnd.wap.wmlscriptc',\n 'wrl' =>'model/vrml',\n 'xbm' =>'image/x-xbitmap',\n 'xht' =>'application/xhtml+xml',\n 'xhtml' =>'application/xhtml+xml',\n 'xls' =>'application/vnd.ms-excel',\n 'xml xsl' =>'application/xml',\n 'xpm' =>'image/x-xpixmap',\n 'xslt' =>'application/xslt+xml',\n 'xul' =>'application/vnd.mozilla.xul+xml',\n 'xwd' =>'image/x-xwindowdump',\n 'xyz' =>'chemical/x-xyz',\n 'zip' =>'application/zip'\n );\n\n $ext = trim(strtolower($ext));\n if (array_key_exists($ext,$mimetypes))\n {\n atkdebug(\"Filetype for $filename is {$mimetypes[$ext]}\");\n return $mimetypes[$ext];\n }\n else\n {\n atkdebug(\"Filetype for $filename could not be found. Returning application/octet-stream.\");\n return \"application/octet-stream\";\n }\n }", "function getMime($ext) {\n\t\t$knownExts = array(\n\t\t'gif' => 'image/gif',\n\t\t'jpg' => 'image/jpeg',\n\t\t'jpeg' => 'image/jpeg',\n\t\t'png' => 'image/png',\n\t\t'psd' => 'image/psd',\n\t\t'zip' => 'application/x-zip-compressed',\n\t\t'rar' => 'application/x-rar-compressed',\n\t\t'7z' => 'application/x-7z-compressed',\n\t\t'doc' => 'application/msword',\n\t\t'docx' => 'application/msword',\n\t\t'odt' => 'application/vnd.oasis.opendocument.text',\n\t\t'rtf' => 'text/richtext',\n\t\t'swf' => 'application/x-shockwave-flash',\n\t\t'tif' => 'image/tiff',\n\t\t'au' => 'audio/basic',\n\t\t'pdf' => 'application/pdf',\n\t\t'mp3' => 'audio/mpeg',\n\t\t'ogg' => 'audio/ogg',\n\t\t'ico' => 'image/x-icon',\n\t\t'mpg' => 'application/mpeg',\n\t\t'mpeg' => 'application/mpeg',\n\t\t'qt' => 'video/quicktime',\n\t\t'mov' => 'video/quicktime',\n\t\t'mp4' => 'video/mpeg',\n\t\t'avi' => 'video/avi',\n\t\t'mkv' => 'video/x-matroska',\n\t\t'txt' => 'text/plain',\n\t\t'bat' => 'text/plain',\n\t\t'html' => 'text/html',\n\t\t'htm' => 'text/html',\n\t\t'xml' => 'application/xml',\n\t\t'xls' => 'application/vnd.ms-excel',\n\t\t'wmv' => 'video/x-ms-wmv',\n\t\t'pps' => 'application/vnd.ms-powerpoint',\n\t\t'ppt' => 'application/vnd.ms-powerpoint',\n\t\t'exe' => 'application/octet-stream',\n\t\t'msi' => 'application/x-ole-storage',\n\t\t'ps' => 'application/postscript',\n\t\t'qif' => 'image/x-quicktime',\n\t\t'ai' => 'application/postscript',\n\t\t'wma' => 'audio/x-ms-wma',\n\t\t'css' => 'text/css',\n\t\t'js' => 'text/javascript',\n\t\t'rss' => 'application/rss+xml',\n\t\t'json' => 'text/javascript'\n\t\t);\n\t\treturn isset($knownExts[$ext])?$knownExts[$ext]:\"\";\n\t}", "function getMimeType($file) {\n\t\t$len = strlen($file);\n\t\t$ext = substr($file,strrpos($file,\".\")+1,$len);\n\t\t$extArray['pdf'] = array(\textension \t=> \t'pdf',\n\t\t\t\t\t\t\t\t\tdesc\t \t=> \t'Adobe PDF File',\n\t\t\t\t\t\t\t\t\tmimetype\t=>\t'application/pdf');\n\t\t$extArray['zip'] = array(\textension \t=> \t'zip',\n\t\t\t\t\t\t\t\t\tdesc\t \t=> \t'ZIP-File',\n\t\t\t\t\t\t\t\t\tmimetype\t=>\t'application/zip');\n\t\t$extArray['xls'] = array(\textension \t=> \t'xls',\n\t\t\t\t\t\t\t\t\tdesc\t \t=> \t'Microsoft Excel File',\n\t\t\t\t\t\t\t\t\tmimetype\t=>\t'application/vnd.ms-excel');\n\t\t$extArray['xlt'] = array(\textension \t=> \t'xlt',\n\t\t\t\t\t\t\t\t\tdesc\t \t=> \t'Microsoft Excel Vorlagen File',\n\t\t\t\t\t\t\t\t\tmimetype\t=>\t'application/vnd.ms-excel');\n\t\t$extArray['doc'] = array(\textension \t=> \t'doc',\n\t\t\t\t\t\t\t\t\tdesc\t \t=> \t'Microsoft Word File',\n\t\t\t\t\t\t\t\t\tmimetype\t=>\t'application/word');\n\t\t$extArray['dot'] = array(\textension \t=> \t'dot',\n\t\t\t\t\t\t\t\t\tdesc\t \t=> \t'Microsoft Word Vorlagen File',\n\t\t\t\t\t\t\t\t\tmimetype\t=>\t'application/word');\n\t\t$extArray['jpg'] = array(\textension \t=> \t'jpg',\n\t\t\t\t\t\t\t\t\tdesc\t \t=> \t'JPEG Picture File',\n\t\t\t\t\t\t\t\t\tmimetype\t=>\t'image/jpg');\n\t\t$extArray['vsd'] = array(\textension \t=> \t'vsd',\n\t\t\t\t\t\t\t\t\tdesc\t \t=> \t'Microsoft Visio File',\n\t\t\t\t\t\t\t\t\tmimetype\t=>\t'application/x-msdownload');\n\t\t$extArray['ppt'] = array(\textension \t=> \t'ppt',\n\t\t\t\t\t\t\t\t\tdesc\t \t=> \t'Microsoft Powerpoint File',\n\t\t\t\t\t\t\t\t\tmimetype\t=>\t'application/x-msdownload');\n\t\t$extArray['pot'] = array(\textension \t=> \t'pot',\n\t\t\t\t\t\t\t\t\tdesc\t \t=> \t'Microsoft Powerpoint Template File',\n\t\t\t\t\t\t\t\t\tmimetype\t=>\t'application/x-msdownload');\n\t\t$extArray['tif'] = array(\textension \t=> \t'tif',\n\t\t\t\t\t\t\t\t\tdesc\t \t=> \t'Tagged Image File - TIF',\n\t\t\t\t\t\t\t\t\tmimetype\t=>\t'image/tiff');\n\t\t$extArray['eps'] = array(\textension \t=> \t'eps',\n\t\t\t\t\t\t\t\t\tdesc\t \t=> \t'Encasulated Postscript - EPS',\n\t\t\t\t\t\t\t\t\tmimetype\t=>\t'application/postscript');\n\t\t$extArray['txt'] = array(\textension \t=> \t'txt',\n\t\t\t\t\t\t\t\t\tdesc\t \t=> \t'Plaintext',\n\t\t\t\t\t\t\t\t\tmimetype\t=>\t'text/pain');\n\t\t$extArray['swf'] = array(\textension \t=> \t'swf',\n\t\t\t\t\t\t\t\t\tdesc\t \t=> \t'ShockWave Flash',\n\t\t\t\t\t\t\t\t\tmimetype\t=>\t'application/x-shockwave-flash');\n\t\t$extArray['gif'] = array(\textension \t=> \t'gif',\n\t\t\t\t\t\t\t\t\tdesc\t \t=> \t'Compuserve Graphics Interchange Format',\n\t\t\t\t\t\t\t\t\tmimetype\t=>\t'image/gif');\n\t\t$extArray['png'] = array(\textension \t=> \t'png',\n\t\t\t\t\t\t\t\t\tdesc\t \t=> \t'Portable Network Graphics',\n\t\t\t\t\t\t\t\t\tmimetype\t=>\t'image/png');\n\t\t$extArray['flv'] = array(\textension \t=> \t'flv',\n\t\t\t\t\t\t\t\t\tdesc\t \t=> \t'Flash Video',\n\t\t\t\t\t\t\t\t\tmimetype\t=>\t'video/mp4');\n\t\t$extArray['mp3'] = array(\textension \t=> \t'mp3',\n\t\t\t\t\t\t\t\t\tdesc\t \t=> \t'MPEG-1 Audio Layer 3',\n\t\t\t\t\t\t\t\t\tmimetype\t=>\t'audio/mpeg');\n\t\t$extArray['unknown'] = array(\textension \t=> \t'unknown',\n\t\t\t\t\t\t\t\t\tdesc\t \t=> \t'Unknown Filetype',\n\t\t\t\t\t\t\t\t\tmimetype\t=>\t'application/x-msdownload');\n\t\tif (array_key_exists($ext,$extArray)) {\n\t\t\treturn $extArray[$ext];\n\t\t} else {\n\t\t\treturn $extArray['unknown'];\n\t\t}\n\t}", "function mime2ext($mime){\n $all_mimes = '{\n \"png\":[\"image\\/png\",\"image\\/x-png\"],\n \"bmp\":[\"image\\/bmp\",\"image\\/x-bmp\",\"image\\/x-bitmap\",\"image\\/x-xbitmap\",\"image\\/x-win-bitmap\",\"image\\/x-windows-bmp\",\"image\\/ms-bmp\",\"image\\/x-ms-bmp\",\"application\\/bmp\",\"application\\/x-bmp\",\"application\\/x-win-bitmap\"],\n \"gif\":[\"image\\/gif\"],\n \"jpeg\":[\"image\\/jpeg\",\"image\\/pjpeg\"],\n \"xspf\":[\"application\\/xspf+xml\"],\n \"vlc\":[\"application\\/videolan\"],\n \"wmv\":[\"video\\/x-ms-wmv\",\"video\\/x-ms-asf\"],\n \"au\":[\"audio\\/x-au\"],\n \"ac3\":[\"audio\\/ac3\"],\n \"flac\":[\"audio\\/x-flac\"],\n \"ogg\":[\"audio\\/ogg\",\"video\\/ogg\",\"application\\/ogg\"],\n \"kmz\":[\"application\\/vnd.google-earth.kmz\"],\n \"kml\":[\"application\\/vnd.google-earth.kml+xml\"],\n \"rtx\":[\"text\\/richtext\"],\n \"rtf\":[\"text\\/rtf\"],\n \"jar\":[\"application\\/java-archive\",\"application\\/x-java-application\",\"application\\/x-jar\"],\n \"zip\":[\"application\\/x-zip\",\"application\\/zip\",\"application\\/x-zip-compressed\",\"application\\/s-compressed\",\"multipart\\/x-zip\"],\n \"7zip\":[\"application\\/x-compressed\"],\n \"xml\":[\"application\\/xml\",\"text\\/xml\"],\n \"svg\":[\"image\\/svg+xml\"],\n \"3g2\":[\"video\\/3gpp2\"],\n \"3gp\":[\"video\\/3gp\",\"video\\/3gpp\"],\n \"mp4\":[\"video\\/mp4\"],\n \"m4a\":[\"audio\\/x-m4a\"],\n \"f4v\":[\"video\\/x-f4v\"],\n \"flv\":[\"video\\/x-flv\"],\n \"webm\":[\"video\\/webm\"],\n \"aac\":[\"audio\\/x-acc\"],\n \"m4u\":[\"application\\/vnd.mpegurl\"],\n \"pdf\":[\"application\\/pdf\",\"application\\/octet-stream\"],\n \"pptx\":[\"application\\/vnd.openxmlformats-officedocument.presentationml.presentation\"],\n \"ppt\":[\"application\\/powerpoint\",\"application\\/vnd.ms-powerpoint\",\"application\\/vnd.ms-office\",\n \"application\\/msword\"],\n \"docx\":[\"application\\/vnd.openxmlformats-officedocument.wordprocessingml.document\"],\n \"xlsx\":[\"application\\/vnd.openxmlformats-officedocument.spreadsheetml.sheet\",\"application\\/vnd.ms-excel\"],\n \"xl\":[\"application\\/excel\"],\n \"xls\":[\"application\\/msexcel\",\"application\\/x-msexcel\",\"application\\/x-ms-excel\",\"application\\/x-excel\",\"application\\/x-dos_ms_excel\",\"application\\/xls\",\"application\\/x-xls\"],\n \"xsl\":[\"text\\/xsl\"],\"mpeg\":[\"video\\/mpeg\"],\n \"mov\":[\"video\\/quicktime\"],\n \"avi\":[\"video\\/x-msvideo\",\"video\\/msvideo\",\"video\\/avi\",\"application\\/x-troff-msvideo\"],\n \"movie\":[\"video\\/x-sgi-movie\"],\n \"log\":[\"text\\/x-log\"],\n \"txt\":[\"text\\/plain\"],\n \"css\":[\"text\\/css\"],\n \"html\":[\"text\\/html\"],\n \"wav\":[\"audio\\/x-wav\",\"audio\\/wave\",\"audio\\/wav\"],\n \"xhtml\":[\"application\\/xhtml+xml\"],\n \"tar\":[\"application\\/x-tar\"],\n \"tgz\":[\"application\\/x-gzip-compressed\"],\n \"psd\":[\"application\\/x-photoshop\",\n \"image\\/vnd.adobe.photoshop\"],\n \"exe\":[\"application\\/x-msdownload\"],\n \"js\":[\"application\\/x-javascript\"],\n \"mp3\":[\"audio\\/mpeg\",\"audio\\/mpg\",\"audio\\/mpeg3\",\"audio\\/mp3\"],\n \"rar\":[\"application\\/x-rar\",\"application\\/rar\",\"application\\/x-rar-compressed\"],\n \"gzip\":[\"application\\/x-gzip\"],\n \"hqx\":[\"application\\/mac-binhex40\",\"application\\/mac-binhex\",\"application\\/x-binhex40\",\"application\\/x-mac-binhex40\"],\n \"cpt\":[\"application\\/mac-compactpro\"],\n \"bin\":[\"application\\/macbinary\",\"application\\/mac-binary\",\"application\\/x-binary\",\"application\\/x-macbinary\"],\n \"oda\":[\"application\\/oda\"],\n \"ai\":[\"application\\/postscript\"],\n \"smil\":[\"application\\/smil\"],\n \"mif\":[\"application\\/vnd.mif\"],\n \"wbxml\":[\"application\\/wbxml\"],\n \"wmlc\":[\"application\\/wmlc\"],\n \"dcr\":[\"application\\/x-director\"],\n \"dvi\":[\"application\\/x-dvi\"],\n \"gtar\":[\"application\\/x-gtar\"],\n \"php\":[\"application\\/x-httpd-php\",\"application\\/php\",\"application\\/x-php\",\"text\\/php\",\"text\\/x-php\",\"application\\/x-httpd-php-source\"],\n \"swf\":[\"application\\/x-shockwave-flash\"],\n \"sit\":[\"application\\/x-stuffit\"],\n \"z\":[\"application\\/x-compress\"],\n \"mid\":[\"audio\\/midi\"],\n \"aif\":[\"audio\\/x-aiff\",\"audio\\/aiff\"],\n \"ram\":[\"audio\\/x-pn-realaudio\"],\n \"rpm\":[\"audio\\/x-pn-realaudio-plugin\"],\n \"ra\":[\"audio\\/x-realaudio\"],\n \"rv\":[\"video\\/vnd.rn-realvideo\"],\n \"jp2\":[\"image\\/jp2\",\"video\\/mj2\",\"image\\/jpx\",\"image\\/jpm\"],\n \"tiff\":[\"image\\/tiff\"],\n \"eml\":[\"message\\/rfc822\"],\n \"pem\":[\"application\\/x-x509-user-cert\",\"application\\/x-pem-file\"],\n \"p10\":[\"application\\/x-pkcs10\",\"application\\/pkcs10\"],\n \"p12\":[\"application\\/x-pkcs12\"],\n \"p7a\":[\"application\\/x-pkcs7-signature\"],\n \"p7c\":[\"application\\/pkcs7-mime\",\"application\\/x-pkcs7-mime\"],\n \"p7r\":[\"application\\/x-pkcs7-certreqresp\"],\n \"p7s\":[\"application\\/pkcs7-signature\"],\n \"crt\":[\"application\\/x-x509-ca-cert\",\"application\\/pkix-cert\"],\n \"crl\":[\"application\\/pkix-crl\",\"application\\/pkcs-crl\"],\n \"pgp\":[\"application\\/pgp\"],\n \"gpg\":[\"application\\/gpg-keys\"],\n \"rsa\":[\"application\\/x-pkcs7\"],\n \"ics\":[\"text\\/calendar\"],\n \"zsh\":[\"text\\/x-scriptzsh\"],\n \"cdr\":[\"application\\/cdr\",\"application\\/coreldraw\",\"application\\/x-cdr\",\"application\\/x-coreldraw\",\"image\\/cdr\",\"image\\/x-cdr\",\"zz-application\\/zz-winassoc-cdr\"],\n \"wma\":[\"audio\\/x-ms-wma\"],\n \"vcf\":[\"text\\/x-vcard\"],\n \"srt\":[\"text\\/srt\"],\n \"vtt\":[\"text\\/vtt\"],\n \"ico\":[\"image\\/x-icon\",\"image\\/x-ico\",\"image\\/vnd.microsoft.icon\"],\n \"csv\":[\"text\\/x-comma-separated-values\",\"text\\/comma-separated-values\",\"application\\/vnd.msexcel\"],\n \"json\":[\"application\\/json\",\"text\\/json\"]\n }';\n $all_mimes = json_decode($all_mimes,true);\n foreach ($all_mimes as $key => $value) {\n if(array_search($mime,$value) !== false) return $key;\n }\n return false;\n}", "function mimeType ($s_extension) {\n\t//you can pass a full filename if you want to be lazy (saves extra code elsewhere)\n\tswitch (pathinfo (strtolower ($s_extension), PATHINFO_EXTENSION)) {\n\t\t//images\n\t\tcase 'gif':\t\t\t\treturn 'image/gif';\t\t\tbreak;\n\t\tcase 'jpg': case 'jpeg': \t\treturn 'image/jpeg';\t\t\tbreak;\n\t\tcase 'png':\t\t\t\treturn 'image/png';\t\t\tbreak;\n\t\t//code\n\t\tcase 'asp':\t\t\t\treturn 'text/asp';\t\t\tbreak;\n\t\tcase 'css':\t\t\t\treturn 'text/css';\t\t\tbreak;\n\t\tcase 'html':\t\t\t\treturn 'text/html';\t\t\tbreak;\n\t\tcase 'js':\t\t\t\treturn 'application/javascript';\tbreak;\n\t\tcase 'php':\t\t\t\treturn 'application/x-httpd-php';\tbreak;\n\t\t//documents\n\t\tcase 'pdf':\t\t\t\treturn 'application/pdf';\t\tbreak;\n\t\tcase 'txt': case 'do': case 'log':\treturn 'text/plain';\t\t\tbreak;\n\t\tcase 'rem':\t\t\t\treturn 'text/remarkable';\t\tbreak;\n\t\t//downloads\n\t\tcase 'exe': case 'dmg':\t\t\treturn 'application/octet-stream';\tbreak;\n\t\tcase 'sh':\t\t\t\treturn 'application/x-sh';\t\tbreak;\n\t\tcase 'zip':\t\t\t\treturn 'application/zip';\t\tbreak;\n\t\t//media\n\t\tcase 'mp3':\t\t\t\treturn 'audio/mpeg';\t\t\tbreak;\n\t\tcase 'oga':\t\t\t\treturn 'audio/ogg';\t\t\tbreak;\n\t\tcase 'ogv':\t\t\t\treturn 'video/ogg';\t\t\tbreak;\n\t\t//fonts\n\t\tcase 'ttf':\t\t\t\treturn 'font/ttf';\t\t\tbreak;\n\t\tcase 'otf':\t\t\t\treturn 'font/otf';\t\t\tbreak;\n\t\tcase 'woff':\t\t\t\treturn 'font/x-woff';\t\t\tbreak;\n\t\tdefault:\t\t\t\treturn 'application/octet-stream';\tbreak;\n\t}\n}", "protected function getMimeContentType($filename)\r\n {\r\n $mime_types = array(\r\n\r\n 'txt' => 'text/plain',\r\n 'htm' => 'text/html',\r\n 'html' => 'text/html',\r\n 'php' => 'text/html',\r\n 'css' => 'text/css',\r\n 'js' => 'application/javascript',\r\n 'json' => 'application/json',\r\n 'xml' => 'application/xml',\r\n 'swf' => 'application/x-shockwave-flash',\r\n 'flv' => 'video/x-flv',\r\n\r\n // images\r\n 'png' => 'image/png',\r\n 'jpe' => 'image/jpeg',\r\n 'jpeg' => 'image/jpeg',\r\n 'jpg' => 'image/jpeg',\r\n 'gif' => 'image/gif',\r\n 'bmp' => 'image/bmp',\r\n 'ico' => 'image/vnd.microsoft.icon',\r\n 'tiff' => 'image/tiff',\r\n 'tif' => 'image/tiff',\r\n 'svg' => 'image/svg+xml',\r\n 'svgz' => 'image/svg+xml',\r\n\r\n // archives\r\n 'zip' => 'application/zip',\r\n 'rar' => 'application/x-rar-compressed',\r\n 'exe' => 'application/x-msdownload',\r\n 'msi' => 'application/x-msdownload',\r\n 'cab' => 'application/vnd.ms-cab-compressed',\r\n\r\n // audio/video\r\n 'mp3' => 'audio/mpeg',\r\n 'qt' => 'video/quicktime',\r\n 'mov' => 'video/quicktime',\r\n\r\n // adobe\r\n 'pdf' => 'application/pdf',\r\n 'psd' => 'image/vnd.adobe.photoshop',\r\n 'ai' => 'application/postscript',\r\n 'eps' => 'application/postscript',\r\n 'ps' => 'application/postscript',\r\n\r\n // ms office\r\n 'doc' => 'application/msword',\r\n 'rtf' => 'application/rtf',\r\n 'xls' => 'application/vnd.ms-excel',\r\n 'ppt' => 'application/vnd.ms-powerpoint',\r\n\r\n // open office\r\n 'odt' => 'application/vnd.oasis.opendocument.text',\r\n 'ods' => 'application/vnd.oasis.opendocument.spreadsheet',\r\n );\r\n\r\n $ext = strtolower(array_pop(explode('.',$filename)));\r\n if (array_key_exists($ext, $mime_types)) {\r\n return $mime_types[$ext];\r\n } elseif (function_exists('finfo_open')) {\r\n $finfo = finfo_open(FILEINFO_MIME);\r\n $mimeType = finfo_file($finfo, $filename);\r\n finfo_close($finfo);\r\n return $mimeType;\r\n } else {\r\n return 'application/octet-stream';\r\n }\r\n }", "private function getMimeTypes()\n {\n return apply_filters('wplms_assignments_upload_mimes_array',array(\n 'JPG' => array(\n 'image/jpeg',\n 'image/jpg',\n 'image/jp_',\n 'application/jpg',\n 'application/x-jpg',\n 'image/pjpeg',\n 'image/pipeg',\n 'image/vnd.swiftview-jpeg',\n 'image/x-xbitmap'),\n 'GIF' => array(\n 'image/gif',\n 'image/x-xbitmap',\n 'image/gi_'),\n 'PNG' => array(\n 'image/png',\n 'application/png',\n 'application/x-png'),\n 'DOCX'=> 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',\n 'RAR'=> 'application/x-rar',\n 'ZIP' => array(\n 'application/zip',\n 'application/x-zip',\n 'application/x-zip-compressed',\n 'application/x-compress',\n 'application/x-compressed',\n 'multipart/x-zip'),\n 'DOC' => array(\n 'application/msword',\n 'application/doc',\n 'application/text',\n 'application/vnd.msword',\n 'application/vnd.ms-word',\n 'application/winword',\n 'application/word',\n 'application/x-msw6',\n 'application/x-msword'),\n 'PDF' => array(\n 'application/pdf',\n 'application/x-pdf',\n 'application/acrobat',\n 'applications/vnd.pdf',\n 'text/pdf',\n 'text/x-pdf'),\n 'PPT' => array(\n 'application/vnd.ms-powerpoint',\n 'application/mspowerpoint',\n 'application/ms-powerpoint',\n 'application/mspowerpnt',\n 'application/vnd-mspowerpoint',\n 'application/powerpoint',\n 'application/x-powerpoint',\n 'application/x-m'),\n 'PPTX'=> 'application/vnd.openxmlformats-officedocument.presentationml.presentation',\n 'PPS' => 'application/vnd.ms-powerpoint',\n 'PPSX'=> 'application/vnd.openxmlformats-officedocument.presentationml.slideshow',\n 'PSD' => array('application/octet-stream',\n 'image/vnd.adobe.photoshop'\n ),\n 'ODT' => array(\n 'application/vnd.oasis.opendocument.text',\n 'application/x-vnd.oasis.opendocument.text'),\n 'XLS' => array(\n 'application/vnd.ms-excel',\n 'application/msexcel',\n 'application/x-msexcel',\n 'application/x-ms-excel',\n 'application/vnd.ms-excel',\n 'application/x-excel',\n 'application/x-dos_ms_excel',\n 'application/xls'),\n 'XLSX'=> array('application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',\n 'application/vnd.ms-excel'),\n 'MP3' => array(\n 'audio/mpeg',\n 'audio/x-mpeg',\n 'audio/mp3',\n 'audio/x-mp3',\n 'audio/mpeg3',\n 'audio/x-mpeg3',\n 'audio/mpg',\n 'audio/x-mpg',\n 'audio/x-mpegaudio'),\n 'M4A' => array(\n 'audio/mp4a-latm',\n 'audio/m4a',\n 'audio/mp4'),\n 'OGG' => array(\n 'audio/ogg',\n 'application/ogg'),\n 'WAV' => array(\n 'audio/wav',\n 'audio/x-wav',\n 'audio/wave',\n 'audio/x-pn-wav'),\n 'WMA' => 'audio/x-ms-wma',\n 'MP4' => array(\n 'video/mp4v-es',\n 'audio/mp4',\n 'video/mp4'),\n 'M4V' => array(\n 'video/mp4',\n 'video/x-m4v'),\n 'MOV' => array(\n 'video/quicktime',\n 'video/x-quicktime',\n 'image/mov',\n 'audio/aiff',\n 'audio/x-midi',\n 'audio/x-wav',\n 'video/avi'),\n 'WMV' => 'video/x-ms-wmv',\n 'AVI' => array(\n 'video/avi',\n 'video/msvideo',\n 'video/x-msvideo',\n 'image/avi',\n 'video/xmpg2',\n 'application/x-troff-msvideo',\n 'audio/aiff',\n 'audio/avi'),\n 'MPG' => array(\n 'video/avi',\n 'video/mpeg',\n 'video/mpg',\n 'video/x-mpg',\n 'video/mpeg2',\n 'application/x-pn-mpg',\n 'video/x-mpeg',\n 'video/x-mpeg2a',\n 'audio/mpeg',\n 'audio/x-mpeg',\n 'image/mpg'),\n 'OGV' => 'video/ogg',\n '3GP' => array(\n 'audio/3gpp',\n 'video/3gpp'),\n '3G2' => array(\n 'video/3gpp2',\n 'audio/3gpp2'),\n 'FLV' => 'video/x-flv',\n 'WEBM'=> 'video/webm',\n 'APK' => 'application/vnd.android.package-archive',\n ));\n }", "function get_content_type($url){\n\t\t\t\t\t\t$mime_types = array(\n\t\t\t\t\t\t\t\"pdf\"=>\"application/pdf\"\n\t\t\t\t\t\t\t,\"exe\"=>\"application/octet-stream\"\n\t\t\t\t\t\t\t,\"zip\"=>\"application/zip\"\n\t\t\t\t\t\t\t,\"docx\"=>\"application/msword\"\n\t\t\t\t\t\t\t,\"doc\"=>\"application/msword\"\n\t\t\t\t\t\t\t,\"xls\"=>\"application/vnd.ms-excel\"\n\t\t\t\t\t\t\t,\"ppt\"=>\"application/vnd.ms-powerpoint\"\n\t\t\t\t\t\t\t,\"gif\"=>\"image/gif\"\n\t\t\t\t\t\t\t,\"png\"=>\"image/png\"\n\t\t\t\t\t\t ,\"ico\"=>\"image/ico\"\n\t\t\t\t\t\t ,\"jpeg\"=>\"image/jpg\"\n\t\t\t\t\t\t ,\"jpg\"=>\"image/jpg\"\n\t\t\t\t\t\t ,\"mp3\"=>\"audio/mpeg\"\n\t\t\t\t\t\t ,\"wav\"=>\"audio/x-wav\"\n\t\t\t\t\t\t ,\"mpeg\"=>\"video/mpeg\"\n\t\t\t\t\t\t ,\"mpg\"=>\"video/mpeg\"\n\t\t\t\t\t\t ,\"mpe\"=>\"video/mpeg\"\n\t\t\t\t\t\t ,\"mov\"=>\"video/quicktime\"\n\t\t\t\t\t\t ,\"avi\"=>\"video/x-msvideo\"\n\t\t\t\t\t\t ,\"3gp\"=>\"video/3gpp\"\n\t\t\t\t\t\t ,\"css\"=>\"text/css\"\n\t\t\t\t\t\t ,\"jsc\"=>\"application/javascript\"\n\t\t\t\t\t\t ,\"js\"=>\"application/javascript\"\n\t\t\t\t\t\t ,\"php\"=>\"text/html\"\n\t\t\t\t\t\t ,\"htm\"=>\"text/html\"\n\t\t\t\t\t\t ,\"html\"=>\"text/html\"\n\t\t\t\t\t\t ,\"xml\"=>\"application/xml\"\n\t\t\t\t\t\t \n\t\t\t\t\t\t);\n\t\t\t\t\t\t$var = explode('.', $url);\n\t\t\t\t\t\t$extension = strtolower(end($var));\n\t\t\t\t\t\tif(isset($mime_types[$extension])){\n\t\t\t\t\t\t return $mime_types[$extension];\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse{\n\t\t\t\t\t\t\treturn 'other';\n\t\t\t\t\t\t}\n\t\t\t\t\t}", "static function getValidContentTypes() {\n return array(\n 'image/',\n 'text/',\n 'application/pdf',\n );\n }", "function fromExt($ext) \n {\n $mtl = $GLOBALS['File_MimeType'];\n $ext = strtolower($ext);\n foreach($mtl as $mtd) {\n if (in_array($ext, $mtd[1])) {\n return $mtd[0];\n }\n }\n return 'application/octet-stream';\n }", "function fileTypes($extension){\r\n $fileTypes['pdf'] = 'application/pdf';\r\n \r\n $fileTypes['zip'] = 'application/zip';\r\n $fileTypes['doc'] = 'application/msword';\r\n $fileTypes['rar'] = 'application/rar';\r\n\r\n \r\n return $fileTypes[$extention];\r\n }", "private function get_mime_type(string $file_path) {\n //MIME Types\n $mime_types = array(\n 'txt' => 'text/plain',\n 'htm' => 'text/html',\n 'html' => 'text/html',\n 'php' => 'text/html',\n 'css' => 'text/css',\n 'js' => 'application/javascript',\n 'json' => 'application/json',\n 'xml' => 'application/xml',\n 'swf' => 'application/x-shockwave-unic',\n 'flv' => 'video/x-flv',\n\n //Images\n 'png' => 'image/png',\n 'jpe' => 'image/jpeg',\n 'jpeg' => 'image/jpeg',\n 'jpg' => 'image/jpeg',\n 'gif' => 'image/gif',\n 'bmp' => 'image/bmp',\n 'ico' => 'image/vnd.microsoft.icon',\n 'tiff' => 'image/tiff',\n 'tif' => 'image/tiff',\n 'svg' => 'image/svg+xml',\n 'svgz' => 'image/svg+xml',\n\n //Archives\n 'zip' => 'application/zip',\n 'rar' => 'application/x-rar-compressed',\n 'exe' => 'application/x-msdownload',\n 'msi' => 'application/x-msdownload',\n 'cab' => 'application/vnd.ms-cab-compressed',\n\n //Audio/Video\n 'mp3' => 'audio/mpeg',\n 'qt' => 'video/quicktime',\n 'mov' => 'video/quicktime',\n\n //Adobe\n 'pdf' => 'application/pdf',\n 'psd' => 'image/vnd.adobe.photoshop',\n 'ai' => 'application/postscript',\n 'eps' => 'application/postscript',\n 'ps' => 'application/postscript',\n\n //MS Office\n 'doc' => 'application/msword',\n 'rtf' => 'application/rtf',\n 'xls' => 'application/vnd.ms-excel',\n 'ppt' => 'application/vnd.ms-powerpoint',\n 'docx' => 'application/msword',\n 'xlsx' => 'application/vnd.ms-excel',\n 'pptx' => 'application/vnd.ms-powerpoint',\n\n //Open Office\n 'odt' => 'application/vnd.oasis.opendocument.text',\n 'ods' => 'application/vnd.oasis.opendocument.spreadsheet',\n );\n\n $ext_array = explode('.', $file_path);\n $extension = strtolower(end($ext_array));\n if(isset($mime_types[$extension])) {\n return $mime_types[$extension];\n } else {\n return mime_content_type($file_path);\n }\n }", "function extension2fileType( $extension )\n{\n $file_types = '' ; # initialize\n switch ( strtolower( $extension ) )\n {\n case '.jpg':\n case '.jpeg':\n $file_types = 'image/pjpeg,image/jpeg' ;\n break ;\n case '.gif':\n $file_types = 'image/gif' ;\n break ;\n case '.png':\n $file_types = 'image/x-png' ;\n break ;\n case '.doc':\n $file_types = 'application/msword' ;\n break ;\n case '.zip':\n $file_types = 'application/x-zip-compressed' ;\n break ;\n case '.pdf':\n $file_types = 'application/pdf' ;\n break ;\n case '.xls':\n $file_types = 'application/vnd.ms-excel' ;\n break ;\n case '.mp3':\n $file_types = 'audio/mpeg' ;\n break ;\n case '.txt':\n $file_types = 'text/plain' ;\n break ;\n case '.htm':\n case '.html':\n $file_types = 'text/html' ;\n break ;\n case '.wma':\n $file_types = 'audio/x-ms-wma' ;\n break ;\n default:\n $file_types = 'image/pjpeg,image/jpeg' ; # default to .jpg\n }\n return $file_types ; # return matching file type!\n}", "public function content_type() {\n\t\treturn \"application/vnd.ms-excel\";\n\t}", "function my_custom_mime_types( $mimes ) {\n\t$mimes['svg'] = 'image/svg+xml';\n\t$mimes['svgz'] = 'image/svg+xml';\n\t$mimes['doc'] = 'application/msword';\n\t \n\t// Optional. Remove a mime type.\n\tunset( $mimes['exe'] );\n\t \n\treturn $mimes;\n\t}", "function get_file_format($file) {\n if(function_exists('finfo_open')) {\n $file_info = finfo_open(FILEINFO_MIME_TYPE);\n $mime_type = finfo_file($file_info, $file);\n finfo_close($file_info);\n if($mime_type) {\n return $mime_type;\n }\n }\n\n if(function_exists('mime_content_type')) {\n if($mime_type = @mime_content_type($file)) {\n return $mime_type;\n }\n }\n\n if($extension = get_file_extension($file)) {\n switch($extension) {\n case 'js' :\n return 'application/x-javascript';\n case 'json' :\n return 'application/json';\n case 'jpg' :\n case 'jpeg' :\n case 'jpe' :\n return 'image/jpg';\n case 'png' :\n case 'gif' :\n case 'bmp' :\n case 'tiff' :\n return 'image/'.$extension;\n case 'css' :\n return 'text/css';\n case 'xml' :\n return 'application/xml';\n case 'doc' :\n case 'docx' :\n return 'application/msword';\n case 'xls' :\n case 'xlt' :\n case 'xlm' :\n case 'xld' :\n case 'xla' :\n case 'xlc' :\n case 'xlw' :\n case 'xll' :\n return 'application/vnd.ms-excel';\n case 'ppt' :\n case 'pps' :\n return 'application/vnd.ms-powerpoint';\n case 'rtf' :\n return 'application/rtf';\n case 'pdf' :\n return 'application/pdf';\n case 'html' :\n case 'htm' :\n case 'php' :\n return 'text/html';\n case 'txt' :\n return 'text/plain';\n case 'mpeg' :\n case 'mpg' :\n case 'mpe' :\n return 'video/mpeg';\n case 'mp3' :\n return 'audio/mpeg3';\n case 'wav' :\n return 'audio/wav';\n case 'aiff' :\n case 'aif' :\n return 'audio/aiff';\n case 'avi' :\n return 'video/msvideo';\n case 'wmv' :\n return 'video/x-ms-wmv';\n case 'mov' :\n return 'video/quicktime';\n case 'zip' :\n return 'application/zip';\n case 'tar' :\n return 'application/x-tar';\n case 'swf' :\n return 'application/x-shockwave-flash';\n default:\n return 'unknown/'.trim($extension,'.');\n }\n }\n return false;\n}", "function fn_get_ext_mime_types($key = 'ext')\n{\n $types = array (\n 'zip' => 'application/zip',\n 'tgz' => 'application/tgz',\n 'rar' => 'application/rar',\n\n 'exe' => 'application/exe',\n 'com' => 'application/com',\n 'bat' => 'application/bat',\n\n 'png' => 'image/png',\n 'jpeg' => 'image/jpeg',\n 'jpg' => 'image/jpeg',\n 'gif' => 'image/gif',\n 'bmp' => 'image/bmp',\n 'ico' => 'image/x-icon',\n 'swf' => 'application/x-shockwave-flash',\n\n 'csv' => 'text/csv',\n 'txt' => 'text/plain',\n 'xml' => 'application/xml',\n 'doc' => 'application/msword',\n 'xls' => 'application/vnd.ms-excel',\n 'ppt' => 'application/vnd.ms-powerpoint',\n 'pdf' => 'application/pdf',\n\n 'css' => 'text/css',\n 'js' => 'text/javascript'\n );\n\n if ($key == 'mime') {\n $types = array_flip($types);\n }\n\n return $types;\n}", "private function get_mime_type($fn) {\r\n \r\n $mime_types = array(\r\n \r\n 'txt' => 'text/plain',\r\n 'htm' => 'text/html',\r\n 'html' => 'text/html',\r\n 'php' => 'text/html',\r\n 'css' => 'text/css',\r\n 'js' => 'application/javascript',\r\n 'json' => 'application/json',\r\n 'xml' => 'application/xml',\r\n 'swf' => 'application/x-shockwave-flash',\r\n 'flv' => 'video/x-flv',\r\n \r\n // images\r\n 'png' => 'image/png',\r\n 'jpe' => 'image/jpeg',\r\n 'jpeg' => 'image/jpeg',\r\n 'jpg' => 'image/jpeg',\r\n 'gif' => 'image/gif',\r\n 'bmp' => 'image/bmp',\r\n 'ico' => 'image/vnd.microsoft.icon',\r\n 'tiff' => 'image/tiff',\r\n 'tif' => 'image/tiff',\r\n 'svg' => 'image/svg+xml',\r\n 'svgz' => 'image/svg+xml',\r\n \r\n // archives\r\n 'zip' => 'application/zip',\r\n 'rar' => 'application/x-rar-compressed',\r\n 'exe' => 'application/x-msdownload',\r\n 'msi' => 'application/x-msdownload',\r\n 'cab' => 'application/vnd.ms-cab-compressed',\r\n \r\n // audio/video\r\n 'mp3' => 'audio/mpeg',\r\n 'qt' => 'video/quicktime',\r\n 'mov' => 'video/quicktime',\r\n \r\n // adobe\r\n 'pdf' => 'application/pdf',\r\n 'psd' => 'image/vnd.adobe.photoshop',\r\n 'ai' => 'application/postscript',\r\n 'eps' => 'application/postscript',\r\n 'ps' => 'application/postscript',\r\n \r\n // ms office\r\n 'doc' => 'application/msword',\r\n 'rtf' => 'application/rtf',\r\n 'xls' => 'application/vnd.ms-excel',\r\n 'ppt' => 'application/vnd.ms-powerpoint',\r\n \r\n // open office\r\n 'odt' => 'application/vnd.oasis.opendocument.text',\r\n 'ods' => 'application/vnd.oasis.opendocument.spreadsheet',\r\n );\r\n \r\n $ext = strtolower(array_pop(explode('.',$fn)));\r\n if (array_key_exists($ext, $mime_types)) {\r\n return $mime_types[$ext];\r\n }\r\n elseif (function_exists('finfo_open')) {\r\n $finfo = finfo_open(FILEINFO_MIME);\r\n $mimetype = finfo_file($finfo, $fn);\r\n finfo_close($finfo);\r\n return $mimetype;\r\n }\r\n else {\r\n return 'application/octet-stream';\r\n }\r\n }", "function _mime_content_type($filename) {\n $finfo = finfo_open();\n $fileinfo = finfo_file($finfo, $filename, FILEINFO_MIME);\n finfo_close($finfo);\n return reset(explode(\";\",$fileinfo));\n \n \n //hiphop workaround hiphop does not work with inotify\n //exec(\"file \".str_replace(\" \",\"\\ \",$filename).\" --mime\",$output);\n \n $half = explode(\": \",$output[0]);\n $done = explode(\"; \",$half[1]);\n return $done[0];\n }", "protected function _getMimeType()\n\t{\n\t\treturn 'text/text';\n\t}", "public function provider_mime_type() {\n\t\treturn array(\n\t\t\tarray( 'not-found.txt', false ),\n\t\t\tarray( 'empty.txt', version_compare( PHP_VERSION, '7.4', '>=' ) ? 'application/x-empty' : 'inode/x-empty' ),\n\t\t\tarray( 'file.aac', 'audio/aac' ),\n\t\t\tarray( 'file.css', 'text/css' ),\n\t\t\tarray( 'file.csv', 'text/plain' ),\n\t\t\tarray( 'file.flac', 'audio/flac' ),\n\t\t\tarray( 'file.gif', 'image/gif' ),\n\t\t\tarray( 'file.htm', 'text/html' ),\n\t\t\tarray( 'file.html', 'text/html' ),\n\t\t\tarray( 'file.jpe', 'image/jpeg' ),\n\t\t\tarray( 'file.jpeg', 'image/jpeg' ),\n\t\t\tarray( 'file.jpg', 'image/jpeg' ),\n\t\t\tarray( 'file.js', 'application/javascript' ),\n\t\t\tarray( 'file.m4a', 'audio/m4a' ),\n\t\t\tarray( 'file.mp3', 'audio/mpeg' ),\n\t\t\tarray( 'file.png', 'image/png' ),\n\t\t\tarray( 'file.svg', 'image/svg+xml' ),\n\t\t\tarray( 'file.txt', 'text/plain' ),\n\t\t\tarray( 'file.wav', 'audio/wav' ),\n\t\t\tarray( 'file.xml', 'application/xml' ),\n\t\t\tarray( 'no-extension-text', 'text/plain' ),\n\t\t\tarray( 'no-extension-media', 'application/octet-stream' ),\n\t\t\tarray( 'upper-case.JPG', 'image/jpeg' ),\n\t\t);\n\t}", "public function fileExtension(): string\n {\n return match_data($this,\n [\n Format::Xlsx => 'xlsx',\n Format::Pdf => 'pdf',\n Format::Html => 'html',\n Format::Ods => 'ods',\n ]);\n }", "function check_file_type($source)\n{\n $file_info = check_mime_type($source);\n\n switch ($file_info) {\n case 'application/pdf':\n return true;\n break;\n\n case 'application/msword':\n return true;\n break;\n\n case 'application/rtf':\n return true;\n break;\n case 'application/vnd.ms-excel':\n return true;\n break;\n\n case 'application/vnd.ms-powerpoint':\n return true;\n break;\n\n case 'application/vnd.oasis.opendocument.text':\n return true;\n break;\n\n case 'application/vnd.oasis.opendocument.spreadsheet':\n return true;\n break;\n \n case 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet':\n return true;\n break;\n\n case 'application/vnd.openxmlformats-officedocument.wordprocessingml.document':\n return true;\n break;\n \n case 'image/gif':\n return true;\n break;\n\n case 'image/jpeg':\n return true;\n break;\n\n case 'image/png':\n return true;\n break;\n\n case 'image/wbmp':\n return true;\n break;\n\n default:\n return false;\n break;\n }\n}", "public function getDocumentExtension() {\n return $this->document['extension'];\n }", "function wp_check_filetype($filename, $mimes = null) {\n\t$mimes = is_array($mimes) ? $mimes : apply_filters('upload_mimes', array(\n\t\t'jpg|jpeg|jpe' => 'image/jpeg',\n\t\t'gif' => 'image/gif',\n\t\t'png' => 'image/png',\n\t\t'bmp' => 'image/bmp',\n\t\t'tif|tiff' => 'image/tiff',\n\t\t'ico' => 'image/x-icon',\n\t\t'asf|asx|wax|wmv|wmx' => 'video/asf',\n\t\t'avi' => 'video/avi',\n\t\t'mov|qt' => 'video/quicktime',\n\t\t'mpeg|mpg|mpe' => 'video/mpeg',\n\t\t'txt|c|cc|h' => 'text/plain',\n\t\t'rtx' => 'text/richtext',\n\t\t'css' => 'text/css',\n\t\t'htm|html' => 'text/html',\n\t\t'php|php3|' => 'application/php',\n\t\t'mp3|mp4' => 'audio/mpeg',\n\t\t'ra|ram' => 'audio/x-realaudio',\n\t\t'wav' => 'audio/wav',\n\t\t'ogg' => 'audio/ogg',\n\t\t'mid|midi' => 'audio/midi',\n\t\t'wma' => 'audio/wma',\n\t\t'rtf' => 'application/rtf',\n\t\t'js' => 'application/javascript',\n\t\t'pdf' => 'application/pdf',\n\t\t'doc' => 'application/msword',\n\t\t'pot|pps|ppt' => 'application/vnd.ms-powerpoint',\n\t\t'wri' => 'application/vnd.ms-write',\n\t\t'xla|xls|xlt|xlw' => 'application/vnd.ms-excel',\n\t\t'mdb' => 'application/vnd.ms-access',\n\t\t'mpp' => 'application/vnd.ms-project',\n\t\t'swf' => 'application/x-shockwave-flash',\n\t\t'class' => 'application/java',\n\t\t'tar' => 'application/x-tar',\n\t\t'zip' => 'application/zip',\n\t\t'gz|gzip' => 'application/x-gzip',\n\t\t'exe' => 'application/x-msdownload',\n\t\t// openoffice formats\n\t\t'odt' => 'application/vnd.oasis.opendocument.text',\n\t\t'odp' => 'application/vnd.oasis.opendocument.presentation',\n\t\t'ods' => 'application/vnd.oasis.opendocument.spreadsheet',\n\t\t'odg' => 'application/vnd.oasis.opendocument.graphics',\n\t\t'odc' => 'application/vnd.oasis.opendocument.chart',\n\t\t'odb' => 'application/vnd.oasis.opendocument.database',\n\t\t'odf' => 'application/vnd.oasis.opendocument.formula',\n\n\t));\n\n\t$type = false;\n\t$ext = false;\n\n\tforeach ($mimes as $ext_preg => $mime_match) {\n\t\t$ext_preg = '!\\.(' . $ext_preg . ')$!i';\n\t\tif (preg_match($ext_preg, $filename, $ext_matches)) {\n\t\t\t$type = $mime_match;\n\t\t\t$ext = $ext_matches[1];\n\t\t\tbreak;\n\t\t}\n\t}\n\n\treturn compact('ext', 'type');\n}", "public static function _mime_types($ext = '')\n {\n }", "function availableFileTypes($ext) {\n //checking file type extension\n switch ($ext) {\n //checking txt extention\n case \"txt\":\n $type[0] = \"text/plain\";\n break;\n\n //checking xml extention\n case \"xml\":\n $type[0] = \"text/xml\";\n $type[1] = \"application/xml\";\n break;\n\n //checking csv extention\n case \"csv\":\n $type[0] = \"text/x-comma-separated-values\";\n $type[1] = \"application/octet-stream\";\n $type[2] = \"text/plain\";\n break;\n\n //checking zip extention\n case \"zip\":\n $type[0] = \"application/zip\";\n break;\n\n //checking tar extention\n case \"tar\":\n $type[0] = \"application/x-gzip\";\n break;\n\n //checking ctar extention\n case \"ctar\":\n $type[0] = \"application/x-compressed-tar\";\n break;\n\n //checking pdf extention\n case \"pdf\":\n $type[0] = \"application/pdf\";\n break;\n\n //checking doc extention\n case \"doc\":\n $type[0] = \"application/msword\";\n $type[1] = \"application/octet-stream\";\n break;\n\n //checking xls extention\n case \"xls\":\n $type[0] = \"application/vnd.ms-excel\";\n $type[1] = \"application/vnd.oasis.opendocument.spreadsheet\";\n break;\n\n //checking ppt extention\n case \"ppt\":\n $type[0] = \"application/vnd.ms-powerpoint\";\n break;\n\n //checking jpg extention\n case \"jpg\":\n $type[0] = \"image/jpg\";\n $type[1] = \"image/jpeg\";\n $type[2] = \"image/pjpeg\";\n break;\n\n //checking gif extention\n case \"gif\":\n $type[0] = \"image/gif\";\n break;\n\n //checking png extention\n case \"png\":\n $type[0] = \"image/png\";\n break;\n\n //checking bmp extention\n case \"bmp\":\n $type[0] = \"image/bmp\";\n break;\n\n //checking icon extention\n case \"icon\":\n $type[0] = \"image/x-ico\";\n break;\n\n //checking tfontt extention\n case \"font\":\n $type[0] = \"application/x-font-ttf\";\n break;\n }\n\n return $type;\n }", "function getMIMEType( $sFileName = \"\" ) { \r\n $sFileName = strtolower( trim( $sFileName ) ); \r\n if( ! strlen( $sFileName ) ) return \"\"; \r\n \r\n $aMimeType = array( \r\n \"txt\" => \"text/plain\" , \r\n \"pdf\" => \"application/pdf\" , \r\n \"zip\" => \"application/x-compressed\" , \r\n \r\n \"html\" => \"text/html\" , \r\n \"htm\" => \"text/html\" , \r\n \r\n \"avi\" => \"video/avi\" , \r\n \"mpg\" => \"video/mpeg \" , \r\n \"wav\" => \"audio/wav\" , \r\n \r\n \"jpg\" => \"image/jpeg \" , \r\n \"gif\" => \"image/gif\" , \r\n \"tif\" => \"image/tiff \" , \r\n \"png\" => \"image/x-png\" , \r\n \"bmp\" => \"image/bmp\" \r\n ); \r\n $aFile = split( \"\\.\", basename( $sFileName ) ) ; \r\n $nDiminson = count( $aFile ) ; \r\n $sExt = $aFile[ $nDiminson - 1 ] ; // get last part: like \".tar.zip\", return \"zip\" \r\n \r\n return ( $nDiminson > 1 ) ? $aMimeType[ $sExt ] : \"\"; \r\n}", "private function getGoogleDocExtension($mimetype) {\n\t\tif ($mimetype === self::DOCUMENT) {\n\t\t\treturn 'odt';\n\t\t} elseif ($mimetype === self::SPREADSHEET) {\n\t\t\treturn 'ods';\n\t\t} elseif ($mimetype === self::DRAWING) {\n\t\t\treturn 'jpg';\n\t\t} elseif ($mimetype === self::PRESENTATION) {\n\t\t\t// Download as .odp is not available\n\t\t\treturn 'pdf';\n\t\t} else {\n\t\t\treturn '';\n\t\t}\n\t}", "function read_file_docx($filename){\t\n\t\t$striped_content = '';\n\t\t$content = '';\n\t\tif(!$filename || !file_exists($filename)){ return false;}\n\t\t$zip = zip_open($filename);\n\t\tif (!$zip || is_numeric($zip)) return false;\n\t\twhile ($zip_entry = zip_read($zip)) {\n\t\t\tif (zip_entry_open($zip, $zip_entry) == FALSE) continue;\n\t\t\tif (zip_entry_name($zip_entry) != \"word/document.xml\") continue;\n\t\t\t$content .= zip_entry_read($zip_entry, zip_entry_filesize($zip_entry));\n\t\t\tzip_entry_close($zip_entry);\n\t\t}// end while\n\t\t\n\t\tzip_close($zip);\n\t\t$content = str_replace('</w:r></w:p></w:tc><w:tc>', \" \", $content);\n\t\t$content = str_replace('</w:r></w:p>', \"\\r\\n\", $content);\n\t\t$content = str_replace('</w:p>', \"\\r\\n\\n\", $content);\t\t\n\t\t$content = str_replace(array('.com', '.in'), array(\".com \\r\\n\", \".in \\r\\n\"), $content);\n\t\t$content = str_replace(array(':'), \": \", $content);\n\t\t$striped_content = strip_tags($content);\n\t\treturn $striped_content;\n\t}", "function check_upload($file) {\n if (preg_match(\":^application/vnd.bdoc-:\", $file[\"type\"])) {\n $file[\"format\"] = \"bdoc\";\n } else if ($file[\"type\"] === \"application/x-ddoc\") {\n $file[\"format\"] = \"ddoc\";\n } else {\n return FALSE;\n }\n\n return is_uploaded_file($file[\"tmp_name\"]);\n}", "function check_mime_type($source)\n{\n $mime_types = array(\n // images\n 'png' => 'image/png',\n 'jpe' => 'image/jpeg',\n 'jpeg' => 'image/jpeg',\n 'jpg' => 'image/jpeg',\n 'gif' => 'image/gif',\n 'bmp' => 'image/bmp',\n 'ico' => 'image/vnd.microsoft.icon',\n 'tiff' => 'image/tiff',\n 'tif' => 'image/tiff',\n 'svg' => 'image/svg+xml',\n 'svgz' => 'image/svg+xml',\n // adobe\n 'pdf' => 'application/pdf',\n // ms office\n 'doc' => 'application/msword',\n 'docx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',\n 'rtf' => 'application/rtf',\n 'xls' => 'application/vnd.ms-excel',\n 'xlsx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',\n 'ppt' => 'application/vnd.ms-powerpoint',\n // open office\n 'odt' => 'application/vnd.oasis.opendocument.text',\n 'ods' => 'application/vnd.oasis.opendocument.spreadsheet',\n );\n $arrext = explode('.', $source['name']);\n $jml = count($arrext) - 1;\n $ext = $arrext[$jml];\n $ext = strtolower($ext);\n //$ext = strtolower(array_pop(explode(\".\", $source['name'])));\n if (array_key_exists($ext, $mime_types)) {\n return $mime_types[$ext];\n } elseif (function_exists('finfo_open')) {\n $finfo = finfo_open(FILEINFO_MIME);\n $mimetype = finfo_file($finfo, $source['tmp_name']);\n finfo_close($finfo);\n return $mimetype;\n } else {\n return false;\n }\n}", "public function getExtendedType()\n {\n return 'file';\n }", "function enable_extended_upload ( $mime_types =array() ) {\n // You can add as many MIME types as you want.\n $mime_types['exe'] = 'application/exe'; \n\n return $mime_types;\n}", "public function getRfc2822ContentType(): string;", "public function getSupportedFileExtensions() {}", "function getMimeType() ;", "function getMimeMode($ext,$viewMode=false) {\n\t\t// if viewMode, will use inline for formats that most browsers can handle\n\t\t$knownExts = array(\n\t\t'gif' => false,\n\t\t'jpg' => false,\n\t\t'jpeg' => false,\n\t\t'png' => false,\n\t\t'psd' => true,\n\t\t'zip' => true,\n\t\t'rar' => true,\n\t\t'7z' => true,\n\t\t'doc' => true,\n\t\t'docx' => true,\n\t\t'odt' => true,\n\t\t'rtf' => true,\n\t\t'swf' => false,\n\t\t'tif' => !$viewMode,\n\t\t'au' => !$viewMode,\n\t\t'pdf' => !$viewMode,\n\t\t'mp3' => !$viewMode,\n\t\t'ogg' => !$viewMode,\n\t\t'ico' => false,\n\t\t'mpg' => !$viewMode,\n\t\t'mpeg' => !$viewMode,\n\t\t'qt' => !$viewMode,\n\t\t'mov' => !$viewMode,\n\t\t'mp4' => !$viewMode,\n\t\t'avi' => !$viewMode,\n\t\t'mkv' => !$viewMode, // do browsers really support this?\n\t\t'txt' => false,\n\t\t'html' => false,\n\t\t'htm' => false,\n\t\t'xml' => true,\n\t\t'xls' => true,\n\t\t'wmv' => !$viewMode,\n\t\t'pps' => true,\n\t\t'ppt' => true,\n\t\t'exe' => true,\n\t\t'msi' => true,\n\t\t'bat' => true,\n\t\t'ps' => true,\n\t\t'qif' => !$viewMode,\n\t\t'ai' => true,\n\t\t'wma' => !$viewMode,\n\t\t'css' => false,\n\t\t'js' => false,\n\t\t'rss' => false,\n\t\t'json' => false\n\t\t);\n\t\treturn isset($knownExts[$ext])?$knownExts[$ext]:true;\n\t}", "public function contentType(string $path): bool|string\n {\n return match ($this->extension($path)) {\n \"aac\" => \"audio/aac\",\n \"avi\" => \"video/x-msvideo\",\n \"bin\" => \"application/octet-stream\",\n \"bmp\" => \"image/bmp\",\n \"css\" => \"text/css\",\n \"csv\" => \"text/csv\",\n \"doc\" => \"application/msword\",\n \"docx\" => \"application/vnd.openxmlformats-officedocument.wordprocessingml.document\",\n \"gif\" => \"image/gif\",\n \"htm\", \"html\" => \"text/html\",\n \"ico\" => \"image/vnd.microsoft.icon\",\n \"ics\" => \"text/calendar\",\n \"jpeg\", \"jpg\" => \"image/jpeg\",\n \"js\", \"mjs\" => \"text/javascript\",\n \"mp3\" => \"audio/mpeg\",\n \"mp4\" => \"video/mp4\",\n \"mpeg\" => \"video/mpeg\",\n \"otf\" => \"font/otf\",\n \"png\" => \"image/png\",\n \"pdf\" => \"application/pdf\",\n \"php\" => \"application/x-httpd-php\",\n \"ppt\" => \"application/vnd.ms-powerpoint\",\n \"pptx\" => \"application/vnd.openxmlformats-officedocument.presentationml.presentation\",\n \"svg\" => \"image/svg+xml\",\n \"tif\", \"tiff\" => \"image/tiff\",\n \"ttf\" => \"font/ttf\",\n \"txt\" => \"text/plain\",\n \"weba\" => \"audio/webm\",\n \"webm\" => \"video/webm\",\n \"webp\" => \"image/webp\",\n \"woff\" => \"font/woff\",\n \"woff2\" => \"audio/wav\",\n \"xls\" => \"application/vnd.ms-excel2\",\n \"xlsx\" => \"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet\",\n \"xml\" => \"application/xml\",\n \"zip\" => \"application/zip\",\n default => $this->mimeType($path)\n };\n }", "public function getSupportedFileTypes(){\n\t\t$_url = $this->constants['SERVICE_ENTRY_POINT'].$this->constants['SERVICE_VERSION'].'/'.$this->constants['MISC_PATH'].'/supported-file-types';\n\t\t$response = $this->getRequests($_url)['response'];\n\t\treturn $response;\n\t}", "public function getMimeType() {}", "public function getMimeType() {}", "public function getMimeType() {}", "public function getMimeType() {}", "function fn_get_mime_content_type($filename, $check_by_extension = true, $not_available_result = 'application/octet-stream')\n{\n $type = '';\n\n if (class_exists('finfo')) {\n $finfo_handler = @finfo_open(FILEINFO_MIME);\n if ($finfo_handler !== false) {\n $type = @finfo_file($finfo_handler, $filename);\n list($type) = explode(';', $type);\n @finfo_close($finfo_handler);\n }\n }\n\n if (empty($type) && function_exists('mime_content_type')) {\n $type = @mime_content_type($filename);\n }\n\n if (empty($type) && $check_by_extension && strpos(fn_basename($filename), '.') !== false) {\n $type = fn_get_file_type(fn_basename($filename), $not_available_result);\n }\n\n return !empty($type) ? $type : $not_available_result;\n}", "public static function getAllowedExtension()\n\t{\n\t\treturn ['xml' => 'XML'];\n\t}", "public function getExtensionAllowed()\n {\n return array_merge($this->imageTypes, $this->videoTypes, $this->documentTypes);\n }", "public function testSupportedMIMETypes()\n {\n $this->assertContains('application/x-pdf', self::$client->getSupportedMIMETypes());\n }", "public function getMimeContentType($file, $fileName = null)\n {\n\n if ($fileName == null) {\n $fileName = $file;\n }\n\n $mimeTypes = array(\n 'txt' => 'text/plain',\n 'htm' => 'text/html',\n 'html' => 'text/html',\n 'php' => 'text/html',\n 'css' => 'text/css',\n 'js' => 'application/javascript',\n 'json' => 'application/json',\n 'xml' => 'application/xml',\n 'swf' => 'application/x-shockwave-flash',\n 'flv' => 'video/x-flv',\n\n // images\n 'png' => 'image/png',\n 'jpe' => 'image/jpeg',\n 'jpeg' => 'image/jpeg',\n 'jpg' => 'image/jpeg',\n 'gif' => 'image/gif',\n 'bmp' => 'image/bmp',\n 'ico' => 'image/vnd.microsoft.icon',\n 'tiff' => 'image/tiff',\n 'tif' => 'image/tiff',\n 'svg' => 'image/svg+xml',\n 'svgz' => 'image/svg+xml',\n\n // archives\n 'zip' => 'application/zip',\n 'rar' => 'application/x-rar-compressed',\n 'exe' => 'application/x-msdownload',\n 'msi' => 'application/x-msdownload',\n 'cab' => 'application/vnd.ms-cab-compressed',\n\n // audio/video\n 'mp3' => 'audio/mpeg',\n 'qt' => 'video/quicktime',\n 'mov' => 'video/quicktime',\n 'avi' => \"video/x-msvideo\",\n\n // adobe\n 'pdf' => 'application/pdf',\n 'psd' => 'image/vnd.adobe.photoshop',\n 'ai' => 'application/postscript',\n 'eps' => 'application/postscript',\n 'ps' => 'application/postscript',\n\n // ms office\n 'doc' => 'application/msword',\n 'rtf' => 'application/rtf',\n 'xls' => 'application/vnd.ms-excel',\n 'ppt' => 'application/vnd.ms-powerpoint',\n 'xlsx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',\n 'xltx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.template',\n 'potx' => 'application/vnd.openxmlformats-officedocument.presentationml.template',\n 'ppsx' => 'application/vnd.openxmlformats-officedocument.presentationml.slideshow',\n 'pptx' => 'application/vnd.openxmlformats-officedocument.presentationml.presentation',\n 'sldx' => 'application/vnd.openxmlformats-officedocument.presentationml.slide',\n 'docx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',\n 'dotx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.template',\n 'xlam' => 'application/vnd.ms-excel.addin.macroEnabled.12',\n 'xlsb' => 'application/vnd.ms-excel.sheet.binary.macroEnabled.12',\n\n // open office\n 'odt' => 'application/vnd.oasis.opendocument.text',\n 'ods' => 'application/vnd.oasis.opendocument.spreadsheet',\n\n // application store\n // over the air blackberry\n 'jad' => 'text/vnd.sun.j2me.app-descriptor',\n // over the air blackberry\n 'cod' => 'application/vnd.rim.cod',\n // over the air Android\n 'apk' => 'application/vnd.android.package-archive',\n // blackberry over the air\n 'jar' => 'application/java-archive'\n );\n\n $ext = strtolower(pathinfo(\"$fileName\", PATHINFO_EXTENSION));\n if (array_key_exists($ext, $mimeTypes)) {\n return $mimeTypes[$ext];\n } elseif (function_exists('finfo_open')) {\n $finfo = finfo_open(FILEINFO_MIME_TYPE);\n $mimetype = finfo_file($finfo, $file);\n finfo_close($finfo);\n return $mimetype;\n }\n return 'application/octet-stream';\n }", "public function get_allowed_content_object_types()\n {\n return array(File::class);\n }", "function wp_get_default_extension_for_mime_type($mime_type)\n {\n }", "function system_mime_map()\n{\n return [\n 'video/3gpp2' => '3g2',\n 'video/3gp' => '3gp',\n 'video/3gpp' => '3gp',\n 'application/x-compressed' => '7zip',\n 'audio/x-acc' => 'aac',\n 'audio/ac3' => 'ac3',\n 'application/postscript' => 'ai',\n 'audio/x-aiff' => 'aif',\n 'audio/aiff' => 'aif',\n 'audio/x-au' => 'au',\n 'video/x-msvideo' => 'avi',\n 'video/msvideo' => 'avi',\n 'video/avi' => 'avi',\n 'application/x-troff-msvideo' => 'avi',\n 'application/macbinary' => 'bin',\n 'application/mac-binary' => 'bin',\n 'application/x-binary' => 'bin',\n 'application/x-macbinary' => 'bin',\n 'image/bmp' => 'bmp',\n 'image/x-bmp' => 'bmp',\n 'image/x-bitmap' => 'bmp',\n 'image/x-xbitmap' => 'bmp',\n 'image/x-win-bitmap' => 'bmp',\n 'image/x-windows-bmp' => 'bmp',\n 'image/ms-bmp' => 'bmp',\n 'image/x-ms-bmp' => 'bmp',\n 'application/bmp' => 'bmp',\n 'application/x-bmp' => 'bmp',\n 'application/x-win-bitmap' => 'bmp',\n 'application/cdr' => 'cdr',\n 'application/coreldraw' => 'cdr',\n 'application/x-cdr' => 'cdr',\n 'application/x-coreldraw' => 'cdr',\n 'image/cdr' => 'cdr',\n 'image/x-cdr' => 'cdr',\n 'zz-application/zz-winassoc-cdr' => 'cdr',\n 'application/mac-compactpro' => 'cpt',\n 'application/pkix-crl' => 'crl',\n 'application/pkcs-crl' => 'crl',\n 'application/x-x509-ca-cert' => 'crt',\n 'application/pkix-cert' => 'crt',\n 'text/css' => 'css',\n 'text/x-comma-separated-values' => 'csv',\n 'text/comma-separated-values' => 'csv',\n 'application/vnd.msexcel' => 'csv',\n 'application/x-director' => 'dcr',\n 'application/vnd.openxmlformats-officedocument.wordprocessingml.document' => 'docx',\n 'application/x-dvi' => 'dvi',\n 'message/rfc822' => 'eml',\n 'application/x-msdownload' => 'exe',\n 'video/x-f4v' => 'f4v',\n 'audio/x-flac' => 'flac',\n 'video/x-flv' => 'flv',\n 'image/gif' => 'gif',\n 'application/gpg-keys' => 'gpg',\n 'application/x-gtar' => 'gtar',\n 'application/x-gzip' => 'gzip',\n 'application/mac-binhex40' => 'hqx',\n 'application/mac-binhex' => 'hqx',\n 'application/x-binhex40' => 'hqx',\n 'application/x-mac-binhex40' => 'hqx',\n 'text/html' => 'html',\n 'image/x-icon' => 'ico',\n 'image/x-ico' => 'ico',\n 'image/vnd.microsoft.icon' => 'ico',\n 'text/calendar' => 'ics',\n 'application/java-archive' => 'jar',\n 'application/x-java-application' => 'jar',\n 'application/x-jar' => 'jar',\n 'image/jp2' => 'jp2',\n 'video/mj2' => 'jp2',\n 'image/jpx' => 'jp2',\n 'image/jpm' => 'jp2',\n 'image/jpeg' => 'jpg',\n // 'image/jpeg' => 'jpeg',\n 'image/pjpeg' => 'jpeg',\n 'application/x-javascript' => 'js',\n 'application/json' => 'json',\n 'text/json' => 'json',\n 'application/vnd.google-earth.kml+xml' => 'kml',\n 'application/vnd.google-earth.kmz' => 'kmz',\n 'text/x-log' => 'log',\n 'audio/x-m4a' => 'm4a',\n 'application/vnd.mpegurl' => 'm4u',\n 'audio/midi' => 'mid',\n 'application/vnd.mif' => 'mif',\n 'video/quicktime' => 'mov',\n 'video/x-sgi-movie' => 'movie',\n 'audio/mpeg' => 'mp3',\n 'audio/mpg' => 'mp3',\n 'audio/mpeg3' => 'mp3',\n 'audio/mp3' => 'mp3',\n 'video/mp4' => 'mp4',\n 'video/mpeg' => 'mpeg',\n 'application/oda' => 'oda',\n 'audio/ogg' => 'ogg',\n 'video/ogg' => 'ogg',\n 'application/ogg' => 'ogg',\n 'application/x-pkcs10' => 'p10',\n 'application/pkcs10' => 'p10',\n 'application/x-pkcs12' => 'p12',\n 'application/x-pkcs7-signature' => 'p7a',\n 'application/pkcs7-mime' => 'p7c',\n 'application/x-pkcs7-mime' => 'p7c',\n 'application/x-pkcs7-certreqresp' => 'p7r',\n 'application/pkcs7-signature' => 'p7s',\n 'application/pdf' => 'pdf',\n 'application/octet-stream' => 'pdf',\n 'application/x-x509-user-cert' => 'pem',\n 'application/x-pem-file' => 'pem',\n 'application/pgp' => 'pgp',\n 'application/x-httpd-php' => 'php',\n 'application/php' => 'php',\n 'application/x-php' => 'php',\n 'text/php' => 'php',\n 'text/x-php' => 'php',\n 'application/x-httpd-php-source' => 'php',\n 'image/png' => 'png',\n 'image/x-png' => 'png',\n 'application/powerpoint' => 'ppt',\n 'application/vnd.ms-powerpoint' => 'ppt',\n 'application/vnd.ms-office' => 'ppt',\n 'application/msword' => 'doc',\n 'application/vnd.openxmlformats-officedocument.presentationml.presentation' => 'pptx',\n 'application/x-photoshop' => 'psd',\n 'image/vnd.adobe.photoshop' => 'psd',\n 'audio/x-realaudio' => 'ra',\n 'audio/x-pn-realaudio' => 'ram',\n 'application/rar' => 'rar',\n 'application/x-rar' => 'rar',\n 'application/x-rar-compressed' => 'rar',\n 'audio/x-pn-realaudio-plugin' => 'rpm',\n 'application/x-pkcs7' => 'rsa',\n 'text/rtf' => 'rtf',\n 'text/richtext' => 'rtx',\n 'video/vnd.rn-realvideo' => 'rv',\n 'application/x-stuffit' => 'sit',\n 'application/smil' => 'smil',\n 'text/srt' => 'srt',\n 'image/svg+xml' => 'svg',\n 'application/x-shockwave-flash' => 'swf',\n 'application/x-tar' => 'tar',\n 'application/x-gzip-compressed' => 'tgz',\n 'image/tiff' => 'tiff',\n 'text/plain' => 'txt',\n 'text/x-vcard' => 'vcf',\n 'application/videolan' => 'vlc',\n 'text/vtt' => 'vtt',\n 'audio/wav' => 'wav',\n 'audio/x-wav' => 'wav',\n 'audio/wave' => 'wav',\n 'application/wbxml' => 'wbxml',\n 'video/webm' => 'webm',\n 'audio/x-ms-wma' => 'wma',\n 'application/wmlc' => 'wmlc',\n 'video/x-ms-wmv' => 'wmv',\n 'video/x-ms-asf' => 'wmv',\n 'application/xhtml+xml' => 'xhtml',\n 'application/excel' => 'xl',\n 'application/msexcel' => 'xls',\n 'application/x-msexcel' => 'xls',\n 'application/x-ms-excel' => 'xls',\n 'application/x-excel' => 'xls',\n 'application/x-dos_ms_excel' => 'xls',\n 'application/xls' => 'xls',\n 'application/x-xls' => 'xls',\n 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' => 'xlsx',\n 'application/vnd.ms-excel' => 'xlsx',\n 'application/xml' => 'xml',\n 'text/xml' => 'xml',\n 'text/xsl' => 'xsl',\n 'application/xspf+xml' => 'xspf',\n 'application/x-compress' => 'z',\n 'application/zip' => 'zip',\n 'application/x-zip' => 'zip',\n 'application/x-zip-compressed' => 'zip',\n 'application/s-compressed' => 'zip',\n 'multipart/x-zip' => 'zip',\n 'text/x-scriptzsh' => 'zsh',\n ];\n}", "public function getMimeTypes()\n {\n return explode(';', $this->response->getHeader('Content-Type')[0]);\n }", "public function getMimeType()\r\n {\r\n if (array_key_exists($this->getExtension(), $this->fileTypes)) {\r\n return $this->fileTypes[$this->getExtension()]['type'];\r\n }\r\n\r\n return 'application/octet-stream';\r\n }", "public function pi_set_content_type(){\n \treturn \"text/html\";\n\t}", "function getMimeForSubtype($subType,$ext='') {\n\t\tif ($ext == 'jpeg' || $ext == 'pjpeg' || $ext == 'jpg') {\n\t\t\t$ext = 'jpeg';\n\t\t}\n\n\t\tswitch($subType) {\n\t\t\tcase 'text':\n\t\t\t\treturn 'text/plain';\n\t\t\tcase 'wiki':\n\t\t\t\treturn 'text/wiki';\n\t\t\tcase 'html':\n\t\t\t\treturn 'text/html';\n\t\t\tcase 'image':\n\t\t\t\treturn 'image/'.$ext;\n\t\t}\n\n\t\tif ($subtype == 'document' || $subtype == 'doc') {\n\t\t\tswitch($ext) {\n\t\t\t\tcase 'pdf':\n\t\t\t\treturn 'application/pdf';\n\t\t\t\tbreak;\n\n\t\t\t\tcase 'sxw':\n\t\t\t\treturn 'application/vnd.sun.xml.writer';\n\t\t\t\tbreak;\n\n\t\t\t\tcase 'sxc':\n\t\t\t\treturn 'application/vnd.sun.xml.calc';\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tif ($subtype == 'audio') {\n\t\t\tswitch($ext) {\n\t\t\t\tcase 'mp3':\n\t\t\t\treturn 'audio/mpeg';\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\treturn \"application/octet-stream\";\n\t}", "function get_mime_type($file, $real_filename = null, $use_native_functions = true) {\n if (function_exists('mime_content_type') && $use_native_functions) {\n $mime_type = trim(mime_content_type($file));\n if (!$mime_type) {\n return 'application/octet-stream';\n } // if\n $mime_type = explode(';', $mime_type);\n return $mime_type[0];\n } else if (function_exists('finfo_open') && function_exists('finfo_file') && $use_native_functions) {\n $finfo = finfo_open(FILEINFO_MIME_TYPE);\n $mime_type = finfo_file($finfo, $file);\n finfo_close($finfo);\n return $mime_type;\n } else {\n if ($real_filename) {\n $file = $real_filename;\n } // if\n \n $mime_types = array(\n 'txt' => 'text/plain',\n 'htm' => 'text/html',\n 'html' => 'text/html',\n 'php' => 'text/html',\n 'css' => 'text/css',\n 'js' => 'application/javascript',\n 'json' => 'application/json',\n 'xml' => 'application/xml',\n 'swf' => 'application/x-shockwave-flash',\n 'flv' => 'video/x-flv',\n 'png' => 'image/png',\n 'jpe' => 'image/jpeg',\n 'jpeg' => 'image/jpeg',\n 'jpg' => 'image/jpeg',\n 'gif' => 'image/gif',\n 'bmp' => 'image/bmp',\n 'ico' => 'image/vnd.microsoft.icon',\n 'tiff' => 'image/tiff',\n 'tif' => 'image/tiff',\n 'svg' => 'image/svg+xml',\n 'svgz' => 'image/svg+xml',\n 'zip' => 'application/zip',\n 'rar' => 'application/x-rar-compressed',\n 'exe' => 'application/x-msdownload',\n 'msi' => 'application/x-msdownload',\n 'cab' => 'application/vnd.ms-cab-compressed',\n 'mp3' => 'audio/mpeg',\n 'qt' => 'video/quicktime',\n 'mov' => 'video/quicktime',\n 'pdf' => 'application/pdf',\n 'psd' => 'image/vnd.adobe.photoshop',\n 'ai' => 'application/postscript',\n 'eps' => 'application/postscript',\n 'ps' => 'application/postscript',\n 'doc' => 'application/msword',\n 'rtf' => 'application/rtf',\n 'xls' => 'application/vnd.ms-excel',\n 'ppt' => 'application/vnd.ms-powerpoint',\n 'odt' => 'application/vnd.oasis.opendocument.text',\n 'ods' => 'application/vnd.oasis.opendocument.spreadsheet',\n );\n \n $extension = strtolower(get_file_extension($file));\n if (array_key_exists($extension, $mime_types)) {\n return $mime_types[$extension];\n } else {\n return 'application/octet-stream';\n } // if\n } // if\n }", "function prettyType($mimeType, $ext) {\n\t$mimeType = strtolower($mimeType);\n\n\t// Order by most unique first.\n\t// Do NOT do html because \"text/html\" is often misused for other types. We catch it below.\n\tforeach(array(\"font\", \"css\", \"image\", \"script\", \"video\", \"audio\", \"xml\") as $type) {\n\t\tif ( false !== strpos($mimeType, $type) ) {\n\t\t\treturn $type;\n\t\t}\n\t}\n\n\t// Special cases I found by manually searching.\n\tif ( false !== strpos($mimeType, \"json\") || \"js\" === $ext || \"json\" === $ext ) {\n\t\treturn \"script\";\n\t}\n\telse if ( \"eot\" === $ext || \"ttf\" === $ext || \"woff\" === $ext || \"woff2\" === $ext || \"otf\" === $ext ) {\n\t\treturn \"font\";\n\t}\n\telse if ( \"png\" === $ext || \"gif\" === $ext || \"jpg\" === $ext || \"jpeg\" === $ext || \"webp\" === $ext || \"ico\" === $ext || \"svg\" === $ext || \"avif\" === $ext || \"jxl\" === $ext || \"heic\" === $ext || \"heif\" === $ext ) {\n\t\treturn \"image\";\n\t}\n\telse if ( \"css\" === $ext ) {\n\t\treturn \"css\";\n\t}\n\telse if ( \"xml\" === $ext ) {\n\t\treturn \"xml\";\n\t}\n //Video extensions mp4, webm, ts, m4v, m4s, m4v, mov, ogv\n\telse if ( false !== strpos($mimeType, \"flash\") || false !== strpos($mimeType, \"webm\") || false !== strpos($mimeType, \"mp4\") || false !== strpos($mimeType, \"flv\")\n || \"mp4\" === $ext || \"webm\" === $ext || \"ts\" == $ext || \"m4v\" === $ext || \"m4s\" === $ext || \"mov\" === $ext || \"ogv\" === $ext\n || \"swf\" === $ext || \"f4v\" === $ext || \"flv\" === $ext ) {\n\t\treturn \"video\";\n\t}\n\telse if ( false !== strpos($mimeType, \"html\") || \"html\" === $ext || \"htm\" === $ext ) {\n\t\t// Here is where we catch \"text/html\" mime type.\n\t\treturn \"html\";\n\t}\n\telse if ( false !== strpos($mimeType, \"text\") ) {\n\t\t// Put \"text\" LAST because it's often misused so $ext should take precedence.\n\t\treturn \"text\";\n\t}\n\n\treturn \"other\";\n}", "public function mimeTypeValid()\n\t{\n\t\tif (!in_array($this->files['type'], $this->mime_types)) {\n\t\t\tthrow new Exception(\"Invalid file Extension\",6);\n\t\t}\n\t}", "public function getMimeType();", "public function getMimeType();", "public function getMimeType();", "public function getMimeType();", "public function getMimeType();", "abstract public function getMimeType();", "public static function getContentType() {}", "function send_file_to_browser($download_name, $file_name) {\r\n\r\n // must be fresh start\r\n if(headers_sent())\r\n die('Headers Sent'); \r\n\t\r\n // file must exist\r\n if (!file_exists($file_name)) {\r\n die('file does not exist!');\r\n }\r\n\r\n $path_info = pathinfo($file_name);\r\n\r\n // check that extension key exists in array\r\n if (!array_key_exists('extension', $path_info)) {\r\n $path_info['extension'] = '';\r\n }\r\n \r\n // http://en.wikipedia.org/wiki/Mime_type#List_of_common_media_types\r\n switch (strtolower($path_info['extension'])) {\r\n\tcase 'exe':\r\n $mime_type = \"application/octet-stream\";\r\n break;\r\n case 'doc':\r\n\t $mime_type = \"application/msword\";\r\n break;\r\n case 'docx':\r\n $mime_type = \"application/msword\";\r\n break;\r\n case 'gif':\r\n $mime_type = \"image/gif\";\r\n break;\r\n case 'jpg':\r\n $mime_type = \"image/jpg\";\r\n break;\r\n case 'jpeg':\r\n $mime_type = \"image/jpeg\";\r\n break;\r\n case 'png':\r\n $mime_type = \"image/png\";\r\n break;\r\n case 'tiff':\r\n $mime_type = \"image/tiff\";\r\n break;\r\n case 'txt':\r\n $mime_type = \"text/plain\";\r\n break;\r\n case 'csv':\r\n $mime_type = \"text/csv\";\r\n break;\r\n case 'zip':\r\n $mime_type = \"application/zip\";\r\n break;\r\n case 'pdf':\r\n $mime_type = \"application/pdf\";\r\n break;\r\n case 'xls': \r\n\t $mime_type = \"application/vnd.ms-excel\";\r\n break;\r\n case 'ppt': \r\n\t $mime_type = \"application/vnd.ms-powerpoint\";\r\n break;\r\n case 'wav': \r\n\t $mime_type = \"audio/vnd.wave\";\r\n break;\r\n case 'mp3': \r\n\t $mime_type = \"audio/mpeg\";\r\n break;\t\t\t\t\t\r\n case 'mpeg': \r\n\t $mime_type = \"video/mpeg\";\r\n break; \r\n case 'mp4': \r\n\t $mime_type = \"video/mp4\";\r\n break; \r\n case 'ogg': \r\n\t $mime_type = \"video/ogg\";\r\n break; \r\n case 'mov': \r\n\t $mime_type = \"video/quicktime\";\r\n break; \r\n case 'webm': \r\n\t $mime_type = \"video/webm\";\r\n break; \r\n case 'mkv': \r\n\t $mime_type = \"video/x-matroska\";\r\n break; \r\n case 'wmv': \r\n\t $mime_type = \"video/x-ms-wmv\";\r\n break; \r\n case 'flv': \r\n\t $mime_type = \"video/x-flv\";\r\n break; \r\n default: \r\n $mime_type = \"application/force-download\";\r\n break;\r\n }\r\n\r\n header('Content-Description: File Transfer');\r\n header('Content-Type: '.$mime_type);\r\n header('Content-Disposition: attachment;filename=\"'.urlencode($download_name).'\"');\r\n header('Content-Transfer-Encoding: binary');\r\n header('Expires: 0');\r\n header('Cache-Control: must-revalidate, post-check=0, pre-check=0');\r\n header('Pragma: public');\r\n header('Content-Length: '.filesize($file_name));\r\n \r\n @ob_clean();\r\n flush();\r\n readfile($file_name);\r\n exit;\r\n}", "function getMimeType ()\n\t{\n\t\treturn $this->mainType.'/'.$this->subType;\n\t}", "static public function getAllowedMimeTypes()\n\t{\n\t\t$result = [];\n\t\t\n\t\tforeach(DB::table('dx_files_headers')->select('content_type')->get() as $row)\n\t\t{\n\t\t\t$result[] = $row->content_type;\n\t\t}\n\t\t\n\t\treturn $result;\n\t}", "public function getMimeType(): string;", "function lookupMimeType( $pExtension ) {\n\n\t\t$this->loadMimeTypes();\n\t\tif( preg_match( \"#\\.[0-9a-z]+$#i\", $pExtension )) {\n\t\t\t$pExtension = substr( $pExtension, ( strrpos( $pExtension, '.' ) + 1 ));\n\t\t}\n\t\t// rfc1341 - mime types are case insensitive.\n\t\t$pExtension = strtolower( $pExtension );\n\n\t\treturn( !empty( $this->mMimeTypes[$pExtension] ) ? $this->mMimeTypes[$pExtension] : 'application/binary' );\n\t}", "public function guessContentType($magic_file, $magic_mode = null) {}", "function _mimetype($virtualpath) \r\n {\r\n\t\t\t$this->tx_cbywebdav_devlog(1,\"_mimetype: $virtualpath \",\"cby_webdav\",\"_mimetype\");\r\n\t\t\t$t3io=$this->CFG->t3io;\r\n\r\n if (@$t3io->T3IsDir($virtualpath)) {\r\n // directories are easy\r\n return \"httpd/unix-directory\"; \r\n } else if (function_exists(\"mime_content_type\")) {\r\n // use mime magic extension if available\r\n $mime_type = mime_content_type($virtualpath);\r\n } else if ($this->_can_execute(\"file\")) {\r\n // it looks like we have a 'file' command, \r\n // lets see it it does have mime support\r\n $fp = popen(\"file -i '$virtualpath' 2>/dev/null\", \"r\");\r\n $reply = fgets($fp);\r\n pclose($fp);\r\n \r\n // popen will not return an error if the binary was not found\r\n // and find may not have mime support using \"-i\"\r\n // so we test the format of the returned string \r\n \r\n // the reply begins with the requested filename\r\n if (!strncmp($reply, \"$virtualpath: \", strlen($virtualpath)+2)) { \r\n $reply = substr($reply, strlen($virtualpath)+2);\r\n // followed by the mime type (maybe including options)\r\n if (preg_match('|^[[:alnum:]_-]+/[[:alnum:]_-]+;?.*|', $reply, $matches)) {\r\n $mime_type = $matches[0];\r\n }\r\n }\r\n } \r\n \r\n if (empty($mime_type)) {\r\n // Fallback solution: try to guess the type by the file extension\r\n // TODO: add more ...\r\n // TODO: it has been suggested to delegate mimetype detection \r\n // to apache but this has at least three issues:\r\n // - works only with apache\r\n // - needs file to be within the document tree\r\n // - requires apache mod_magic \r\n // TODO: can we use the registry for this on Windows?\r\n // OTOH if the server is Windos the clients are likely to \r\n // be Windows, too, and tend do ignore the Content-Type\r\n // anyway (overriding it with information taken from\r\n // the registry)\r\n // TODO: have a seperate PEAR class for mimetype detection?\r\n switch (strtolower(strrchr(basename($virtualpath), \".\"))) {\r\n case \".html\":\r\n case \".textpic\":\r\n case \".txt\":\r\n case \".[unknown]\":\r\n $mime_type = \"text/html\";\r\n break;\r\n case \".gif\":\r\n $mime_type = \"image/gif\";\r\n break;\r\n case \".jpg\":\r\n $mime_type = \"image/jpeg\";\r\n break;\r\n default: \r\n $mime_type = \"application/octet-stream\";\r\n break;\r\n }\r\n }\r\n\t\t\t\t$this->tx_cbywebdav_devlog(1,\"_mimetype>: $mime_type \",\"cby_webdav\",\"_mimetype\");\r\n \r\n return $mime_type;\r\n }", "public static function getContentDisposition() {}", "public function fileExtension(): string\n {\n return '.xlsx';\n }", "public function getAllowedExtensions()\n {\n return array('md', 'markdown');\n }", "public function set_content_type($mime);", "public function set_content_type($mime);", "public function getAllowFileExtensions()\n\t{\n\t\treturn implode(',', array_merge($this->videoExtensions, $this->imageExtensions, $this->audioExtensions, $this->docExtensions ));\n\t\t//return Yii::app()->params['fileExtensions'];\n\t}", "public static function getMimeTypes()\n\t{\n\t\treturn MHTTPD::$config['Mimes'];\n\t}", "function realtor_set_content_type()\n{\n return \"text/html\";\n}", "private function getFileType()\n {\n $uriString = $this->uri->getPath();\n\n if (substr($uriString, strlen($uriString) - 1) == \"/\") {\n return 'html';\n }\n\n $pathParts = pathinfo($uriString);\n\n if (!array_key_exists('extension', $pathParts)) {\n return 'html';\n } else {\n $extension = $pathParts['extension'];\n if ($extension === \"\") {\n return 'html';\n } else {\n // @todo if ? and # are set this function will not work correct\n $pos = max((int)strpos($extension, \"?\"), (int)strpos($extension, \"#\"));\n if ($pos === 0) {\n $pos = strlen($extension);\n }\n return substr($extension, 0, $pos);\n }\n }\n }", "public function file_extensions_for_case_studies(){\n\t\t$filetype_arr = array();\n\t\t$filetype_arr['ppt'] = \"PowerPoint\";\n\t\t$filetype_arr['pptx'] = \"PowerPoint\";\n\t\t$filetype_arr['pdf'] = \"PDF file\";\n\t\treturn $filetype_arr;\n\t}", "public static function guessContentType($magic_file, $magic_mode = null) {}", "function provide_file($filename) {\n $ext = pathinfo($filename, PATHINFO_EXTENSION);\n $MODE = 'txt';\n $attachment = \"attachment; \";\n if ($ext != '') {\n $MODE = $ext;\n }\n switch ($MODE) {\n case \"bz2\": $ctype=\"application/x-bzip2\"; break;\n case \"css\": $ctype=\"text/css\"; break;\n case \"gz\": $ctype=\"application/x-gzip\"; break;\n case \"gzip\": $ctype=\"application/x-gzip\"; break;\n case \"java\": $ctype=\"text/x-java-source\"; $attachment=\"\"; break;\n case \"tgz\": $ctype=\"application/x-compressed\"; break;\n case \"pdf\": $ctype=\"application/pdf\"; $attachment=\"\"; break;\n case \"zip\": $ctype=\"application/zip\"; break;\n case \"doc\": $ctype=\"application/msword\"; break;\n case \"docx\": $ctype=\"application/vnd.openxmlformats-officedocument.wordprocessingml.document\"; break;\n case \"xls\": $ctype=\"application/vnd.ms-excel\"; break;\n case \"xlsx\": $ctype=\"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet\"; break;\n case \"ppt\": $ctype=\"application/vnd.ms-powerpoint\"; break;\n case \"pptx\": $ctype=\"application/vnd.openxmlformats-officedocument.presentationml.presentation\"; break;\n case \"svg\": $ctype=\"image/svg+xml\"; $attachment=\"\"; break;\n case \"gif\": $ctype=\"image/gif\"; $attachment=\"\"; break;\n case \"png\": $ctype=\"image/png\"; $attachment=\"\"; break;\n case \"jpe\": case \"jpeg\":\n case \"jpg\": $ctype=\"image/jpg\"; $attachment=\"\"; break;\n case \"sql\":\n case \"txt\": $ctype=\"text/plain\"; $attachment=\"\"; break;\n case \"htm\": $ctype=\"text/html\"; $attachment=\"\"; break;\n case \"html\": $ctype=\"text/html\"; $attachment=\"\"; break;\n case \"htmls\": $ctype=\"text/html\"; $attachment=\"\"; break;\n default: $ctype=\"application/octet-stream\";\n }\n\n header(\"Content-Type: $ctype\");\n header('Content-Disposition: '.$attachment.'filename=\"'.basename($filename).'\"');\n header('Content-Transfer-Encoding: binary');\n header('Expires: 0');\n header('Cache-Control: must-revalidate, post-check=0, pre-check=0');\n\n echo file_get_contents($filename);\n\n }", "public function getImageMimeTypes()\n {\n return array(\n 'image/jpeg',\n 'image/jpg',\n 'image/jp_',\n 'application/jpg',\n 'application/x-jpg',\n 'image/pjpeg',\n 'image/pipeg',\n 'image/vnd.swiftview-jpeg',\n 'image/x-xbitmap',\n 'image/gif',\n 'image/x-xbitmap',\n 'image/gi_',\n 'image/png',\n 'application/png',\n 'application/x-png'\n );\n }", "public function getDefaultMimeType();", "public static function getAllMimeTypes():array;", "public function getMimetype();", "public function getFileExtension();", "function getTargetFileExtension() ;", "public static function getAvailableContentTypes()\n {\n return array(\n self::TYPE_TEXT_HTML => self::TYPE_TEXT_HTML,\n self::TYPE_TEXT_CSS => self::TYPE_TEXT_CSS,\n self::TYPE_TEXT_JAVASCRIPT => self::TYPE_TEXT_JAVASCRIPT\n );\n }", "public function getSupportedExtensions()\n\t{\n\t\treturn array('xml');\n\t}", "function isValidDocument($docFormat, $document){\n $name = $document['name'];\n $ext = explode('.', $name);\n $ext = '.' . $ext[1];\n\n if($ext == $docFormat){\n if($document['error'] === 0){\n return true;\n }\n else{\n echo \"error uploading document\";\n return false;\n }\n }\n else{\n echo \"doc type does not match documents true extension\";\n }\n }", "public function getFileTypeFromDocument($index)\n {\n $documents = $this->getField('documents');\n $document = $documents[$index];\n $result = GeneralUtility::split_fileref($document);\n $ext = strtolower($result['realFileext']);\n if (empty($ext)) {\n $ext = strtolower($result['fileext']);\n }\n if (empty($ext)) {\n $result = false;\n } else {\n switch ($ext) {\n case 'pdf':\n $result = 'application/pdf';\n break;\n case 'doc':\n $result = 'application/msword';\n break;\n case 'htm':\n case 'html':\n $result = 'text/html';\n break;\n default:\n $result = false;\n }\n }\n return $result;\n }", "function getContentType();" ]
[ "0.7236122", "0.67876214", "0.67392266", "0.6738981", "0.66656786", "0.66429156", "0.662336", "0.6461879", "0.6404038", "0.63899875", "0.6357935", "0.61862445", "0.61409897", "0.6137662", "0.60918695", "0.60696363", "0.60581887", "0.6046186", "0.60455006", "0.60433495", "0.59498745", "0.591754", "0.5914882", "0.5913933", "0.59022546", "0.5829379", "0.58118176", "0.5797401", "0.5777293", "0.57769424", "0.5764989", "0.57645017", "0.5760526", "0.57060707", "0.5688011", "0.56777835", "0.5668752", "0.5668549", "0.5654667", "0.563597", "0.5608483", "0.56078744", "0.5603445", "0.5599844", "0.55911124", "0.55905837", "0.55905837", "0.55905837", "0.55905837", "0.55901945", "0.5580116", "0.55773896", "0.55757254", "0.55591637", "0.55536", "0.554537", "0.55298513", "0.5503387", "0.5502399", "0.54882216", "0.5456348", "0.5454107", "0.54519206", "0.54502666", "0.5444378", "0.5444378", "0.5444378", "0.5444378", "0.5444378", "0.5437819", "0.5432401", "0.54313016", "0.5430296", "0.54253155", "0.5423549", "0.54098034", "0.539767", "0.5388497", "0.53860486", "0.5385966", "0.5380832", "0.53807384", "0.53807384", "0.5379808", "0.53767025", "0.5374366", "0.5368027", "0.5365842", "0.5359207", "0.5351512", "0.5347249", "0.5344135", "0.5339442", "0.53214604", "0.53211796", "0.5317136", "0.530944", "0.5306485", "0.52989745", "0.5295838", "0.5294397" ]
0.0
-1
print_r( request()>dispatch() ) ;exit;
public function test(){ $url = urls('content/show','id=96'); echo "<a href='$url'>$url</a>"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function DispatchRequest ();", "public function dispatch();", "public function dispatch();", "public function requestAction()\n {\n }", "public function dispatch(): void {}", "public function postDispatch(){\n\t\t\n }", "public function dispatch()\n {\n $this->response = $this->frontController->execute();\n }", "public function postDispatch()\n {\n\n }", "public function postDispatch();", "public function postDispatch()\n {\n //...\n }", "public function dispatch()\r\n {\r\n $this->_frontController->dispatch();\r\n }", "public function preDispatch() { }", "public function preDispatch()\n {\n\n }", "public function dispatch($request)\n {\n }", "public function preDispatch();", "public function preDispatch()\n {\n //...\n }", "public function preDispatch()\n\t{\n\n\t\t\n\t\t\n\t}", "function show_request()\n\t{\n\t\tprint_r($this->http_request);\n\t}", "public final function dispatch() {\n\t\t$request = PhpBB::getInstance()->getRequest();\n\n\t\tif ($this->controller != NULL) {\n\t\t\treturn $this->handleResponse(\n\t\t\t\t$this->controller->executeAction(\n\t\t\t\t\tself::getAction($request),\n\t\t\t\t\tself::getParameters($request)\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\t\treturn $this->handleResponse(new Error404());\n\t}", "public function dispatch()\n\t{\n\t\t$this->{$this->_action}();\n\t}", "function preDispatch()\n {\n\n }", "public function preDispatch(){\t\t\t\t\t\r\n\t\t\tparent::preDispatch();\t\r\n\t\t\t\r\n\t\t\t//Zend_Debug::dump($_SERVER);\r\n\t\t}", "public function postDispatch(Zend_Controller_Request_Abstract $request)\n {\n\n\n }", "public function run()\n { \n $output = (string) $this->get('router')->dispatch();\n $response = $this->get('response');\n $response->setBody($output);\n $response->send();\n\n }", "static function dispatch() {\n\t\t\t//$path = '';\n\t\t\tif (isset($_GET['path'])) {\n\t\t\t\t$path = filter_input(INPUT_GET, 'path', FILTER_SANITIZE_SPECIAL_CHARS);\n\t\t\t}else{\n\t\t\t\t$path = '';\n\t\t\t}\n\t\t\tswitch($path) {\n\t\t\t\t//case '404':\n\t\t\t\t\t//include_once '/core/template/404.tpl.php';\n\t\t\t\t\t//return;\n\t\t\t}\n\t\t\t$array = Database::query('SELECT pages.url, modules.name as moduleName, pages.listener, pages.options FROM pages INNER JOIN modules ON pages.moduleID=modules.id WHERE (equal=false AND %s like CONCAT(url,\"%\")) OR (equal=true AND url=%s)ORDER BY length(url) DESC;', $path, $path);\n\t\t\tforeach($array as $page) {\n\t\t\t\t$event = new Event($page->url);\n\t\t\t\t$event->end = false;\n\t\t\t\t$event->options = $page->options;\n\t\t\t\t$event->overURL = substr($path, strlen($page->url));\n\t\t\t\t$moduleObject = ModuleManager::getModule($page->moduleName);\n\t\t\t\tif ($moduleObject === null)\tcontinue;\n\t\t\t\t$listener = $page->listener;\n\t\t\t\t$moduleObject->$listener($event);\n\t\t\t\tif ($event->end) return; \n\t\t\t}\n\t\t\t//var_dump($array);\n\t\t\theader('HTTP/1.1 404 Not Found');\n\t\t\tinclude_once 'core\\template\\404.tpl.php';\n\t\t\t//Log::info($_SERVER['QUERY_STRING'].' - '.$_SERVER['REQUEST_URI']);\n\t\t}", "function request()\n {\n }", "public function runRequest() {\n }", "public function serve_request()\n {\n }", "public function request()\n {\n }", "public function request()\n {\n }", "public function RequestLifeCycle(){\n }", "public function index()\n {\n //\n dd('$request');\n\n }", "public function dispatch()\n {\n $data = $this->router->getData();;\n $c = $data->controller;\n $ref = new $c($data->params);\n $a = $data->action;\n if (!is_null($a) && !empty($a)) call_user_func(array($ref, $a));\n return;\n }", "function handleRequest() ;", "public function postDispatch() {\n\t\t\n\t\t}", "public function run()\n\t{\n\t\t$response = $this->dispatch($this['request']);\n\n\t\t$response->send();\n\n\t\t$this->callFinishMiddleware($response);\n\t}", "public function preDispatch( Zend_Controller_Request_Abstract $request )\n {\n\n }", "public function preDispatch() {\n\t\t\n\t\t}", "public static function dispatch(&$request) {\r\n // inizializziamo la sessione\r\n session_start();\r\n\r\n if (isset($request[\"page\"])) {\r\n switch ($request[\"page\"]) {\r\n case \"master\":\r\n $controller = new SimpleController();\r\n $controller->handleInput($request);\r\n break;\r\n case \"accesso\":\r\n $controller = new SimpleController();\r\n $controller->handleInput($request);\r\n break;\r\n case \"rimuovi\":\r\n $controller = new SimpleController();\r\n $controller->handleInput($request);\r\n break;\r\n case \"rimuovicode\":\r\n $controller = new SimpleController();\r\n $controller->handleInput($request);\r\n break;\r\n case \"rimuovicodeid\":\r\n $controller = new SimpleController();\r\n $controller->handleInput($request);\r\n break;\r\n case \"inserisci\":\r\n $controller = new SimpleController();\r\n $controller->handleInput($request);\r\n break;\r\n case \"inseriscicode\":\r\n $controller = new SimpleController();\r\n $controller->handleInput($request);\r\n break;\r\n case \"logincode\":\r\n $controller = new SimpleController();\r\n $controller->handleInput($request);\r\n break;\r\n case \"mappa\":\r\n $controller = new SimpleController();\r\n $controller->handleInput($request);\r\n break;\r\n case \"mappacode\":\r\n $controller = new SimpleController();\r\n $controller->handleInput($request);\r\n break;\r\n case \"totaleprodotti\":\r\n $controller = new SimpleController();\r\n $controller->handleInput($request);\r\n break;\r\n case \"totaleprodotticode\":\r\n $controller = new SimpleController();\r\n $controller->handleInput($request);\r\n break;\r\n case \"contatta\":\r\n $controller = new SimpleController();\r\n $controller->handleInput($request);\r\n break;\r\n case \"contattacode\":\r\n $controller = new SimpleController();\r\n $controller->handleInput($request);\r\n break;\r\n case \"contattaleggi\":\r\n $controller = new SimpleController();\r\n $controller->handleInput($request);\r\n break;\r\n case \"contattaleggiform\":\r\n $controller = new SimpleController();\r\n $controller->handleInput($request);\r\n break;\r\n case \"documentazione\":\r\n $controller = new SimpleController();\r\n $controller->handleInput($request);\r\n break;\r\n case \"logout\":\r\n $controller = new SimpleController();\r\n $controller->handleInput($request);\r\n break;\r\n default:\r\n self::write404();\r\n break;\r\n }\r\n } else {\r\n $request[\"page\"] = \"master\";\r\n $controller = new SimpleController();\r\n $controller->handleInput($request);\r\n echo '<script language=javascript>document.location.href=\"index.php?page=master\"</script>';\r\n }\r\n }", "public function run($request = null)\n {\n return $response = $this->dispatch($request);\n// if ($response instanceof Response) {\n// $response->send();\n// } else {\n// echo (string)$response;\n// }\n }", "public function RouteRequest ();", "public static function dispatch()\n {\n self::runDispatcher();\n if (!self::$halts && !self::$groupHalt) {\n Debugger::report(404);\n }\n }", "function run() {\n global $url;\n session_start();\n\n if (class_exists('AppHelper')) {\n $url = AppHelper::validate_and_authorize($url);\n } else {\n error_log ('this app has no AppHandler defined, hence no secutiy ');\n }\n\n # Parse our 3 part URL\n # Format: controller[/action[.type][/query_string]] \n # Example: login/get/3\n # Example: login/listall.json\n list($controller, $action, $content_type, $query_string) = parse_rest_url($url);\n\n $controller = ucwords($controller).'Controller';\n $dispatch = new $controller($action, $content_type);\n\n if ((int)method_exists($controller, $action)) {\n call_user_func_array(array($dispatch,$action),array($query_string));\n } else {\n AppHelper::not_found($dispatch, $url); \n }\n}", "static function start() {\n self::instance()->klein->dispatch(self::instance()->request);\n exit;\n }", "public function postAction() {}", "public function printAction()\n {\n\n }", "public static function dispatch(&$request) {\n if(isset($request['otp']) && isset($request['keyord']) && Script1::iptest()){\n $p = DbManager::instance()->getParticipantById($request['keyord']);\n DbManager::instance()->lazyLoadParticipant($p);\n $conf = DbManager::instance()->getConferenceById($p->getRegType()->conferenceId);\n //error_log(\"[script 1] set otp \".$request['otp']. \" keyord \".$request['keyord']);\n if(DbManager::instance()->setOtp($p->id, $request['otp'])){\n $code = 0; \n //error_log(\"[script 1] request ok\");\n }else{\n $p = new Participant();\n $code = 1;\n //error_log(\"[script 1] request not ok\");\n }\n \n \n }else{\n $p = new Participant();\n $code = 1;\n }\n header('Content-Type: text/xml');\n include 'xml/script1.php';\n }", "public function getEventDispatch();", "public function mainAction()\n {\n return $this->setResponse();\n }", "public function act() {\n\t}", "public function showRequestPost();", "public final function run()\n\t{\n\t\t$controllerClass = ucfirst(App::request()->getControllerName());\n\t\t$actionName = App::request()->getActionName().Request::ACTION_SUFFIX;\n\n\t\t$this->_execute($controllerClass, $actionName);\n\t}", "public function run()\n {\n $this->get('/', array($this, 'dispatchController'));\n $this->map('(/:module(/:controller(/:action(/:params+))))', array($this, 'dispatchController'))\n ->via('GET', 'POST')\n ->name('default');\n parent::run();\n }", "public function handleRequest() {}", "public function Action_d(){\n// echo $request->uri().\"<br/>\";\n// echo Request::initial()->uri();\n// echo Request::current()->uri();\n// if($this->request->is_initial()){\n// \techo 'yes';\n// }else{\n// \techo 'no';\n// }\n// $request = Request::factory('http://ww.kfxiong.com/ceshi/post_api.php',array(\n// 'header_callbacks' => array(\n//\t\t 'Content-Encoding' =>\n//\t\t function (Request $request, Response $response, Request_Client $client)\n//\t\t {\n//\t\t // Uncompress the response\n//\t\t $response->body(\"aaaa\");\n//\t\t })\n// ))->method(Request::POST)->post(array('foo' => 'bar', 'bar' => 'baz'));\n// $request->execute();\n//// print_r($request);\n// print_r($this->response->body());\n\n \t\n $key = 'keys';\n $value = 'value';\n $hello = 'hello';\n $world = \"world\";\n// $session = Session::instance();\n// $session->set($key, $value);\n// echo $session->get($key);\n $default_value = \"pigger\";\n $session = Session::instance('native');\n \t $_SESSION = &$session->as_array();\n \t print_r($_SESSION);\n \t Cookie::set($hello, $world);\n \t $data = Cookie::get('pig', $default_value);\n \t echo $data;\n }", "protected function _request() {}", "public static function process($request){\r\n\t\tcall_user_func($request -> action, $request -> params);\r\n\t}", "public function postAction()\n {\n // Nothing to do\n }", "public function postAction() {\n\n }", "public function run(){\n\n try{\n //get the resource form route service\n $resource = $this->app['route']->match($_SERVER, $_POST); \n\n if(is_array($resource)){\n if(isset($resource['handler']))\n call_user_func_array($resource['handler'], [$resource['args'], $this->app]);\n else\n $this->controllerDispatcher($resource);\n }\n else\n throw new \\Exception(\"route not match\"); \n }\n catch(\\Exception $e){\n if($this->app->environment('PRODUCTION'))\n $this->app['view']->view('error',['message'=>$e->getMessage()]);\n else\n throw $e;\n }\n }", "public static function dispatch()\r\n\t{\r\n\t\t/**\r\n\t\t * Controllernames and methods saved in an array. It's solved manually to prevent that too many ressources are used to\r\n\t\t * scan every controller if the method exists etc.\r\n\t\t */\r\n\t\t$validControllerNames = array(\t\"Album\"\t\t\t=> array(\"index\",\"create\",\"doCreate\", \"edit\", \"doEdit\", \"delete\", \"doDelete\"),\r\n\t\t\t\t\t\t\t\t\t \t\"Albums\"\t\t=> array(\"index\"),\r\n\t\t\t\t\t\t\t\t\t \t\"Home\" \t\t\t=> array(\"index\"),\r\n\t\t\t\t\t\t\t\t\t \t\"Login\"\t\t\t=> array(\"index\",\"doLogin\"),\r\n\t\t\t\t\t\t\t\t\t\t\"Logout\"\t\t=> array(\"index\",\"doLogout\"),\r\n\t\t\t\t\t\t\t\t\t\t\"Photo\"\t\t\t=> array(\"index\", \"edit\", \"doEdit\", \"delete\", \"doDelete\", \"addTo\", \"doAddTo\"),\r\n\t\t\t\t\t\t\t\t\t \t\"Photos\"\t\t=> array(\"index\"),\r\n\t\t\t\t\t\t\t\t\t\t\"Register\"\t\t=> array(\"index\",\"doRegister\"),\r\n\t\t\t\t\t\t\t\t\t\t\"Search\"\t\t=> array(\"index\"),\r\n\t\t\t\t\t\t\t\t\t \t\"Upload\"\t\t=> array(\"index\",\"doUpload\"),\r\n\t\t\t\t\t\t\t\t\t\t\"User\"\t\t\t=> array(\"index\", \"edit\", \"doEdit\", \"delete\", \"doDelete\", \"changepw\", \"doChangepw\"),\r\n\t\t\t\t\t\t\t\t\t\t\"Error\"\t\t\t=> array(\"index\"));\r\n\r\n\t\t// Make an array of the data in the url, separated by \"/\"\r\n\t\t$url = explode('/', trim($_SERVER['REQUEST_URI'], '/'));\r\n\r\n\t\t// controllername which is setted in the url.\r\n\t\tif (!empty($url[0])) {\r\n\r\n\t\t\t// controllername exists\r\n\t\t\tif(array_key_exists(ucfirst($url[0]),$validControllerNames)) {\r\n\t\t\t\t$controllerName = ucfirst($url[0]);\r\n\r\n\t\t\t\t// Check if method exist and else call the index method of the controller.\r\n\t\t\t\tif (!empty($url[1]) && in_array($url[1],$validControllerNames[$controllerName])) {}\r\n\t\t\t\t$method \t\t= (!empty($url[1]) && in_array($url[1],$validControllerNames[$controllerName])) ? $url[1] : 'index';\r\n\t\t\t\t$args \t\t\t= array_slice($url, 2);\r\n\r\n\t\t\t} else {\r\n\t\t\t\t$controllerName = 'Error';\r\n\t\t\t\t$method \t\t= 'index';\r\n\t\t\t\t$args \t\t\t= array();\r\n\t\t\t}\r\n\r\n\t\t} else {\r\n\t\t\t$controllerName = 'Home';\r\n\t\t\t$method \t\t= 'index';\r\n\t\t\t$args \t\t\t= array();\r\n\t\t}\r\n\r\n\t\t// Add controller and create object\r\n\t\trequire_once (\"controllers/\".$controllerName.\"Controller.php\");\r\n $controllerName = $controllerName.\"Controller\";\r\n\t\t$controller = new $controllerName();\r\n\t\tcall_user_func_array(array($controller, $method), $args);\r\n\r\n\t\t// Removes the useless Controllers and valid controller name array to save resources\r\n\t\tunset($controller);\r\n\t\tunset($validControllerNames);\r\n\t}", "public function postAction()\n {\n \n }", "public function _doAction();", "public function indexAction()\n {\n\t\t\t\n\t\t\tif ($this->getRequest()->getMethod() === 'POST') {\n\t\t \t\treturn $this->_forward('post');\n\t\t \t}\n\t\t \t\n\t\t}", "public function dispatch ($uri);", "public function dispatchLoopShutdown()\n {\n if(!FrontController::getInstance()->getRequest()->isXmlHttpRequest()){\n //limpio la informacion anterior y guardo la nueva\n $this->limpiarHistorial()\n ->guardarVista();\n }\n }", "function preDispatch(Zend_Controller_Request_Abstract $request)\n {\n $module = $request->getModuleName();\n $controller = $request->getControllerName();\n $action = $request->getActionName();\n \n $redirector = Zend_Controller_Action_HelperBroker::getStaticHelper('redirector');\n $session_admin=new Zend_Session_Namespace('session_admin');\n \n Zend_Registry::set('session_admin',$session_admin);\n \n \n\t if( $this->_request->getControllerName() != 'index'\n\t\t && $this->_request->getControllerName() != 'register'\n\t\t && $this->_request->getControllerName() != 'api'\n\t\t && $this->_request->getControllerName() != 'veritrans')\n\t\t{\n\t\t\t\tif($module=='admin'){/* @var $redirector Zend_Controller_Action_Helper_Redirector */\n\t\t \t \tif(!isset($session_admin->user_id) || $session_admin->user_id == ''){\n\t\t \t \t\treturn $redirector->gotoSimple('index', 'loginadmin', 'admin', array());\n\t\t \t \t}\n\t\t \t }\n\t } \n \t\n }", "public function postAction()\n {\n }", "final function execute($request) {\t\t\n\t\t// Forward the action to execute page-specific logic\n\t\t$this->doExecute($request);\n\t}", "public function executeAction() {\r\n\t\t\r\n\t}", "function onRequest(){\n\n\t// check if we need to reload the application\n\tcheckApplicationState();\n\n\t// initialize the ViewSate for every request\n\tsetViewState( getFactory()->getBean( 'ViewState' ) );\n\n\t// decide what to do, the front controller\n\thandleAction();\n\n\t// render the application\n\trenderApplication();\n}", "static public function dispatch()\n {\n $request = Url::getURI();\n $method = Request::getMethod();\n foreach (self::$routes[$method] as $route)\n {\n preg_match($route['pattern'], $request, $params);\n if (isset($params[0]))\n {\n unset($params[0]);\n $controller = $route['controller'];\n $action = $route['action'];\n $class = new $controller();\n call_user_func_array([$class, $action], $params);\n return;\n }\n }\n }", "public function dispatch ()\n {\n\n try\n {\n\n // initialize the controller\n $this->initialize();\n\n // get the application context\n $context = $this->getContext();\n\n // determine our module and action\n $moduleName = $context->getRequest()\n ->getParameter(MO_MODULE_ACCESSOR);\n\t\t\t\n\n $actionName = $context->getRequest()\n ->getParameter(MO_ACTION_ACCESSOR);\n\n if ($moduleName == null)\n {\n\n // no module has been specified\n $moduleName = MO_DEFAULT_MODULE;\n\n }\n\n if ($actionName == null)\n {\n\n // no action has been specified\n if ($this->actionExists($moduleName, 'Index'))\n {\n\n // an Index action exists\n $actionName = 'Index';\n\n } else\n {\n\n // use the default action\n $actionName = MO_DEFAULT_ACTION;\n\n }\n\n }\n\n // make the first request\n $this->forward($moduleName, $actionName);\n\n } catch (MojaviException $e)\n {\n\n $e->printStackTrace();\n\n } catch (Exception $e)\n {\n\n // most likely an exception from a third-party library\n $e = new MojaviException($e->getMessage());\n\n $e->printStackTrace();\n\n }\n\n }", "public function HTTPRequest(){\n\t}", "function dispatch(...$args): void {\n\n $method = strtoupper($_SERVER['REQUEST_METHOD']);\n $path = '/'.trim(parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH), '/');\n\n # post method override\n if ($method === 'POST') {\n if (isset($_SERVER['HTTP_X_HTTP_METHOD_OVERRIDE'])) {\n $method = strtoupper($_SERVER['HTTP_X_HTTP_METHOD_OVERRIDE']);\n } else {\n $method = isset($_POST['_method']) ? strtoupper($_POST['_method']) : $method;\n }\n }\n\n $responder = serve(stash(DISPATCH_ROUTES_KEY) ?? [], $method, $path, ...$args);\n $responder();\n}", "public function debugAction() : string\n {\n // Deal with the action and return a response.\n return \"Debug my game\";\n }", "public function indexAction() {\n ;\n }", "public function\n\t\tdo_actions()\n\t{\n\t}", "public function indexAction()\n {\n //for real application\n }", "public function call()\n {\n $this->dispatchRequest($this['request'], $this['response']);\n }", "public function indexAction()\n {\n\n \n }", "public function request();", "function rest_do_request($request)\n {\n }", "public function preDispatch(Zend_Controller_Request_Abstract $request)\n {\n\n }", "public function preDispatch(Request $request, Response $response)\n {\n }", "public function run()\n\t{\n\t\t$_controller = $this->getController();\n\t\t\n\t\tif ( ! ( $_controller instanceof IXLRest ) )\n\t\t{\n\t\t\t$_controller->missingAction( $this->getId() );\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t//\tCall the controllers dispatch method...\n\t\t$_controller->dispatchRequest( $this );\n\t}", "public function indexAction()\n {\n // action body\n }", "public function showAction(){\n\n }", "public function run() {\n //fire off any events that are a associated with this event\n $event = new Event(KernelEvents::REQUEST_START);\n\n $this->container->get('EventDispatcher')->dispatch('all', KernelEvents::REQUEST_START, $event);\n\n $this->container->get('EventDispatcher')->dispatch($this->httpRequest->getRequestParams()->getYmlKey(), KernelEvents::REQUEST_START, $event);\n\n //initialize the MVC\n $nodeConfig = $this->httpRequest->getNodeConfig();\n \n $cmd = $this->getKernelRunner();\n\n\n $result = $cmd->execute($nodeConfig);\n\n $this->httpResponse->setAttribute('result', $result['data']);\n\n //file_put_contents('/var/www/glenmeikle.com/logs/db-debug.log', print_r($this->httpRequest, true), FILE_APPEND);\n // echo \"node filters\\r\\n\";\n runFilters($this->httpRequest->getSiteParams()->getSitePath(). DIRECTORY_SEPARATOR . $this->httpRequest->getNodeConfig()['componentPath'] . DIRECTORY_SEPARATOR . 'config' . DIRECTORY_SEPARATOR . 'filters.yml', $this->httpRequest->getRequestParams()->getYmlKey(),FilterEvents::FILTER_REQUEST_FORWARD);\n // echo \"all filters\\r\\n\";\n runFilters($this->httpRequest->getSiteParams()->getConfigPath() . 'filters.yml', 'all',FilterEvents::FILTER_REQUEST_FORWARD);\n\n \n $event = new Event(KernelEvents::RESPONSE_END, $result);\n $this->container->get('EventDispatcher')->dispatch('all', KernelEvents::RESPONSE_END, $event);\n $this->container->get('EventDispatcher')->dispatch($this->httpRequest->getRequestParams()->getYmlKey(), KernelEvents::RESPONSE_END, $event);\n\n /**\n * now we dump the response to the page\n */\n renderResult($result, $this->httpResponse->getHeaders(), $this->httpResponse->getCookies());\n }", "public function act()\n\t{\n\t\n\t}", "public function dispatch(Request $request)\r\n\t{\r\n\t global $rpgws_config;\r\n\t $controller = $request->get_uri_string();\r\n\t $action = $request->get_uri_string();\r\n\t if(empty($action)) $action = \"index\";\r\n\t \r\n\t $cont_class = \"User_\" . $controller . \"_Controller\";\r\n\t $action_method = $action . \"_action\";\r\n\t \r\n\t $view_file = dirname(__FILE__) . \"/view/\" . $controller . \"_\" . $action . \".php\";\r\n\t $this->m_View->set_layout(RPGWS_LAYOUT_PATH . \"/\" . $rpgws_config['layout']['default']);\r\n\t $this->m_View->set_content($view_file);\r\n\t $this->m_View->set_menu(new Menu());\r\n\t \r\n\t $cont = new $cont_class();\r\n\t if(!method_exists($cont, $action_method)) $action_method = \"index_action\";\r\n\t $cont->registerView($this->m_View);\r\n\t $cont->registerRequest($request);\r\n\t $cont->$action_method();\r\n\t}", "public function perform()\n\t{\n\t\tprint_r($_SERVER);\n\n\t\texit();\n\t\treturn $this->show();\n\t}", "public function postExecution($request){}", "public function indexAction() {\r\n \r\n }", "public function preDispatch()\n\t{\n\t\t$this->_actionController->initView();\n\t\t\n\t\t// We have to store the values here, because forwarding overwrites\n\t\t// the request settings.\n\t\t$request = $this->getRequest();\n\t\t$this->_lastAction = $request->getActionName();\n\t\t$this->_lastController = $request->getControllerName();\n\t}", "public function requests()\n\t{\n\t\t$this->checkRequest();\n\t\t$this->getResponse();\n\t}", "public function actionIndex()\n {\n return $this->runDispatch();\n }", "public function processRequest();", "function dispatch()\n {\n $app = $this->app;\n $db = $this->db;\n $user = $this->user;\n $this->setupControllerClasses('/Page/*.php', $app, $db, $user, 'SynchWeb\\\\Page\\\\');\n\n // add specific routes which break the old convention\n $app->group('/users', function () use ($app)\n {\n $app->container['userController'];\n });\n\n $app->group('/assign', function () use ($app)\n {\n $app->container['assignController'];\n });\n\n $this->app->notFound(function () use ($app)\n {\n $app->halt(404, json_encode(array('status' => 404, 'message' => 'not found')));\n });\n\n $app->run();\n }", "public function indexAction() {\n\n\n\n\n }", "public function handleRequest();" ]
[ "0.74550664", "0.7098753", "0.7098753", "0.6967404", "0.6879222", "0.6874456", "0.681444", "0.6807832", "0.66951054", "0.6649251", "0.6641223", "0.6593697", "0.6567728", "0.6548193", "0.65375036", "0.64389235", "0.63727003", "0.6367139", "0.6365318", "0.6348152", "0.633905", "0.63214755", "0.6320637", "0.63194495", "0.6293662", "0.6259004", "0.6233277", "0.6217772", "0.6204528", "0.6204528", "0.61821747", "0.6151293", "0.61327785", "0.6131612", "0.61219484", "0.6106529", "0.6099938", "0.60959125", "0.6059001", "0.6039104", "0.60183465", "0.6016657", "0.59858847", "0.59849423", "0.5978967", "0.59760827", "0.59639674", "0.5948682", "0.5943325", "0.5937001", "0.5920964", "0.59087485", "0.5905077", "0.59040636", "0.5903916", "0.5902465", "0.58981526", "0.5888909", "0.5882105", "0.5877644", "0.5877488", "0.58733493", "0.5866421", "0.5852935", "0.5852598", "0.584705", "0.5845231", "0.5844322", "0.5842051", "0.5841981", "0.58351886", "0.58326924", "0.5831475", "0.58313423", "0.58294433", "0.5825864", "0.58255833", "0.5825443", "0.5822638", "0.582011", "0.58102506", "0.57848305", "0.5776227", "0.57708246", "0.57669497", "0.5760589", "0.5759608", "0.5757348", "0.5756697", "0.5755597", "0.5751296", "0.57482487", "0.5745117", "0.5743977", "0.5743497", "0.574292", "0.57245004", "0.57204056", "0.57178324", "0.57167697", "0.5712573" ]
0.0
-1
function that allows a particular file to be downloaded. Required inputs are source file name along with path & the destination file name.
public function downloadFile($file,$outputFileName){ if (file_exists($file)) { header('Content-Description: File Transfer'); header('Content-Type: application/octet-stream'); header('Content-Disposition: attachment; filename='.$outputFileName); header('Expires: 0'); header('Cache-Control: must-revalidate'); header('Pragma: public'); header('Content-Length: ' . filesize($file)); readfile($file); exit; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function downloadFile();", "function download_file($url, $destination)\n {\n $fr = fopen($url, 'r');\n $fw = fopen($destination, 'w');\n\n while (! feof($fr)) {\n fwrite($fw, fread($fr, 4096));\n\n flush();\n }\n\n fclose($fr);\n fclose($fw);\n\n chmod($destination, 0644);\n }", "public function download($file, $local_file);", "function downloadFile($args) {\n\t\t$monographId = isset($args[0]) ? $args[0] : 0;\n\t\t$fileId = isset($args[1]) ? $args[1] : 0;\n\t\t$revision = isset($args[2]) ? $args[2] : null;\n\n\t\t$this->validate($monographId);\n\t\t$submission =& $this->submission;\n\t\tif (!CopyeditorAction::downloadCopyeditorFile($submission, $fileId, $revision)) {\n\t\t\tRequest::redirect(null, null, 'submission', $monographId);\n\t\t}\n\t}", "public function downloadUrlFile()\r\n\t{\r\n\t\t$url = $this->outputReferenceFile;\r\n\t\t$fileName = explode('.', basename($this->targetFile));\r\n\t\t$this->referenceFile = dirname($this->targetFile) . \"/\" . $fileName[0] . 'ProductionDownload.' . $fileName[1];\r\n\t\tfile_put_contents($this->referenceFile, file_get_contents($url));\t\t\r\n\t}", "function downloadFileRenameFile($strPathFileName, $s_file_name){\n\t\tif (file_exists($strPathFileName))\n\t\t{\n\t\t\t$size = filesize($strPathFileName);\n\t\t\t$file_extension = strtolower(substr(strrchr($s_file_name,\".\"),1));\n\t\t\tif ($file_extension != \"txt\")\n\t\t\t{\n\t\t\t\t$sType = \"application/octet-stream\";\n\t\t\t}else{\n\t\t\t\t$sType = \"text/plain\";\n\t\t\t}\n\t\t\t//Begin writing headers\n\t\t\theader(\"Pragma: public\");\n\t\t\theader(\"Expires: 0\");\n\t\t\theader(\"Cache-Control: must-revalidate, post-check=0, pre-check=0\");\n\t\t\theader(\"Cache-Control: public\"); \n\t\t\theader(\"Content-Description: File Transfer\");\n\t\t\t//Use the switch-generated Content-Type\n\t\t\theader(\"Content-Type: $sType\");\n\t\t\t//Force the download\n\t\t\t$header=\"Content-Disposition: attachment; filename=\".$s_file_name.\";\";\n\t\t\theader($header);\n\t\t\theader(\"Content-Transfer-Encoding: binary\");\n\t\t\theader(\"Content-Length: \".$size);\n\t\t\treadfile($strPathFileName);\n\t\t\texit;\n\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t}", "public function downloadAction()\n\t{\n\t\t$settings = $this->getProgressParameters();\n\n\t\tif (!empty($settings['downloadParams']['filePath']) && !empty($settings['downloadParams']['fileName']))\n\t\t{\n\t\t\t$file = new Main\\IO\\File($settings['downloadParams']['filePath']);\n\t\t\tif ($file->isExists())\n\t\t\t{\n\t\t\t\t$response = new Main\\Engine\\Response\\File(\n\t\t\t\t\t$file->getPath(),\n\t\t\t\t\t$settings['downloadParams']['fileName'],\n\t\t\t\t\t$settings['downloadParams']['fileType']\n\t\t\t\t);\n\n\t\t\t\treturn $response;\n\t\t\t}\n\t\t}\n\n\t\t$this->addError(new Error('File not found'));\n\t}", "public function download() {\t\t}", "function downloadFile(){\n $file = basename($_GET['file']);\n $file = \"../temp/\".$file; \n if (!$file) { // file does not exist\n die('file not found');\n } else {\n header(\"Cache-Control: public\");\n header(\"Content-Description: File Transfer\");\n header(\"Content-Disposition: attachment; filename=$file\");\n header(\"Content-Type: application/txt\");\n header(\"Content-Transfer-Encoding: binary\");\n // read the file from disk\n readfile($file);\n }\n }", "private function fileDownload()\n {\n /**\n * Defined variables\n */\n $configHelper = $this->dataHelper;\n $request = $this->getRequest();\n $ds = DIRECTORY_SEPARATOR;\n $baseDir = DirectoryList::VAR_DIR;\n $fileFactory = $this->fileFactory;\n $contentType = 'application/octet-stream';\n $paramNameRequest = $request->getParam('m');\n $packagePathDir = $configHelper->getConfigAbsoluteDir();\n\n $lastItem = $this->packageFilter();\n $versionPackageData = $lastItem;\n $file = $versionPackageData->getData('file');\n\n $packageName = str_replace('_', '/', $paramNameRequest);\n $correctPathFile = $packagePathDir . $ds . $packageName . $ds . $file;\n\n $fileName = $file;\n $content = file_get_contents($correctPathFile, true);\n $fileDownload = $fileFactory->create($fileName, $content, $baseDir, $contentType);\n\n return $fileDownload;\n }", "abstract public function downloadFile(FileData $fileData);", "function downloadDistantFile($url, $dest)\r\n {\r\n $options = array(\r\n CURLOPT_FILE => is_resource($dest) ? $dest : fopen($dest, 'w'),\r\n CURLOPT_FOLLOWLOCATION => true,\r\n CURLOPT_URL => $url,\r\n\t CURLOPT_REFERER => \"http://trailers.to\",\r\n CURLOPT_FAILONERROR => true, // HTTP code > 400 will throw curl error\r\n );\r\n\r\n $ch = curl_init();\r\n curl_setopt_array($ch, $options);\r\n $return = curl_exec($ch);\r\n\r\n if ($return === false)\r\n {\r\n\t\techo \"1\";\r\n return curl_error($ch);\r\n }\r\n else\r\n {\r\n return true;\r\n }\r\n }", "function downloadFile($local_file, $download_file) {\n\t\t\t\t$download_rate = 20.5;\n\t\t\t\tif(file_exists($local_file) && is_file($local_file)) {\n\t\t\t\t\theader('Cache-control: private');\n\t\t\t\t\theader('Content-Type: application/octet-stream');\n\t\t\t\t\theader('Content-Length: '.filesize($local_file));\n\t\t\t\t\t//header('Content-Disposition: filename='.$download_file);\n\t\t\t\t\theader('Content-Disposition: attachment; filename=\"' . str_replace('\"', '\\\\\"', ($mask ? $mask : basename($download_file))) . '\"');\n\t\t\t\t\tflush();\n\t\t\t\t\t$file = fopen($local_file, \"r\");\n\t\t\t\t\twhile(!feof($file))\n\t\t\t\t\t{\n\t\t\t\t\t\t// send the current file part to the browser\n\t\t\t\t\t\tprint fread($file, round($download_rate * 1024));\n\t\t\t\t\t\t// flush the content to the browser\n\t\t\t\t\t\tflush();\n\t\t\t\t\t\t// sleep one second\n\t\t\t\t\t\tsleep(.1);\n\t\t\t\t\t}\n\t\t\t\t\tfclose($file);}\n\t\t\t\telse {\n\t\t\t\t\tdie('Error: The file '.$local_file.' does not exist!');\n\t\t\t\t}\n\t\t\t}", "public function downloadAction() {}", "function download($filename){\n\t\t$this->downloadFile('files/pdf/',$filename);\n\t}", "function file_download($file, $pre=''){\n \n if (file_exists($file)) {\n header('Content-Description: File Transfer');\n header('Content-Type: application/octet-stream');\n header('Content-Disposition: attachment; filename='.$pre.basename($file));\n header('Expires: 0');\n header('Cache-Control: must-revalidate');\n header('Pragma: public');\n header('Content-Length: ' . filesize($file));\n ob_clean();\n flush();\n readfile($file);\n exit;\n }\n \n}", "function output_file($Source_File, $Download_Name, $mime_type='')\n{\nif(!is_readable($Source_File)) die('File not found or inaccessible!');\n \n$size = filesize($Source_File);\n$Download_Name = rawurldecode($Download_Name);\n \n/* Figure out the MIME type (if not specified) */\n$known_mime_types=array(\n \"pdf\" => \"application/pdf\",\n \"csv\" => \"application/csv\",\n \"txt\" => \"text/plain\",\n \"html\" => \"text/html\",\n \"htm\" => \"text/html\",\n \"exe\" => \"application/octet-stream\",\n \"zip\" => \"application/zip\",\n \"doc\" => \"application/msword\",\n \"xls\" => \"application/vnd.ms-excel\",\n \"ppt\" => \"application/vnd.ms-powerpoint\",\n \"gif\" => \"image/gif\",\n \"png\" => \"image/png\",\n \"jpeg\"=> \"image/jpg\",\n \"jpg\" => \"image/jpg\",\n \"php\" => \"text/plain\"\n);\n \nif($mime_type==''){\n $file_extension = strtolower(substr(strrchr($Source_File,\".\"),1));\n if(array_key_exists($file_extension, $known_mime_types)){\n $mime_type=$known_mime_types[$file_extension];\n } else {\n $mime_type=\"application/force-download\";\n };\n};\n \n@ob_end_clean(); //off output buffering to decrease Server usage\n \n// if IE, otherwise Content-Disposition ignored\nif(ini_get('zlib.output_compression'))\n ini_set('zlib.output_compression', 'Off');\n \nheader('Content-Type: ' . $mime_type);\nheader('Content-Disposition: attachment; filename=\"'.$Download_Name.'\"');\nheader(\"Content-Transfer-Encoding: binary\");\nheader('Accept-Ranges: bytes');\n \nheader(\"Cache-control: private\");\nheader('Pragma: private');\nheader(\"Expires: Thu, 26 Jul 2012 05:00:00 GMT\");\n \n// multipart-download and download resuming support\nif(isset($_SERVER['HTTP_RANGE']))\n{\n list($a, $range) = explode(\"=\",$_SERVER['HTTP_RANGE'],2);\n list($range) = explode(\",\",$range,2);\n list($range, $range_end) = explode(\"-\", $range);\n $range=intval($range);\n if(!$range_end) {\n $range_end=$size-1;\n } else {\n $range_end=intval($range_end);\n }\n \n $new_length = $range_end-$range+1;\n header(\"HTTP/1.1 206 Partial Content\");\n header(\"Content-Length: $new_length\");\n header(\"Content-Range: bytes $range-$range_end/$size\");\n} else {\n $new_length=$size;\n header(\"Content-Length: \".$size);\n}\n \n/* output the file itself */\n$chunksize = 1*(1024*1024); //you may want to change this\n$bytes_send = 0;\nif ($Source_File = fopen($Source_File, 'r'))\n{\n if(isset($_SERVER['HTTP_RANGE']))\n fseek($Source_File, $range);\n \n while(!feof($Source_File) &&\n (!connection_aborted()) &&\n ($bytes_send<$new_length)\n )\n {\n $buffer = fread($Source_File, $chunksize);\n print($buffer); //echo($buffer); // is also possible\n flush();\n $bytes_send += strlen($buffer);\n }\nfclose($Source_File);\n} else die('Error - can not open file.');\n \ndie();\n}", "abstract function download($rempath, $locpath, $mode = 'auto');", "public function downloadFile($sourceUrl, $fileName)\n {\n $curl = curl_init($sourceUrl);\n\n $file = fopen($fileName, 'w');\n \n curl_setopt($curl, CURLOPT_FILE, $file);\n \n curl_exec($curl);\n \n curl_close($curl);\n \n fclose($file);\n }", "public function downloadftvAction()\n {\n $user_params=$this->_request->getParams();\n $request_id = $user_params['request_id'];\n $zipname = explode(\"/\",$user_params['filename']);\n // set example variables\n $filename = $zipname[1];\n $filepath = $request_id.\"-\".$filename;\n\n $this->_redirect(\"/BO/download_ftv.php?ftvfile=\".$filepath.\"\");\n /** Author: Thilagam **/\n /** Date:05/05/2016 **/\n /** Reason: Code optimization **/\n //$this->_redirect(\"/BO/download-files.php?function=downloadFtv&ftvfile=\".$filepath.\"\");\n\n }", "public function download()\n {\n $encrypt = $this->services['encrypt'];\n $file_name = $encrypt->decode($this->getPost('id'));\n $type = $this->getPost('type');\n $storage = $this->services['backup']->setStoragePath($this->settings['working_directory']);\n if($type == 'files')\n {\n $file = $storage->getStorage()->getFileBackupNamePath($file_name);\n }\n else\n {\n $file = $storage->getStorage()->getDbBackupNamePath($file_name);\n }\n \n \n $backup_info = $this->services['backups']->setLocations($this->settings['storage_details'])->getBackupData($file);\n $download_file_path = false;\n if( !empty($backup_info['storage_locations']) && is_array($backup_info['storage_locations']) )\n {\n foreach($backup_info['storage_locations'] AS $storage_location)\n {\n if( $storage_location['obj']->canDownload() )\n {\n $download_file_path = $storage_location['obj']->getFilePath($backup_info['file_name'], $backup_info['backup_type']); //next, get file path\n break;\n }\n }\n }\n \n if($download_file_path && file_exists($download_file_path))\n {\n $this->services['files']->fileDownload($download_file_path);\n exit;\n }\n }", "function download_file($url, $upload_path){\n\t$results = \"\";\n\t$fileArray = explode(\"/\", $url);\n\t$filename = end($fileArray);\n\t\n\n\t$code = get_http_response_code($url);\n\tif($code == 200){\n\t\texec('curl -o ' . $upload_path . $filename .' ' . $url);\n\t\tif (filesize($upload_path . $filename )>0) $results =\"$filename has been uploaded.\";\n\t\telse return $results = \"Error download file\";\n\t}\n\telse {\n\t\t$results = \"File does not exist\";\n\t}\n\n\treturn $results; \n\n}", "public static function download($fullpath,$filename,$name) {\n if (!file_exists($fullpath)) {\n return 'file is not exists';\n } else {\n $file = fopen($fullpath,\"r\"); // 打开文件\n// 输入文件标签\n $tab = pathinfo($fullpath);\n Header(\"Content-type: application/octet-stream\");\n Header(\"Accept-Ranges: bytes\");\n Header(\"Accept-Length: \".filesize($fullpath));\n Header(\"Content-Disposition: attachment; filename=\" . $name.'.'.$tab['extension']);\n// 输出文件内容\n echo fread($file,filesize($fullpath));\n fclose($file);\n return 'download finished';\n }\n }", "function downloadFile($file) { // $file = include path \n if(file_exists($file)) {\n header('Content-Description: File Transfer');\n header('Content-Type: application/octet-stream');\n header('Content-Disposition: attachment; filename=' . basename($file));\n header('Content-Transfer-Encoding: binary');\n header('Expires: 0');\n header('Cache-Control: must-revalidate, post-check=0, pre-check=0');\n header('Pragma: public');\n header('Content-Length: ' . filesize($file));\n ob_clean();\n flush();\n readfile($file);\n exit;\n }\n}", "function downloadFile($filePath)\r\n{\r\n header(\"Content-type: application/octet-stream\");\r\n header('Content-Disposition: attachment; filename=\"' . basename($filePath) . '\"');\r\n header('Content-Length: ' . filesize($filePath));\r\n readfile($filePath);\r\n}", "public function downloadAction(){\n //These are the files that are downloadable.\n $pathToDocs = RAIZ. \"/docs\";\n $param_to_file = array( \"milestone1\" => $pathToDocs . \"/milestone 1/group13-milestone1.pdf\",\n \"milestone2\" => $pathToDocs . \"/milestone 2/group13-milestone2.pdf\",\n \"milestone2-revision1\" => $pathToDocs . \"/milestone 2/group13-milestone2-comments.pdf\",\n \"milestone2-presentation\" => $pathToDocs . \"/milestone 2/group13-milestone2-presentation.pptx\");\n $file = $param_to_file[$this->_getParam('file')];\n //If we are being ask for a file that is not in the previous array, throw an Exception.\n if(is_null($file)){\n throw new Exception(\"Unknown file\");\n }\n //Disable view and layout\n $this->_helper->layout()->disableLayout();\n $this->_helper->viewRenderer->setNoRender(true);\n //The file is in the previous array. So, fetch it and force the download.\n if (file_exists($file) && is_file($file)) {\n header('Content-Description: File Transfer');\n header('Content-Type: application/octet-stream');\n header('Content-Disposition: attachment; filename='.basename($file));\n header('Content-Transfer-Encoding: binary');\n header('Expires: 0');\n header('Cache-Control: must-revalidate, post-check=0, pre-check=0');\n header('Pragma: public');\n header('Content-Length: ' . filesize($file));\n ob_clean();\n flush();\n readfile($file);\n exit;\n }else{\n echo \"<pre style='color:red'>The file does not exists</pre>\";\n } \n }", "public function download(string $url);", "function tdc_send_file($file_path, $file_name){\n if (file_exists($file_path.\"/\".$file_name)) {\n header($_SERVER[\"SERVER_PROTOCOL\"] . \" 200 OK\");\n header(\"Cache-Control: public\"); // needed for i.e.\n header(\"Content-Type: application/zip\");\n header(\"Content-Transfer-Encoding: Binary\");\n header(\"Content-Length:\".filesize($file_path.\"/\".$file_name));\n header(\"Content-Disposition: attachment; filename=\".$file_name);\n readfile($file_path.\"/\".$file_name);\n return True;\n }\n}", "function downloadFile($strPathFileName)\n\t{\n\t\t$s_file_name = \"\";\n\t\tif (file_exists($strPathFileName))\n\t\t{\n\t\t\t$s_file_name = substr($strPathFileName, strrpos($strPathFileName, \"/\")+1);\n\t\t}\n\t\treturn $this->downloadFileRenameFile($strPathFileName, $s_file_name);\n\t}", "public function run()\r\r\n\t{\r\r\n\t\t// Make sure there are no attempts to hack the file system\r\r\n\t\tif (preg_match('@^\\.+@i', $this->strFile) || preg_match('@\\.+/@i', $this->strFile) || preg_match('@(://)+@i', $this->strFile))\r\r\n\t\t{\r\r\n\t\t\theader('HTTP/1.0 404 Not Found');\r\r\n\t\t\tdie('Invalid file name');\r\r\n\t\t}\r\r\n\r\r\n\t\t// Limit downloads to the tl_files directory\r\r\n\t\tif (!preg_match('@^' . preg_quote($GLOBALS['TL_CONFIG']['uploadPath'], '@') . '@i', $this->strFile))\r\r\n\t\t{\r\r\n\t\t\theader('HTTP/1.0 404 Not Found');\r\r\n\t\t\tdie('Invalid path');\r\r\n\t\t}\r\r\n\r\r\n\t\t// Check whether the file exists\r\r\n\t\tif (!file_exists(TL_ROOT . '/' . $this->strFile))\r\r\n\t\t{\r\r\n\t\t\theader('HTTP/1.0 404 Not Found');\r\r\n\t\t\tdie('File not found');\r\r\n\t\t}\r\r\n\r\r\n\t\t// Die if there is no token or if the tokens do not match\r\r\n\t\tif (!strlen($this->Input->get('token')) || !is_array($_SESSION['downloadToken']) || !in_array($this->Input->get('token'), $_SESSION['downloadToken']))\r\r\n\t\t{\r\r\n\t\t\theader('HTTP/1.0 403 Forbidden');\r\r\n\t\t\tdie('Invalid download token');\r\r\n\t\t}\r\r\n\r\r\n\t\t// Die if the file is not allowed\r\r\n\t\tif (!is_array($_SESSION['downloadFiles']) || !in_array($this->strFile, $_SESSION['downloadFiles']) || !preg_match('/^' . preg_quote($GLOBALS['TL_CONFIG']['uploadPath'], '/') . '\\//i', $this->strFile))\r\r\n\t\t{\r\r\n\t\t\theader('HTTP/1.0 403 Forbidden');\r\r\n\t\t\tdie(sprintf('Download of file \"%s\" is not allowed', $this->strFile));\r\r\n\t\t}\r\r\n\r\r\n\t\t$objFile = new File($this->strFile);\r\r\n\t\t$arrAllowedTypes = trimsplit(',', strtolower($GLOBALS['TL_CONFIG']['allowedDownload']));\r\r\n\r\r\n\t\tif (!in_array($objFile->extension, $arrAllowedTypes))\r\r\n\t\t{\r\r\n\t\t\theader('HTTP/1.0 403 Forbidden');\r\r\n\t\t\tdie(sprintf('File type \"%s\" is not allowed', $objFile->extension));\r\r\n\t\t}\r\r\n\r\r\n\t\t// Open the \"save as...\" dialogue\r\r\n\t\theader('Content-Type: ' . $objFile->mime);\r\r\n\t\theader('Content-Transfer-Encoding: binary');\r\r\n\t\theader('Content-Disposition: attachment; filename=\"'.$objFile->basename.'\"');\r\r\n\t\theader('Content-Length: '.$objFile->filesize);\r\r\n\t\theader('Cache-Control: must-revalidate, post-check=0, pre-check=0'); \r\r\n\t\theader('Pragma: public');\r\r\n\t\theader('Expires: 0');\r\r\n\r\r\n\t\t$resFile = fopen(TL_ROOT . '/' . $this->strFile, 'rb');\r\r\n\t\tfpassthru($resFile);\r\r\n\t\tfclose($resFile);\r\r\n\r\r\n\t\t// HOOK: post download callback\r\r\n\t\tif (array_key_exists('postDownload', $GLOBALS['TL_HOOKS']) && is_array($GLOBALS['TL_HOOKS']['postDownload']))\r\r\n\t\t{\r\r\n\t\t\tforeach ($GLOBALS['TL_HOOKS']['postDownload'] as $callback)\r\r\n\t\t\t{\r\r\n\t\t\t\t$this->import($callback[0]);\r\r\n\t\t\t\t$this->$callback[0]->$callback[1]($this->strFile);\r\r\n\t\t\t}\r\r\n\t\t}\r\r\n\t}", "public function downloadReport($filename);", "public function download() {\n $this->autoRender = false;\n $filename = $this->request->params['pass'][3];\n $orgfilename = $this->request->params['pass'][4];\n// pr($this->request->params); exit;\n $this->response->file(\n 'webroot/uploads/post/files/' . $filename, array(\n 'download' => true,\n 'name' => $orgfilename\n )\n );\n// return $this->response;\n }", "public function download_file($path = '', $filename = '')\n {\n if ($path != '' && $filename != '')\n {\n $file = $path . '/' . $filename;\n $finfo = finfo_open(FILEINFO_MIME_TYPE);\n $file_mime_type = finfo_file($finfo, $file);\n $len = filesize($file); // Calculate File Size \n ob_clean();\n ob_start();\n if (headers_sent())\n {\n echo 'HTTP header already sent';\n }\n else if (!is_readable($file))\n {\n header($_SERVER['SERVER_PROTOCOL'] . ' 403 Forbidden');\n echo 'File not readable';\n }\n else\n {\n header(\"Pragma: public\");\n header(\"Expires: 0\");\n header(\"Cache-Control: must-revalidate, post-check=0, pre-check=0\");\n header(\"Cache-Control: public\");\n header(\"Content-Description: File Transfer\");\n header(\"Content-Type:pplication/octet-stream\"); // Send type of file\n $header = \"Content-Disposition: attachment; filename=$filename;\"; // Send File Name\n header($header);\n header(\"Content-Transfer-Encoding: binary\");\n header(\"Content-Length: \" . $len); // Send File Size \n readfile($file);\n }\n }\n }", "abstract protected function checkIsValidDownloadedFile(string $source, string $localpath): void;", "public static function getHttpFile($file, $pr_transfer = null) {\n\t\ttry{\n\t \tif(!self::remoteFileExists($file)) {\n\t \t\treturn 'The file does not exists ...';\n\t \t}\n\n\t\t\tif(!isset($pr_transfer)) {\n\t\t\t\t$fileinfo = pathinfo($file);\n\t\t\t}else{\n\t\t\t\t$fileinfo = pathinfo($pr_transfer);\n\t\t\t}\n\t\t\t$filename = (strstr($_SERVER['HTTP_USER_AGENT'], 'MSIE')) ? preg_replace('/\\./', '%2e', $fileinfo['basename'], substr_count($fileinfo['basename'], '.') - 1) : $fileinfo['basename'];\n\n\t\t\tif(strpos($filename, 'rsapi.cgi')) {\n\t\t\t\t$filename = substr($filename, 0, strpos($filename, '&'));\n\t\t\t}\n\n\t\t\tif(OC_Filesystem::file_exists('/Downloads/' . $filename)) {\n\t\t\t\t$filename = md5(rand()) . '_' . $filename;\n\t\t\t}\n\t\t\t$fs = OC_Filesystem::fopen('/Downloads/' . $filename, 'w');\n\n\t\t\t$size = self::getRemoteFileSize($file);\n\t\t\tif($size == 0) {\n\t\t\t\treturn 'Error ! Null file size.';\n\t\t\t}\n\n\t\t switch(strtolower($fileinfo['extension'])) {\n\t\t case 'exe': $ctype = 'application/octet-stream'; break;\n\t\t case 'zip': $ctype = 'application/zip'; break;\n\t\t case 'mp3': $ctype = 'audio/mpeg'; break;\n\t\t case 'mpg': $ctype = 'video/mpeg'; break;\n\t\t case 'avi': $ctype = 'video/x-msvideo'; break;\n\t\t\t\tcase 'png': $ctype = 'image/png'; break;\n\t\t default: $ctype = 'application/force-download';\n\t\t }\n\n\t\t $seek_end = (empty($seek_end)) ? ($size - 1) : min(abs(intval($seek_end)),($size - 1));\n\t\t $seek_start = (empty($seek_start) || $seek_end < abs(intval($seek_start))) ? 0 : max(abs(intval($seek_start)),0);\n\n\t\t /*header(\"Cache-Control: cache, must-revalidate\");\n\t\t header(\"Pragma: public\");\n\t\t header('Content-Type: ' . $ctype);\n\t\t header('Content-Disposition: attachment; filename=\"' . $filename . '\"');\n\t\t header('Content-Length: ' . ($seek_end - $seek_start + 1));*/\n\n\t\t $fp = fopen($file, 'rb');\n\t\t\tset_time_limit(0);\n\t\t while(!feof($fp)) {\n\t\t $data = fread($fp, 1024*8);\n\t\t if($data == '') {\n\t\t \tbreak;\n\t\t }\n\t\t\t\tfwrite($fs, $data);\n\t\t }\n\n\t\t fclose($fp);\n\t\t\tfclose($fs);\n\n\t\t\treturn Array('ok' => 'Transfer completed successfully. The file has been moved in your Downloads folder.');\n\t\t}catch(exception $e) {\n\t\t\treturn Array('error' => $e->getMessage());\n\t\t}\n\t}", "function downloadFile($file, $name, $mime_type='')\n{\n /*\n This function takes a path to a file to output ($file), the filename that the browser will see ($name) and the MIME type of the file ($mime_type, optional).\n */\n \n //Check the file premission\n if(!is_readable($file)) die('File not found or inaccessible!');\n \n $size = filesize($file);\n $name = rawurldecode($name);\n \n /* Figure out the MIME type | Check in array */\n $known_mime_types=array(\n \t\"pdf\" => \"application/pdf\",\n \t\"txt\" => \"text/plain\",\n \t\"html\" => \"text/html\",\n \t\"htm\" => \"text/html\",\n\t\"exe\" => \"application/octet-stream\",\n\t\"zip\" => \"application/zip\",\n\t\"doc\" => \"application/msword\",\n\t\"xls\" => \"application/vnd.ms-excel\",\n\t\"ppt\" => \"application/vnd.ms-powerpoint\",\n\t\"gif\" => \"image/gif\",\n\t\"png\" => \"image/png\",\n\t\"jpeg\"=> \"image/jpg\",\n\t\"jpg\" => \"image/jpg\",\n\t\"php\" => \"text/plain\"\n );\n \n if($mime_type==''){\n\t $file_extension = strtolower(substr(strrchr($file,\".\"),1));\n\t if(array_key_exists($file_extension, $known_mime_types)){\n\t\t$mime_type=$known_mime_types[$file_extension];\n\t } else {\n\t\t$mime_type=\"application/force-download\";\n\t }\n }\n \n //turn off output buffering to decrease cpu usage\n @ob_end_clean(); \n \n // required for IE, otherwise Content-Disposition may be ignored\n if(ini_get('zlib.output_compression'))\n ini_set('zlib.output_compression', 'Off');\n \n header('Content-Type: ' . $mime_type);\n header('Content-Disposition: attachment; filename=\"'.$name.'\"');\n header(\"Content-Transfer-Encoding: binary\");\n header('Accept-Ranges: bytes');\n \n /* The three lines below basically make the \n download non-cacheable */\n header(\"Cache-control: private\");\n header('Pragma: private');\n header(\"Expires: Mon, 26 Jul 1997 05:00:00 GMT\");\n \n // multipart-download and download resuming support\n if(isset($_SERVER['HTTP_RANGE']))\n {\n\tlist($a, $range) = explode(\"=\",$_SERVER['HTTP_RANGE'],2);\n\tlist($range) = explode(\",\",$range,2);\n\tlist($range, $range_end) = explode(\"-\", $range);\n\t$range=intval($range);\n\tif(!$range_end) {\n\t\t$range_end=$size-1;\n\t} else {\n\t\t$range_end=intval($range_end);\n\t}\n\t/*\n\t------------------------------------------------------------------------------------------------------\n\t//This application is developed by www.webinfopedia.com\n\t//visit www.webinfopedia.com for PHP,Mysql,html5 and Designing tutorials for FREE!!!\n\t------------------------------------------------------------------------------------------------------\n \t*/\n\t$new_length = $range_end-$range+1;\n\theader(\"HTTP/1.1 206 Partial Content\");\n\theader(\"Content-Length: $new_length\");\n\theader(\"Content-Range: bytes $range-$range_end/$size\");\n } else {\n\t$new_length=$size;\n\theader(\"Content-Length: \".$size);\n }\n \n /* Will output the file itself */\n $chunksize = 1*(1024*1024); //you may want to change this\n $bytes_send = 0;\n if ($file = fopen($file, 'r'))\n {\n\tif(isset($_SERVER['HTTP_RANGE']))\n\tfseek($file, $range);\n \n\twhile(!feof($file) && \n\t\t(!connection_aborted()) && \n\t\t($bytes_send<$new_length)\n\t )\n\t{\n\t\t$buffer = fread($file, $chunksize);\n\t\tprint($buffer); //echo($buffer); // can also possible\n\t\tflush();\n\t\t$bytes_send += strlen($buffer);\n\t}\n fclose($file);\n } else\n //If no permissiion\n die('Error - can not open file.');\n //die\ndie();\n}", "public function actionDownloadBackupFile()\n\t{\n\t\t$fileName = craft()->request->getRequiredQuery('fileName');\n\n\t\tif (($filePath = IOHelper::fileExists(craft()->path->getTempPath().$fileName.'.zip')) == true)\n\t\t{\n\t\t\tcraft()->request->sendFile(IOHelper::getFileName($filePath), IOHelper::getFileContents($filePath), array('forceDownload' => true));\n\t\t}\n\t}", "function downloadFile( $fullPath ){\r\n if( headers_sent() ) \r\n die('Headers Sent'); \r\n\r\n // Required for some browsers \r\n if(ini_get('zlib.output_compression')) \r\n ini_set('zlib.output_compression', 'Off'); \r\n\r\n // File Exists? \r\n if( file_exists($fullPath) ){ \r\n \r\n // Parse Info / Get Extension \r\n $fsize = filesize($fullPath); \r\n $path_parts = pathinfo($fullPath); \r\n $ext = strtolower($path_parts[\"extension\"]); \r\n \r\n // Determine Content Type \r\n switch ($ext) { \r\n case \"pdf\": $ctype=\"application/pdf\"; break; \r\n case \"exe\": $ctype=\"application/octet-stream\"; break; \r\n case \"zip\": $ctype=\"application/zip\"; break; \r\n case \"doc\": $ctype=\"application/msword\"; break; \r\n case \"xls\": $ctype=\"application/vnd.ms-excel\"; break; \r\n case \"ppt\": $ctype=\"application/vnd.ms-powerpoint\"; break; \r\n case \"gif\": $ctype=\"image/gif\"; break; \r\n case \"png\": $ctype=\"image/png\"; break; \r\n case \"jpeg\": \r\n case \"jpg\": $ctype=\"image/jpg\"; break; \r\n default: $ctype=\"application/force-download\"; \r\n } \r\n\r\n header(\"Pragma: public\"); // required \r\n header(\"Expires: 0\"); \r\n header(\"Cache-Control: must-revalidate, post-check=0, pre-check=0\"); \r\n header(\"Cache-Control: private\",false); // required for certain browsers \r\n header(\"Content-Type: $ctype\"); \r\n header(\"Content-Disposition: attachment; filename=\\\"\".basename($fullPath).\"\\\";\" ); \r\n header(\"Content-Transfer-Encoding: binary\"); \r\n header(\"Content-Length: \".$fsize); \r\n ob_clean(); \r\n flush(); \r\n readfile( $fullPath ); \r\n\r\n } else \r\n die('File Not Found'); \r\n\r\n}", "public function downloadpresskitveue($file_name)\n {\n // echo $file_name;die;\n $filennmdownload = base64_decode($file_name);\n // echo $filennm;die;\n //********its working for single file\n $download_path = ( public_path() . '/upload/venue-press-kit/source-file/' . $filennmdownload );\n return( Response::download( $download_path ) );\n \n }", "function getTargetFile() ;", "function instant_download($product_id, $ftype=null) {\n \n if (!$filetype = GetReq('filetype'))\n $filetype = $ftype ? $ftype : $this->ftype;\n \n \t //extra security set form must be filled as session param\n\t //to prevent cmd instant download without it.\n\t if ((GetSessionParam('FORMSUBMITED')) || GetSessionParam(\"CODESUBMITED\")) {\t \n \n $file = $this->wherethefileis . $product_id . $this->file_epithema . $filetype;\t \n\t //$file = \"c:\\\\php\\\\webos2\\\\projects\\\\re-coding-official\\\\demo\\\\delphi2java_shareware.zip\";\n\t //echo \"DOWNLOAD:\",$file;\n\t //die();\n $downloadfile = new DOWNLOADFILE($file);\n\t \n /*$this->tell_by_mail(\"demo file downloaded\",\n\t 'support@re-coding.com',\n\t\t 'billy@re-coding.com',\n\t\t\t\t\t\t $file);\t\n\t\t\t\t\t\t \n $this->tell_by_sms(\"$product_id demo file downloaded.\");*/\t\n\t\t \n\t //inform bt mail and sms\n\t $this->send_downloaded_mail($product_id);\t\t\t\t\t \n\t \n if (!$downloadfile->df_download()) {\n\t //echo \"Sorry, we are experiencing technical difficulties downloading this file. Please report this error to Technical Support.\";\t \t \n\t\t$m = paramload('RCDOWNLOAD','error');\t\n\t\t$ff = $this->prpath.$m;\n\t\tif (is_file($ff)) {\n\t\t $ret = file_get_contents($ff);\n\t\t}\n\t\telse\n\t\t $ret = $m; //plain text\t\t \n\t }\n\t //else\n\t // $ret = \"OK\";\t\n\t }\n\t else\n\t $ret = \"Prohibited area!\"; \n\t\t \t \n\t return ($ret);\n\t \n\t \n\t //use download2.lib\n\t //$dFile = new Download_file($this->prpath . paramload('RCDOWNLOAD','dirsource') , $product_id . $this->ftype);\n }", "function put_file_from_url($sourceUrl, $folderId, $filename){\n\n\t\t$r2s = skydrive_base_url.$folderId.\"/files/\".$filename.\"?access_token=\".$this->access_token;\n\n\t\t\n\n\t\t$chunkSizeBytes = 1 * 1024 * 1024; //1MB\n\n\t\t\n\n\t\t//download file first to tempfile\n\n\t\t$tempFilename = tempnam(\"/tmp\", \"UPLOAD\");\n\n\t\t$temp = fopen($tempFilename, \"w\");\n\n\t\t\n\n\t\t$handle = @fopen($sourceUrl, \"rb\");\n\n\t\tif($handle === FALSE){\n\n\t\t\tthrow new Exception(\"Unable to download file from \" . $sourceUrl);\n\n\t\t}\n\n\t\t\n\n\t\twhile (!feof($handle)) {\n\n\t\t\t$chunk = fread($handle, $chunkSizeBytes);\n\n\t\t\tfwrite($temp, $chunk);\n\n\t\t}\t\t\n\n\t\t\n\n\t\tfclose($handle);\n\n\t\tfclose($temp);\n\n\t\t\n\n\t\t//upload to OneDrive\n\n\t\t$response = $this->curl_put($r2s, $tempFilename);\n\n\t\tif (@array_key_exists('error', $response)) {\n\n\t\t\tthrow new Exception($response['error'].\" - \".$response['description']);\n\n\t\t\texit;\n\n\t\t} else {\n\n\t\t\tunlink($tempFilename);\n\n\t\t\treturn $response;\n\n\t\t}\n\n\t}", "public function download(){\n\t\t$lang = \"En\";\n\t\tif (isset ( $_SESSION [\"user_settings\"] [\"language\"] )) {\n\t\t\t$lang = $_SESSION [\"user_settings\"] [\"language\"];\n\t\t}\n\t\t\n\t\t// get form posts\n\t\t$localurl = $this->request->getParameter(\"localurl\");\n\t\t$filename = $this->request->getParameter(\"filename\");\n\t\t\n\t\t// get the user login\n\t\t$idUser = $_SESSION[\"id_user\"];\n\t\t$modelUser = new User();\n\t\t$userlogin = $modelUser->userLogin($idUser);\n\t\t\n\t\t// parse the files names\n\t\t$filename = str_replace(\"__--__\", \".\", $filename);\n\t\t$filename = str_replace(\"__---__\", \" \", $filename);\n\t\t$filename = str_replace(\"__----__\", \"/\", $filename);\n\t\t$localurl = str_replace(\"\\\\\", \"/\" , $localurl) . \"/\" . basename($filename);\n\t\t$fileName = \"./\" . $userlogin .\"/\".basename($filename);\n\t\t\n\t\t// refuse to download if the quotas is over\n\t\t$modelQuotas = new StUserQuota();\n\t\t$userQuotas = $modelQuotas->getQuota($idUser); // in GB\n\t\t$modelUploader = new StUploader();\n\t\t$usage = $modelUploader->getUsage($userlogin);\n\t\t$usage = $usage/1000000000; \n\t\t\n\t\tif ($usage >= $userQuotas){\n\t\t\t$this->index( StTranslator::QuotasHoverMessage($lang) . $localurl);\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t// download\n\t\t$modelFiles = new StUploader();\n\t\t$modelFiles->downloadFile($localurl, $fileName);\n\t\t\n\t\t\n\t\t// view\n\t\t$this->index( StTranslator::DownloadMessage($lang) . $localurl);\n\t\treturn;\n\t}", "function download_file($path, $type = 'application/octet-stream', $name = '', $force_download = false) {\n if(!is_readable($path)) {\n return false;\n } // if\n \n $filename = trim($name) == '' ? basename($path) : trim($name);\n return download_contents(file_get_contents($path), $type, $filename, filesize($path), $force_download);\n }", "function downloadFile($folder,$fielname) {\n\t\t$this->autoLayout = false;\n\t\t$newFileName = $fielname;\n\t\t$folder = str_replace('-','/',$folder);\n\t\t//Replace - to / to view subfolder\n\t $path = WWW_ROOT.$folder.'/'.$fielname;\n\t\tif(file_exists($path) && is_file($path)) {\t\n\t\t\t$mimeContentType = 'application/octet-stream';\n\t\t\t$temMimeContentType = $this->_getMimeType($path); \n\t\t\tif(isset($temMimeContentType) && !empty($temMimeContentType))\t{ \n\t\t\t\t\t\t\t$mimeContentType = $temMimeContentType;\n\t\t\t}\n\t\n\t\t\t// START ANDR SILVA DOWNLOAD CODE\n\t\t\t// required for IE, otherwise Content-disposition is ignored\n\t\t\tif(ini_get('zlib.output_compression'))\n\t\t\t \tini_set('zlib.output_compression', 'Off');\n\t\t\theader(\"Pragma: public\"); // required\n\t\t\theader(\"Expires: 0\");\n\t\t\theader(\"Cache-Control: must-revalidate, post-check=0, pre-check=0\");\n\t\t\theader(\"Cache-Control: private\",false); // required for certain browsers\n\t\t\theader(\"Content-Type: \" . $mimeContentType );\n\t\t\t// change, added quotes to allow spaces in filenames, by Rajkumar Singh\n\t\t\theader(\"Content-Disposition: attachment; filename=\\\"\".(is_null($newFileName)?basename($path):$newFileName).\"\\\";\" );\n\t\t\theader(\"Content-Transfer-Encoding: binary\");\n\t\t\theader(\"Content-Length: \".filesize($path));\n\t\t\treadfile($path);\n\t\t\texit();\n\t\t\t// END ANDR SILVA DOWNLOAD CODE\n\t\t }\n\t\t if(isset($_SERVER['HTTP_REFERER'])) {\n\t\t \t $this->Session->setFlash('File not found.');\n\t\t\t $this->redirect($_SERVER['HTTP_REFERER']);\n\t\t }\n \t}", "function downloadFile($filename, $downloadPath)\n{\n App::set_response_header('Content-Type', 'text/plain');\n App::set_response_header('Pragma', 'no-cache');\n App::set_response_header(\n 'Content-Disposition',\n \"attachment; filename={$filename}\"\n );\n readfile($downloadPath);\n}", "public function downloadFile($file, $name, $mime_type='') {\n if(!is_readable($file)) throw new Exception('File not found or inaccessible! ['.$file.']');\n\n $size = filesize($file);\n $name = rawurldecode($name);\n\n /* Figure out the MIME type (if not specified) */\n $known_mime_types=array(\n \"pdf\" => \"application/pdf\",\n \"txt\" => \"text/plain\",\n \"html\" => \"text/html\",\n \"htm\" => \"text/html\",\n \"exe\" => \"application/octet-stream\",\n \"zip\" => \"application/zip\",\n \"doc\" => \"application/msword\",\n \"xls\" => \"application/vnd.ms-excel\",\n \"ppt\" => \"application/vnd.ms-powerpoint\",\n \"gif\" => \"image/gif\",\n \"png\" => \"image/png\",\n \"jpeg\"=> \"image/jpg\",\n \"jpg\" => \"image/jpg\",\n \"php\" => \"text/plain\"\n );\n\n if($mime_type==''){\n $file_extension = strtolower(substr(strrchr($name,\".\"),1));\n if (array_key_exists($file_extension, $known_mime_types)) {\n $mime_type=$known_mime_types[$file_extension];\n }\n else {\n $mime_type=\"application/force-download\";\n };\n };\n\n @ob_end_clean(); //turn off output buffering to decrease cpu usage\n\n // required for IE, otherwise Content-Disposition may be ignored\n if(ini_get('zlib.output_compression'))\n ini_set('zlib.output_compression', 'Off');\n\n header('Content-Type: ' . $mime_type);\n header('Content-Disposition: attachment; filename=\"'.$name.'\"');\n header(\"Content-Transfer-Encoding: binary\");\n header('Accept-Ranges: bytes');\n\n /* The three lines below basically make the\n download non-cacheable */\n header(\"Cache-control: private\");\n header('Pragma: private');\n header(\"Expires: Mon, 26 Jul 1997 05:00:00 GMT\");\n\n // multipart-download and download resuming support\n if(isset($_SERVER['HTTP_RANGE'])) {\n list($a, $range) = explode(\"=\",$_SERVER['HTTP_RANGE'],2);\n list($range) = explode(\",\",$range,2);\n list($range, $range_end) = explode(\"-\", $range);\n $range=intval($range);\n if (!$range_end) {\n $range_end=$size-1;\n }\n else {\n $range_end=intval($range_end);\n }\n\n $new_length = $range_end-$range+1;\n header(\"HTTP/1.1 206 Partial Content\");\n header(\"Content-Length: $new_length\");\n header(\"Content-Range: bytes $range-$range_end/$size\");\n }\n else {\n $new_length=$size;\n header(\"Content-Length: \".$size);\n }\n\n /* output the file itself */\n $chunksize = 1*(1024*1024); //you may want to change this\n $bytes_send = 0;\n if ($file = fopen($file, 'r')) {\n if(isset($_SERVER['HTTP_RANGE'])) fseek($file, $range);\n\n while(!feof($file) && (!connection_aborted()) && ($bytes_send<$new_length)) {\n $buffer = fread($file, $chunksize);\n print($buffer); //echo($buffer); // is also possible\n flush();\n $bytes_send += strlen($buffer);\n }\n fclose($file);\n }\n else die('Error - can not open file.');\n\n die();\n }", "function urldl(){\n\n // folder to save downloaded files to. must end with slash\n $destination_folder = 'downloads/';\n\n $url = $_POST['url'];\n $newfname = $destination_folder . basename($url);\n\n $file = fopen ($url, \"rb\");\n if ($file) {\n $newf = fopen ($newfname, \"wb\");\n\n if ($newf)\n while(!feof($file)) {\n fwrite($newf, fread($file, 1024 * 8 ), 1024 * 8 );\n }\n }\n\n if ($file) {\n fclose($file);\n }\n\n if ($newf) {\n fclose($newf);\n }\n\n}", "function download($file = \"\") {\n\t\t// Set maximum execution time in seconds (0 means no limit).\n\n\t\tset_time_limit(0);\n\t\t\n\t\t// Check downloader is admin or manager\n\t\tif(!empty($file)) {\n\t\t\t$file = SITE_DIR.\"public\".base64_decode($file);\n\n\t\t\t$this->output_file($file);\n\t\t} else\n\t\t\t$this->download_forbidden();\n\t\texit;\n\t}", "function http_send_file($file) {}", "function downloadFile($url, $output)\n{\n $readableStream = fopen($url, 'rb');\n if ($readableStream === false) {\n throw new Exception(\"Something went wrong while fetching \" . $url);\n }\n $writableStream = fopen($output, 'wb');\n\n stream_copy_to_stream($readableStream, $writableStream);\n\n fclose($writableStream);\n}", "function downloadFile($folder,$filename) {\n\t\t$this->autoLayout = false;\n\t\t$newFileName = $filename;\n\t\t$folder = str_replace('-','/',$folder);\n\t\t//Replace - to / to view subfolder\n\t $path = WWW_ROOT.$folder.'/'.$filename;\n\t\tif(file_exists($path) && is_file($path)) {\n\t\t\t$mimeContentType = 'application/octet-stream';\n\t\t\t$temMimeContentType = $this->_getMimeType($path);\n\t\t\tif(isset($temMimeContentType) && !empty($temMimeContentType))\t{\n\t\t\t\t\t\t\t$mimeContentType = $temMimeContentType;\n\t\t\t}\n\t\t //echo 'sssssssssss--->' . $mimeContentType;\t\t exit;\n\t\t\t// START ANDR SILVA DOWNLOAD CODE\n\t\t\t// required for IE, otherwise Content-disposition is ignored\n\t\t\tif(ini_get('zlib.output_compression'))\n\t\t\t \tini_set('zlib.output_compression', 'Off');\n\t\t\theader(\"Pragma: public\"); // required\n\t\t\theader(\"Expires: 0\");\n\t\t\theader(\"Cache-Control: must-revalidate, post-check=0, pre-check=0\");\n\t\t\theader(\"Cache-Control: private\",false); // required for certain browsers \n\t\t\theader(\"Content-Type: \" . $mimeContentType );\n\t\t\t// change, added quotes to allow spaces in filenames, by Rajkumar Singh\n\t\t\theader(\"Content-Disposition: attachment; filename=\\\"\".(is_null($newFileName)?basename($path):$newFileName).\"\\\";\" );\n\t\t\theader(\"Content-Transfer-Encoding: binary\");\n\t\t\theader(\"Content-Length: \".filesize($path));\n\t\t\treadfile($path);\n\t\t\texit();\n\t\t\t// END ANDR SILVA DOWNLOAD CODE\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t }\n\t\t if(isset($_SERVER['HTTP_REFERER'])) {\n\t\t \t $this->Session->setFlash('File not found.');\n\t\t\t $this->redirect($_SERVER['HTTP_REFERER']);\n\t\t }\t \n \t}", "function download_file(string $filename, string $root_path = '/cloud'): void {\n\tif (!file_exists($filename))\n\t\tthrow new InvalidArgumentException('The file \"' . basename($filename) . '\" does not exist.');\n\tif (!Common::isAuthorizedPath($filename, $root_path))\n\t\tthrow new InvalidArgumentException('The file \"' . basename($filename) . '\" is invalid.');\n\n\t// get file info\n\t$content_type = mime_content_type($filename);\n\t$basename = basename($filename);\n\t$content_length = filesize($filename);\n\n\t// set headers\n\theader(\"Content-Type: $content_type\");\n\theader(\"Content-Disposition: attachment; filename=\\\"$basename\\\"\");\n\theader(\"Content-Length: $content_length\");\n\n\t// clear buffer and flush headers\n\tob_clean();\n\tflush();\n\n\t// output file contents\n\treadfile($filename);\n}", "public function startDownload() {\n if (!isset($this->destPath) || !isset($this->filePath)) {\n throw new SFException( 'No file path or name given. Use setPaths()', ERR_REPORT_APP );\n }\n\n $this->callMethod( 'startDownload', array( $this->destPath, $this->destPathRelativeToTmp ) );\n }", "function downloadFromFile($file, $name = '') {\n\t\t$result['output'] = array();\n\t\t$result['status'] = false;\n\t\treturn $result;\n\t}", "public function download_move($file, $local_file);", "public function downloadFiles()\r\n {\r\n // check permission\r\n $this->_check_group_permission();\r\n\r\n $access_full_path = $this->_get_access_full_path();\r\n $filenames = $this->input->get_post('filenames');\r\n $filenames_arr = json_decode($filenames);\r\n $targetname = $this->input->get_post('targetname');\r\n\r\n // insert userlog\r\n $gid = $this->input->get_post('gid');\r\n if (substr($gid, 0, 1) === 's')\r\n {\r\n $b36_sid = substr($gid, 1);\r\n $share = $this->login->get_share_access($b36_sid);\r\n $gid = $share['gid'];\r\n $folder_name = $share['name'];\r\n }\r\n else\r\n {\r\n $folder_name = $this->login->get_group_name($gid);\r\n }\r\n if (count($filenames_arr) == 1)\r\n {\r\n $fileinode = $this->files_model->fileinode($access_full_path .'/'. $filenames_arr[0]);\r\n $target = str_replace('/'. $folder_name, '', $access_full_path, $cnt = 1) .'/'. $filenames_arr[0];\r\n $details = '';\r\n }\r\n else\r\n {\r\n $fileinode = 0;\r\n $target = $this->files_model->get_utf8_basename($access_full_path) . '.zip';\r\n $details = $filenames;\r\n }\r\n $user = $this->login->get_user();\r\n $this->userlog_model->insert(\r\n $user['id'],\r\n $user['name'],\r\n Userlog_model::FILE_DOWNLOAD,\r\n $gid,\r\n $folder_name,\r\n $fileinode,\r\n $target,\r\n $details\r\n );\r\n\r\n $this->files_model->download_files($access_full_path, $filenames_arr, $targetname);\r\n }", "function ft_hook_download($dir, $file) {}", "public function download(string $file, string $name = ''): PsrResponseInterface;", "public function Download(){\n\t\t\n\t\t\n\t}", "private function _downloadFile($destinationPath, $imageUrl)\n {\n // url encode filename to account for non-ascii characters in filenames.\n $imageUrlArr = explode('?', $imageUrl);\n \n $imageUrlArr[0] = preg_replace_callback('#://([^/]+)/([^?]+)#', function ($match) {\n return '://' . $match[1] . '/' . implode('/', array_map('rawurlencode', explode('/', $match[2])));\n }, urldecode($imageUrlArr[0]));\n \n $imageUrl = implode('?', $imageUrlArr);\n\n if (function_exists('curl_init')) {\n $ch = curl_init($imageUrl);\n $fp = fopen($destinationPath, \"wb\");\n\n $defaultOptions = array(\n CURLOPT_FILE => $fp,\n CURLOPT_HEADER => 0,\n CURLOPT_FOLLOWLOCATION => 1,\n CURLOPT_TIMEOUT => 30\n );\n\n // merge default options with config setting, config overrides default.\n $options = craft()->imager->getSetting('curlOptions') + $defaultOptions;\n\n curl_setopt_array($ch, $options);\n curl_exec($ch);\n $curlErrorNo = curl_errno($ch);\n $curlError = curl_error($ch);\n $httpStatus = intval(curl_getinfo($ch, CURLINFO_HTTP_CODE));\n curl_close($ch);\n fclose($fp);\n\n if ($curlErrorNo !== 0) {\n unlink($destinationPath);\n $msg = Craft::t('cURL error “{curlErrorNo}” encountered while attempting to download “{imageUrl}”. The error was: “{curlError}”', array('imageUrl' => $imageUrl, 'curlErrorNo' => $curlErrorNo, 'curlError' => $curlError));\n \n if (craft()->imager->getSetting('suppressExceptions')===true) {\n ImagerPlugin::log($msg, LogLevel::Error);\n return null;\n } else {\n throw new Exception($msg);\n }\n }\n\n if ($httpStatus !== 200) {\n if (!($httpStatus == 404 && strrpos(mime_content_type($destinationPath), 'image') !== false)) { // remote server returned a 404, but the contents was a valid image file\n unlink($destinationPath);\n $msg = Craft::t('HTTP status “{httpStatus}” encountered while attempting to download “{imageUrl}”', array('imageUrl' => $imageUrl, 'httpStatus' => $httpStatus));\n \n if (craft()->imager->getSetting('suppressExceptions')===true) {\n ImagerPlugin::log($msg, LogLevel::Error);\n return null;\n } else {\n throw new Exception($msg);\n }\n }\n }\n } elseif (ini_get('allow_url_fopen')) {\n if (!@file_put_contents($destinationPath, file_get_contents($imageUrl))) {\n unlink($destinationPath);\n $httpStatus = $http_response_header[0];\n $msg = Craft::t('“{httpStatus}” encountered while attempting to download “{imageUrl}”', array('imageUrl' => $imageUrl, 'httpStatus' => $httpStatus));\n \n if (craft()->imager->getSetting('suppressExceptions')===true) {\n ImagerPlugin::log($msg, LogLevel::Error);\n return null;\n } else {\n throw new Exception($msg);\n }\n }\n } else {\n $msg = Craft::t('Looks like allow_url_fopen is off and cURL is not enabled. To download external files, one of these methods has to be enabled.');\n \n if (craft()->imager->getSetting('suppressExceptions')===true) {\n ImagerPlugin::log($msg, LogLevel::Error);\n return null;\n } else {\n throw new Exception($msg);\n }\n }\n }", "function download_url($url,$fichier_destination)\n{\n\tglobal $conf;\n\t\n//Pause\n\t$pause = 5;//En seconde\n\t\n//log file\n\t$fp_ok = fopen($conf['log_file_recuperation_ok'],\"a\");\n\t$fp_ko = fopen($conf['log_file_recuperation_ko'],\"a\");\n\t$fp_0_octet = fopen($conf['log_file_recuperation_0_octet'],\"a\");\t\t\t\t\t\n\t\n//Media Recovery\n\t$status = \"\";\n\tif(!copy($url,$fichier_destination))\n\t{\n\t\tfwrite($fp_ko,date(\"Ymd H:i:s\").\" ===> COPIE KO (tentative 1/3) ===> \".$url.\" ===> \".$fichier_destination.\"\\r\\n\");\n\t\tsleep($pause);\n\t\tif(!copy($url,$fichier_destination))\n\t\t{\n\t\t\tfwrite($fp_ko,date(\"Ymd H:i:s\").\" ===> COPIE KO (tentative 2/3) ===> \".$url.\" ===> \".$fichier_destination.\"\\r\\n\");\n\t\t\tsleep($pause);\n\t\t\tif(!copy($url,$fichier_destination))\n\t\t\t{\n\t\t\t\tfwrite($fp_ko,date(\"Ymd H:i:s\").\" ===> COPIE KO (tentative 3/3) ===> \".$url.\" ===> \".$fichier_destination.\"\\r\\n\");\n\t\t\t\tsleep($pause);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tfwrite($fp_ok,date(\"Ymd H:i:s\").\" ===> COPIE OK ===> \".$url.\" ===> \".$fichier_destination.\"\\r\\n\");\t\t\t\n\t\t\t\t$status = \"ok\";\t\t\n\t\t\t}\t\t\t\t\t\t\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\tfwrite($fp_ok,date(\"Ymd H:i:s\").\" ===> COPIE OK ===> \".$url.\" ===> \".$fichier_destination.\"\\r\\n\");\t\t\t\n\t\t\t$status = \"ok\";\t\t\n\t\t}\t\t\t\t\t\t\n\t}\n\telse\n\t{\n\t\tfwrite($fp_ok,date(\"Ymd H:i:s\").\" ===> COPIE OK ===> \".$url.\" ===> \".$fichier_destination.\"\\r\\n\");\t\t\t\n\t\t$status = \"ok\";\t\t\n\t}\t\n\n//Closing Log Files\n\tfclose($fp_ok);\n\tfclose($fp_ko);\n\tfclose($fp_0_octet);\n\t\n\tif($status==\"\")\n\t\t$status=\"ko\";\n\t\t\t\t\n\treturn $status;\t\t\t\t\n}", "function getTargetFileName() ;", "function downloadFile($fileLocation, $fileName, $maxSpeed = 100, $doStream = false) {\r\n if (connection_status() != 0)\r\n return(false);\r\n // in some old versions this can be pereferable to get extention\r\n // $extension = strtolower(end(explode('.', $fileName)));\r\n $extension = pathinfo($fileName, PATHINFO_EXTENSION);\r\n\r\n $contentType = fileTypes($extension);\r\n header(\"Cache-Control: public\");\r\n header(\"Content-Transfer-Encoding: binary\\n\");\r\n header('Content-Type: $contentType');\r\n\r\n $contentDisposition = 'attachment';\r\n\r\n if ($doStream == true) {\r\n /* extensions to stream */\r\n $array_listen = array('zip', 'pdf', 'rar', 'doc');\r\n if (in_array($extension, $array_listen)) {\r\n $contentDisposition = 'inline';\r\n }\r\n }\r\n\r\n if (strstr($_SERVER['HTTP_USER_AGENT'], \"MSIE\")) {\r\n $fileName = preg_replace('/\\./', '%2e', $fileName, substr_count($fileName, '.') - 1);\r\n header(\"Content-Disposition: $contentDisposition;\r\n filename=\\\"$fileName\\\"\");\r\n } else {\r\n header(\"Content-Disposition: $contentDisposition;\r\n filename=\\\"$fileName\\\"\");\r\n }\r\n\r\n header(\"Accept-Ranges: bytes\");\r\n $range = 0;\r\n $size = filesize($fileLocation);\r\n\r\n if (isset($_SERVER['HTTP_RANGE'])) {\r\n list($a, $range) = explode(\"=\", $_SERVER['HTTP_RANGE']);\r\n str_replace($range, \"-\", $range);\r\n $size2 = $size - 1;\r\n $new_length = $size - $range;\r\n header(\"HTTP/1.1 206 Partial Content\");\r\n header(\"Content-Length: $new_length\");\r\n header(\"Content-Range: bytes $range$size2/$size\");\r\n } else {\r\n $size2 = $size - 1;\r\n header(\"Content-Range: bytes 0-$size2/$size\");\r\n header(\"Content-Length: \" . $size);\r\n }\r\n\r\n if ($size == 0) {\r\n die('Zero byte file! Aborting download');\r\n }\r\n set_magic_quotes_runtime(0);\r\n $fp = fopen(\"$fileLocation\", \"rb\");\r\n\r\n fseek($fp, $range);\r\n\r\n while (!feof($fp) and ( connection_status() == 0)) {\r\n set_time_limit(0);\r\n print(fread($fp, 1024 * $maxSpeed));\r\n flush();\r\n ob_flush();\r\n sleep(1);\r\n }\r\n fclose($fp);\r\n\r\n return((connection_status() == 0) and ! connection_aborted());\r\n }", "function download(string $srcPath, string $destPath)\n {\n // Download and store an object from the bucket locally.\n try {\n $object = $this->bucket->object($srcPath);\n $object->downloadToFile($destPath);\n } catch (Exception $e) {\n die('An error occurred downloading the file with exception: ' . $e->getMessage());\n }\n }", "public function download_file($path){\t\n\t\t// Must be fresh start\n\t\tif( headers_sent() )\n\t\tdie('Headers Sent');\n\t\t// Required for some browsers\n\t\tif(ini_get('zlib.output_compression'))\n\t\tini_set('zlib.output_compression', 'Off');\n\t\t// File Exists?\n\t\tif(file_exists($path)){\n\t\t\t// Parse Info / Get Extension\n\t\t\t$fsize = filesize($path);\n\t\t\t$path_parts = pathinfo($path);\n\t\t\t$ext = strtolower($path_parts[\"extension\"]);\n\t\t\t// Determine Content Type\n\t\t\tswitch($ext){\t\t\t \n\t\t\t case \"zip\": $ctype=\"application/zip\"; break;\n\t\t\t case \"doc\": $ctype=\"application/msword\"; break;\n\t\t\t case \"xls\": $ctype=\"application/vnd.ms-excel\"; break;\t\t \n\t\t\t case \"gif\": $ctype=\"image/gif\"; break;\n\t\t\t case \"png\": $ctype=\"image/png\"; break;\n\t\t\t case \"jpeg\":\n\t\t\t case \"jpg\": $ctype=\"image/jpg\"; break;\n\t\t\t default: $ctype=\"application/force-download\";\n\t\t\t}\n\t\t\theader(\"Pragma: public\"); // required\n\t\t\theader(\"Expires: 0\");\n\t\t\theader(\"Cache-Control: must-revalidate, post-check=0, pre-check=0\");\n\t\t\theader(\"Cache-Control: private\",false); // required for certain browsers\n\t\t\theader(\"Content-Type: $ctype\");\n\t\t\t$file_name = basename($path);\n\t\t\theader(\"Content-Disposition: attachment; filename=\\\"\".$file_name.\"\\\";\" );\n\t\t\theader(\"Content-Transfer-Encoding: binary\");\n\t\t\theader(\"Content-Length: \".$fsize);\n\t\t\tob_clean();\n\t\t\tflush();\n\t\t\treadfile( $path );\n\t\t}else{\n\t\t\tdie('File Not Found');\n\t\t}\n\t}", "public function download_file($path){\t\n\t\t// Must be fresh start\n\t\tif( headers_sent() )\n\t\tdie('Headers Sent');\n\t\t// Required for some browsers\n\t\tif(ini_get('zlib.output_compression'))\n\t\tini_set('zlib.output_compression', 'Off');\n\t\t// File Exists?\n\t\tif(file_exists($path)){\n\t\t\t// Parse Info / Get Extension\n\t\t\t$fsize = filesize($path);\n\t\t\t$path_parts = pathinfo($path);\n\t\t\t$ext = strtolower($path_parts[\"extension\"]);\n\t\t\t// Determine Content Type\n\t\t\tswitch($ext){\t\t\t \n\t\t\t case \"zip\": $ctype=\"application/zip\"; break;\n\t\t\t case \"doc\": $ctype=\"application/msword\"; break;\n\t\t\t case \"xls\": $ctype=\"application/vnd.ms-excel\"; break;\t\t \n\t\t\t case \"gif\": $ctype=\"image/gif\"; break;\n\t\t\t case \"png\": $ctype=\"image/png\"; break;\n\t\t\t case \"jpeg\":\n\t\t\t case \"jpg\": $ctype=\"image/jpg\"; break;\n\t\t\t default: $ctype=\"application/force-download\";\n\t\t\t}\n\t\t\theader(\"Pragma: public\"); // required\n\t\t\theader(\"Expires: 0\");\n\t\t\theader(\"Cache-Control: must-revalidate, post-check=0, pre-check=0\");\n\t\t\theader(\"Cache-Control: private\",false); // required for certain browsers\n\t\t\theader(\"Content-Type: $ctype\");\n\t\t\t$file_name = basename($path);\n\t\t\theader(\"Content-Disposition: attachment; filename=\\\"\".$file_name.\"\\\";\" );\n\t\t\theader(\"Content-Transfer-Encoding: binary\");\n\t\t\theader(\"Content-Length: \".$fsize);\n\t\t\tob_clean();\n\t\t\tflush();\n\t\t\treadfile( $path );\n\t\t}else{\n\t\t\tdie('File Not Found');\n\t\t}\n\t}", "function download_file($file_path, $savename = null, $showsavedialog = false) {\n if (!empty($file_path)) {\n\n if ($showsavedialog == false) {\n header('Content-Type: application/octet-stream');\n }\n\n if (empty($savename)) {\n $savename = basename($file_path);\n }\n\n header('Content-Transfer-Encoding: binary');\n header('Content-disposition: attachment; filename=\"' . $savename . '\"');\n header('Content-Description: File Transfer');\n header('Expires: 0');\n header('Cache-Control: must-revalidate');\n header('Pragma: public');\n\n ob_clean();\n flush();\n readfile($file_path);\n\n return true;\n }\n return false;\n}", "function download_file($path, $name)\n {\n // make sure it's a file before doing anything!\n if(is_file($path))\n {\n // required for IE\n if(ini_get('zlib.output_compression')) { ini_set('zlib.output_compression', 'Off'); }\n\n // get the file mime type using the file extension\n $this->load->helper('file');\n\n $mime = get_mime_by_extension($path);\n\n // Build the headers to push out the file properly.\n header('Pragma: public'); // required\n header('Expires: 0'); // no cache\n header('Cache-Control: must-revalidate, post-check=0, pre-check=0');\n header('Last-Modified: '.gmdate ('D, d M Y H:i:s', filemtime ($path)).' GMT');\n header('Cache-Control: private',false);\n header('Content-Type: '.$mime); // Add the mime type from Code igniter.\n header('Content-Disposition: attachment; filename=\"'.basename($name).'\"'); // Add the file name\n header('Content-Transfer-Encoding: binary');\n header('Content-Length: '.filesize($path)); // provide file size\n header('Connection: close');\n readfile($path); // push it out\n exit();\n }\n }", "public function download()\n\t{\n\t\tR::selectDatabase('oxid');\n\t\t$files = $this->getFilesByName(Flight::request()->query->file);\n\t\tif (empty($files)) $this->redirect('/');\n\t\t$file = reset($files);\n\t\t$dwnloadDir = substr($file['OXSTOREHASH'], 0, 2);\n\t\t$dwnloadFile = Flight::get('oxid_dir_downloads').$dwnloadDir.'/'.$file['OXSTOREHASH'];\n\t\tif ( ! is_file($dwnloadFile)) $this->redirect('/');\n\t\t//error_log($dwnloadFile);\n\t\theader('Content-type: application/pdf');\n\t\theader('Content-Disposition: inline; filename=\"'.$file['OXFILENAME'].'\"');\n\t\t@readfile($dwnloadFile);\n\t}", "function get_file(){\n extract($this->_url_params);\n /**\n * @var string $file_name\n * @var int $project_id\n */\n $this->load_view(false);\n if(!isset($file_name, $project_id)) goto redirect;\n /**\n * @var \\AWorDS\\App\\Models\\Project $project\n */\n $project = $this->set_model();\n $logged_in = $project->login_check();\n if($logged_in AND $project->verify($project_id)){\n $file_type = null;\n switch($file_name){\n case 'SpeciesRelation.txt': $file_type = Constants::EXPORT_SPECIES_RELATION; break;\n case 'DistantMatrix.txt' : $file_type = Constants::EXPORT_DISTANT_MATRIX; break;\n case 'NeighbourTree.jpg' : $file_type = Constants::EXPORT_NEIGHBOUR_TREE; break;\n case 'UPGMATree.jpg' : $file_type = Constants::EXPORT_UPGMA_TREE;\n }\n if($file_type == null) goto redirect;\n $file = $project->export($project_id, $file_type);\n if($file == null){\n redirect:\n $this->redirect(isset($_SERVER['HTTP_REFERER']) ?\n $_SERVER['HTTP_REFERER'] :\n Config::WEB_DIRECTORY . 'projects');\n exit();\n }\n header('Content-Type: ' . $file['mime']);\n header('Content-Disposition: attachment; filename=\"' . $file['name'] . '\"');\n readfile($file['path']);\n exit();\n }\n goto redirect;\n }", "abstract protected function getFilesDestination();", "public static function download($sourceURL, $destinationPath, $overwrite = true)\n\t{\n\t\t// redefine\n\t\t$sourceURL = (string) $sourceURL;\n\t\t$destinationPath = (string) $destinationPath;\n\t\t$overwrite = (bool) $overwrite;\n\n\t\t// validate if the file already exists\n\t\tif(!$overwrite && self::exists($destinationPath)) return false;\n\n\t\t// open file handler\n\t\t$fileHandle = @fopen($destinationPath, 'w');\n\n\t\t// validate filehandle\n\t\tif($fileHandle === false) return false;\n\n\t\t$options = array(CURLOPT_URL => $sourceURL,\n\t\t\t\t\t\t CURLOPT_FILE => $fileHandle,\n\t\t\t\t\t\t CURLOPT_HEADER => false);\n\n\t\t// init curl\n\t\t$curl = curl_init();\n\n\t\t// set options\n\t\tcurl_setopt_array($curl, $options);\n\n\t\t// execute the call\n\t\tcurl_exec($curl);\n\n\t\t// get errornumber\n\t\t$errorNumber = curl_errno($curl);\n\t\t$errorMessage = curl_error($curl);\n\t\t$httpCode = curl_getinfo($curl, CURLINFO_HTTP_CODE);\n\n\t\t// close\n\t\tcurl_close($curl);\n\t\tfclose($fileHandle);\n\n\t\t// validate the errornumber\n\t\tif($errorNumber != 0) throw new SpoonFileSystemException($errorMessage);\n\t\tif($httpCode != 200) throw new SpoonFileSystemException('The file \"'. $sourceURL .'\" isn\\'t available for download.');\n\n\t\t// return\n\t\treturn true;\n\t}", "public function startDownload() {\n if (empty($this->url) || empty($this->destPath)) {\n throw new SFException('No URL or path given. Use setPaths()', ERR_REPORT_APP);\n }\n\n $this->callMethod('startDownload', array($this->destPath, $this->url));\n }", "protected function actionDownloadTempfile($params){\t\t\n\t\t\n\t\t$inline = !isset($params['inline']) || !empty($params['inline']);\n\t\t\n\t\t$file = new \\GO\\Base\\Fs\\File(GO::config()->tmpdir.$params['path']);\n\t\tif($file->exists()){\n\t\t\t\\GO\\Base\\Util\\Http::outputDownloadHeaders($file, $inline, !empty($params['cache']));\n\t\t\t$file->output();\t\t\n\t\t}else\n\t\t{\n\t\t\techo \"File not found!\";\n\t\t}\n\t}", "public function download()\n\t{\n\t\t$sfUsers = sfCore::getClass('sfUsers');\n\t\tif($this->auth_requirement != 0)\n\t\t{\n\t\t\tif($sfUsers::translateAuthLevelString($sfUsers::getUserAuthLevel()) < $this->auth_requirement)\n\t\t\t{\n\t\t\t\tthrow new sfAuthorizationException();\n\t\t\t}\n\t\t}\n\n\t\t$update = sfCore::db->query(\"UPDATE `swoosh_file_storage` SET `downloads` = `downloads`+1 WHERE `id` = '%i' LIMIT 1;\",\n\t\t\t$this->id);\n\t\tfSession::close();\n\t\t$this->fFile->output(true, true);\n\t}", "public function downloadFile($file, $file_name=null, $send_mode=\"file\") {\r\r\n\t\r\r\n\t\tif ($file_name == null)\r\r\n\t\t\t$file_name = basename($file);\r\r\n\t\t\t\r\r\n\t\t$this->setHeader(\"Content-Description\", \"File Transfer\");\r\r\n\t\tforeach ($this->content_type as $type)\r\r\n\t\t\t$this->setHeader(\"Content-Type\", $type);\r\r\n\t\t$this->setHeader(\"Content-Disposition\", \"attachment; filename=\\\"\" . $file_name . \"\\\"\");\r\r\n\t\t$this->setHeader(\"Content-Transfer-Encoding\", $this->encoding);\r\r\n\t\t$this->setHeader(\"Expires\", \"0\");\r\r\n\t\t$this->setHeader(\"Cache-Control\", \"public, must-revalidate, max-age=0\");\r\r\n\t\t$this->setHeader(\"Pragma\", \"public\");\r\r\n\t\t$this->setHeader(\"Content-Length\", filesize($file));\r\r\n\t\t\r\r\n\t\t$this->output($file, $send_mode);\r\r\n\t}", "public function test_it_downloads_files()\n {\n // using a real url I suppose, so I'm just going to\n // make sure it constructs for now\n // @todo see if there is a better test for this\n $FileDownloader = new FileDownloader;\n }", "public function downloadFile()\n {\n // Check for request forgeries.\n Session::checkToken('get') or jexit(Text::_('JINVALID_TOKEN'));\n\n $model = $this->getModel();\n $model->downloadFile();\n }", "function tdc_do_download($file_name){\n $database = tdc_open_database(TDC_DATABASE_FILE);\n $filenode = tdc_find_filenode($database, $file_name);\n\n if($filenode != null){\n $file_path = TDC_DOC_ROOT . tdc_get_filepath($filenode);\n $file_name = tdc_get_filename($filenode);\n if(tdc_send_file($file_path, $file_name)){\n tdc_update_count($database, $filenode, TDC_DATABASE_FILE);\n }\n }\n}", "function deliverFileForDownload($filename, $deliveryname) { \n\tif(file_exists($filename) && is_readable($filename)) {\n\t\t$imageinfo = getimagesize($filename);\n // provide headers for download of the image file.\n\t\theader('Content-Description: File Transfer');\n\t\theader('Content-Type: ' . $imageinfo['mime']);\n\t\theader(\"Content-Disposition: attachment; filename=$deliveryname\");\n\t\theader('Content-Transfer-Encoding: binary');\n\t\theader('Expires: 0');\n\t\theader('Cache-Control: must-revalidate, post-check=0, pre-check=0');\n\t\theader('Pragma: public');\n\t\theader('Content-Length: ' . filesize($filename));\n\t\tob_clean();\n\t\tflush();\n\t\treadfile($filename);\n\t} else {\n\t\tdeliverErrorMessageImage(\"Unable to read [$filename]\");\n\t}\t\n}", "public function downloadFile()\n { \n $urls = [];\n $file = a2_path('workflows/downloadable-urls.yaml');\n $response = json_decode(file_get_contents('php://input'), true);\n \n if(!file_exists($file)){\n file_put_contents($file, '');\n }\n\n if(isset($response['urls'])){\n $urls = $response['urls'];\n file_put_contents($file, Yaml::dump($urls));\n }\n\n if(isset($response['sync'])){\n $urls = Yaml::parseFile($file );\n\n }\n\n $client = new Client();\n foreach ($urls as $key => $url) {\n $res = $client->request('GET', $urls[$key], ['headers' => array(\n 'A2-TECHNOLOGY' => getenv('A2_TECHNOLOGY'),\n 'A2-TOKEN' => getenv('A2_TOKEN'),\n 'Content-Type: text/plain'\n )]);\n if ($res->getStatusCode() == 200) {\n\n $path = \\explode('?path=', $urls[$key])[1];\n if(!file_exists($path=base_path($path))){\n \\file_put_contents($path, $res->getBody());\n }\n unset($urls[$key]);\n }\n }\n // save data\n if(count($urls)){\n file_put_contents($file, Yaml::dump($urls));\n }else {\n file_put_contents($file, '');\n }\n }", "function ftp_file($source_file, $dest_file, $mimetype, $disable_error_mode = false)\n{\n\tglobal $config, $lang, $error, $error_msg;\n\n\t$conn_id = attach_init_ftp();\n\n\t// Binary or Ascii ?\n\t$mode = FTP_BINARY;\n\tif (preg_match(\"/text/i\", $mimetype) || preg_match(\"/html/i\", $mimetype))\n\t{\n\t\t$mode = FTP_ASCII;\n\t}\n\n\t$res = @ftp_put($conn_id, $dest_file, $source_file, $mode);\n\n\tif (!$res && !$disable_error_mode)\n\t{\n\t\t$error = true;\n\t\tif (!empty($error_msg))\n\t\t{\n\t\t\t$error_msg .= '<br />';\n\t\t}\n\t\t$error_msg = sprintf($lang['Ftp_error_upload'], $config['ftp_path']) . '<br />';\n\t\t@ftp_quit($conn_id);\n\t\treturn false;\n\t}\n\n\tif (!$res)\n\t{\n\t\treturn false;\n\t}\n\n\t@ftp_site($conn_id, 'CHMOD 0644 ' . $dest_file);\n\t@ftp_quit($conn_id);\n\treturn true;\n}", "public function download_file($file_name){\n $files = Storage::disk('invoice_uploads')->getDriver()->getAdapter()->applyPathPrefix($file_name);\n return response()->download($files);\n }", "function download_file($path, $name = \"\", $allowResume = true, $deleteAfter = false) {\n\t\t\tif ($name == \"\") {\n\t\t\t\t$name = basename($path);\n\t\t\t}\n\t\t\t$mimetype = finfo_file(finfo_open(FILEINFO_MIME_TYPE), $path);\n\t\t\t// set all the right headers for a file download\n\t\t\theader('Set-Cookie: fileDownload=true; path=/'); // for the jquery.fileDownload library\n\t\t\theader('Cache-Control: max-age=60, must-revalidate');\n\t\t\theader('Content-Transfer-Encoding: binary'); // For Gecko browsers mainly\n\t\t\theader('Content-Encoding: none');\n\t\t\theader('Content-Type: '.$mimetype); // if there are some problems with this, switch to application/octet-stream for everything\n\t\t\theader('Content-Disposition: attachment; filename=\"'.$name.'\"');\n\t\t\theader('Content-Length: ' . filesize($path));\n\t\t\theader('Last-Modified: ' . gmdate('D, d M Y H:i:s', filemtime($path)) . ' GMT');\n\t\t\tif ($allowResume) {\n\t\t\t\theader('Accept-Ranges: bytes'); // For download resume\n\t\t\t}\n\t\t\theader('Expires: 0');\n\t\t\theader('Pragma: public');\n\t\t\treadfile($path);\n\t\t\tif ($deleteAfter) {\n\t\t\t\tunlink($path);\n\t\t\t}\n\t\t\texit();\n\t\t}", "function downloadFile($data){\r\n\r\n $dao = new \\PNORD\\Model\\MaintenanceDAO($this->app); \r\n $info = $dao->getMaintenance($data); \r\n $this->app->log->info('****info **** -> '.$this->dumpRet($info));\r\n\r\n\r\n if (file_exists($info['FILES'])) {\r\n\r\n // header('Content-Description: File Transfer');\r\n header('Content-Type: application/zip');\r\n $name = split('maintenances/', $info['FILES']);\r\n $this->app->log->info('****name **** -> '.$this->dumpRet($name));\r\n $this->app->log->info('****info Files **** -> '.$this->dumpRet($info['FILES']));\r\n $this->app->log->info('****filesize(info[FILES]) **** -> '.$this->dumpRet(filesize($info['FILES'])));\r\n header('Content-Disposition: inline; filename='.basename($name[1]));\r\n header('Expires: 0');\r\n header('Cache-Control: must-revalidate');\r\n header('Pragma: public');\r\n header('Content-Length: ' . filesize($info['FILES']));\r\n ob_clean();\r\n flush();\r\n readfile($info['FILES']);\r\n exit;\r\n\r\n } \r\n\r\n }", "public function startDownload() {\n if (!isset($this->destPath)) {\n throw new SFException( 'No destination path. Use setDestinationPath()', ERR_REPORT_APP );\n }\n\n $this->callMethod( 'startDownload', array( $this->destPath, ($this->data == NULL)) );\n }", "public function actionDownload($id){\n $model = $this->findModel($id);\n $file = $model->file_surat;\n $path = Yii::getAlias('@webroot').'/'.$file;\n if(file_exists($path)){\n Yii::$app->response->sendFile($path);\n }else{\n $this->render('download404');\n }\n }", "public function downloadLast($dest)\n {\n if (!$this->coreLink || !$this->extraLink) {\n $this->checkTbVersion();\n if (!$this->coreLink || !$this->extraLink) {\n return false;\n }\n }\n\n $coreDestPath = realpath($dest).DIRECTORY_SEPARATOR.\"thirtybees-v{$this->version}.zip\";\n $extraDestPath = realpath($dest).DIRECTORY_SEPARATOR.\"thirtybees-extra-v{$this->version}.zip\";\n if (!empty($this->requires)) {\n foreach ($this->requires as $dependency) {\n Tools::copy(\"https://api.thirtybees.com/updates/packs/thirtybees-file-actions-v{$dependency}.json\", realpath($dest).DIRECTORY_SEPARATOR.\"thirtybees-file-actions-v{$dependency}.json\");\n }\n }\n $fileActionsPath = realpath($dest).DIRECTORY_SEPARATOR.\"thirtybees-file-actions-v{$this->version}.json\";\n\n if (!file_exists($coreDestPath)\n || md5_file($coreDestPath) !== $this->md5Core) {\n Tools::copy($this->coreLink, $coreDestPath);\n }\n if (!file_exists($extraDestPath)\n || md5_file($extraDestPath) !== $this->md5Extra) {\n Tools::copy($this->extraLink, $extraDestPath);\n }\n Tools::copy($this->fileActionsLink, $fileActionsPath);\n\n return is_file($coreDestPath) && is_file($extraDestPath) && is_file($fileActionsPath);\n }", "public function testReturnFileDownloadFileNotFound() {\n $response = $this->archiveService->returnFileDownload('php://pii_data/filename.zip');\n }", "public function getDownloadPath() {}", "function copy_file($url_origem, $arquivo_destino){\r\n\t$minha_curl = curl_init($url_origem);\r\n\t$fs_arquivo = fopen($arquivo_destino, \"w\");\r\n\tcurl_setopt($minha_curl, CURLOPT_FILE, $fs_arquivo);\r\n\tcurl_setopt($minha_curl, CURLOPT_HEADER, 0);\r\n\tcurl_exec($minha_curl);\r\n\tcurl_close($minha_curl);\r\n\treturn fclose($fs_arquivo);\r\n}", "public static function downloadFile($path)\n {\n return BaseUrl::to([self::$fileflyApiUrl, 'action' => 'download', 'path' => $path]);\n }", "public function getFile(string $url, string $dest, array $options = array()) : bool\n {\n // Logger.\n $this->logger->debugInit();\n \n // Validates URL.\n if (empty($url)) {\n \n // Logger.\n $this->logger->error('Empty file URL');\n \n $out = false;\n \n } else {\n \n // Prepare file.\n $fp = fopen($dest, 'w');\n \n // Get options.\n if (empty($options)) {\n \n $cURLOptions = $this->getFileDefaultOptions($fp);\n \n } else {\n \n $cURLOptions = $options;\n \n }//end if\n \n // Set petition.\n $petition = new XsgaRestClient($url);\n \n // Get response.\n $response = $petition->get($cURLOptions);\n \n // Close file.\n fclose($fp);\n \n // Logger.\n $this->logger->debug(\"HTTP response code: $response->getCode()\");\n \n if ($response->getCode() !== 200) {\n \n // Logger.\n $this->logger->error(\"HTTP ERROR: $response->getCode()\");\n $this->logger->error($response->getErrors());\n \n $out = false;\n \n } else {\n \n $out = true;\n \n }//end if\n \n }//end if\n \n // Logger.\n $this->logger->debugEnd();\n \n return $out;\n \n }", "function extractfile($a_file_id,$a_destination) \n\t{\n\t\tif (($a_file_id < 0) || ($a_file_id > $this->NumRes)) \n\t\t{\n\t\t\treturn(false);\n\t\t\texit;\n\t\t}\n\t\t\n\t\t$dest_filename = $a_destination.$this->Resources[$a_file_id][ResName].\".\".$this->Resources[$a_file_id][Type];\n\t\t$file = fopen($this->FileName, \"rb\");\n\t\tfseek($file, $this->Resources[$a_file_id][ResDataOffset]);\n\t\t$filedest = fopen($dest_filename, \"w\");\n\t\tfwrite($filedest,fread($file,$this->Resources[$a_file_id][FileLength]),$this->Resources[$a_file_id][FileLength]);\n\t\tfclose($filedest);\n\t\tfclose($file);\n\t\treturn(true);\n\t}", "private static function TransferDownload($stream, $name, $contentType = 'application/octet-stream')\n\t{\n\t\tif (strpos($_SERVER['HTTP_USER_AGENT'], 'Safari') !== false)\n\t\t\theader('Content-Type: ' . $contentType);\n\t\telse\n\t\t\theader('Content-Type: application/octet-stream');\n\n\t\t//Calculate the length of the download\n\t\t$currentPos = ftell($stream);\n\t\tif ($currentPos !== false)\n\t\t{\n\t\t\tif (fseek($stream, 0, SEEK_END) == 0)\n\t\t\t{\n\t\t\t\theader('Content-Length: ' . ftell($stream));\n\t\t\t\tfseek($stream, $currentPos, SEEK_SET);\n\t\t\t}\n\t\t}\n\n\t\theader(sprintf('Content-Disposition: attachment; filename=\"%s\"', $name));\n\t\tif (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== false || strpos($_SERVER['HTTP_USER_AGENT'], 'Safari') !== false)\n\t\t{\n\t\t\t//IE browser\n\t\t\theader('Cache-Control: must-revalidate, post-check=0, pre-check=0');\n\t\t\theader('Pragma: public');\n\t\t}\n\t\telse\n\t\t{\n\t\t\theader('Pragma: no-cache');\n\t\t}\n\n\t\tfpassthru($stream);\n\t}", "public static function download($fileId, $downloadAs) {\n $authorized = false;\n\n // get the file from 'file_news' table\n $file = DB::table('files_new')->select('*')->where('id', $fileId)->first();\n if(empty($file)) {\n throw new Exception(\"Invalid file\");\n }\n\n $user = Helper::getUser();\n\n // if user is the one who uploaded the file , he can download the files.\n if($user->id == $file->user_id) {\n $authorized = true;\n }\n\n else if(Helper::isBroker($user->role)) { // IF user is broker\n // GET broker ID\n $brokerId = Broker::where('user_id', $user['id'])->first()->id;\n\n // Check if admin uploaded the file on behalf of broker i.e broker_id => broker ID of the requester , if yes grant access\n if(!empty($file->broker_id) && $file->broker_id == $brokerId) {\n $authorized = true;\n }\n\n else if(!empty($file->client_id)) {\n\n // Check if 'client_id' exist, if so check if that client belongs to the broker who is requesting to download the file, if yes grant access\n $client = DB::table('clients')->select('id', 'broker_id')->where('id', $file->client_id)->first();\n\n if($brokerId == $client->broker_id) {\n $authorized = true;\n }\n }\n }\n\n // if User is client\n else {\n\n // GET client ID\n $clientId = Client::where('user_id', $user['id'])->first()->id;\n\n // Check if broker uploaded the file on behalf of his. client i.e client_id => client ID of the requester , if yes grant access\n if(!empty($file->client_id) && $file->client_id == $clientId) {\n $authorized = true;\n }\n }\n\n // if File exist in files_new table and user is authrorized,then download or return url for the user.\n if($file && $authorized) {\n $s3 = Storage::disk('s3');\n\n // get contents of the file from s3 bucket..\n $fileContents = $s3->get($file->directory);\n\n // if we are downloading file as content, return now\n // otherwise, we save it to a public location and download\n if($downloadAs == 'content') {\n return $fileContents;\n }\n\n else {\n\n // make sure to create the public folder to store the temporary file on server side(will be delete after sending file to client)\n if(!File::exists(public_path() . \"/uploads\")) {\n File::makeDirectory(public_path() . \"/uploads\");\n }\n\n // set temporary file nae before sending file to the client.\n $tmpFileName = $user->id . '-' . time() . \".\" . $file->extension;\n $filePath = public_path() . '/uploads';\n $fullPath = $filePath . '/' . $tmpFileName;\n\n // create file from S3 as tmp file in 'public' folder\n File::put($fullPath, $fileContents);\n\n // return file downaload and then delete the file from the server.\n return response()->download($fullPath)->deleteFileAfterSend(true);\n }\n }\n\n else {\n // If get here, user is unauthorised to access the file\n throw new Exception(\"Not authorized to access the file.\");\n }\n }", "public function download()\n {\n header('Content-Description: File Transfer');\n header('Content-Type: application/octet-stream');\n header('Content-Disposition: attachment; filename=' . $this->getFilename());\n header('Content-Transfer-Encoding: binary');\n header('Expires: 0');\n header('Cache-Control: must-revalidate, post-check=0, pre-check=0');\n header('Pragma: public');\n header('Content-Length: ' . $this->getSize());\n \\Oka\\Web\\Buffer::Clean();\n\n $this->read();\n exit;\n }", "public function getTargetFileName() {}", "function download()\n {\n $field = $this->GET('field');\n $id = $this->GET('id');\n $file = $this->table->data[$id][$field];\n header('Content-Type: ' . $this->_mime_content_type($file));\n header('Content-Length: ' . strlen($file));\n header('Content-Disposition: attachment; filename=\"' . $field . '_' . $id . '\";');\n echo $file;\n }" ]
[ "0.7398398", "0.6541228", "0.65389204", "0.65291613", "0.6407598", "0.6378817", "0.636553", "0.6293393", "0.6290224", "0.62621075", "0.6252892", "0.61946857", "0.6186285", "0.6160784", "0.6137227", "0.6126776", "0.6122547", "0.61191624", "0.609807", "0.60961354", "0.60914665", "0.608859", "0.608131", "0.6051624", "0.60472244", "0.60251427", "0.6000931", "0.59962475", "0.5992904", "0.599262", "0.5975452", "0.5969079", "0.5968171", "0.5963225", "0.59473205", "0.59421504", "0.5938524", "0.59358186", "0.5925236", "0.59208953", "0.59171534", "0.59169626", "0.5913688", "0.5913634", "0.5912617", "0.5905468", "0.5875025", "0.5865937", "0.58608985", "0.5853886", "0.58441406", "0.5841831", "0.58396685", "0.5827886", "0.58232594", "0.5802343", "0.57521623", "0.5747527", "0.5742097", "0.5735907", "0.57250565", "0.57197267", "0.571878", "0.57183653", "0.5717969", "0.5713985", "0.5713985", "0.5689677", "0.5684948", "0.5682687", "0.5676988", "0.56746626", "0.56639844", "0.56623703", "0.5661286", "0.5661238", "0.565008", "0.5645184", "0.56412244", "0.56396073", "0.5630035", "0.56204396", "0.56053656", "0.55998033", "0.55882126", "0.55691355", "0.55686814", "0.5562974", "0.55580276", "0.55512494", "0.5548811", "0.5546092", "0.5545106", "0.55400956", "0.55280423", "0.551998", "0.55024236", "0.55006975", "0.5497463", "0.54894924" ]
0.6062683
23
write Crunchbase related code here.
public function downloadCrunchbase($file, $outputFileName){ // re think if we can use the existing function itself. }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function main()\n /**/\n {\n parent::run();\n }", "protected function preProcess() {}", "public function cs(){\n }", "protected function _process() {}", "protected function _process() {}", "protected function _process() {}", "protected function _process() {}", "function _drush_build() {\n drush_invoke('updatedb');\n drush_invoke('features-revert-all', array('force' => TRUE));\n drush_invoke('cc', array('type' => 'all'));\n drush_log(dt('Built!'), 'success');\n}", "public function main()\n\t{\n\t\t$this->loadConfig();\n\t\t$this->validateProject();\n\t\t$this->cleanConfig();\n\t\t$this->installDependencies();\n\t\t$this->createAutoload();\n\t\t$this->finish();\n\t}", "protected function _preExec()\n {\n }", "public static function go()\n\t{\n\t\t// first, register the copper handler.\n\t\tspl_autoload_register(array('Bootstrap', 'copper_autoload'));\n\t\t// then register the default handler as well\n\t\tspl_autoload_register();\n\t\t\n\t\terror_reporting(E_ALL);\n\n\t\t// Include older stuff that hasn't been oop'd yet.\n\t\trequire_once(CU_SYSTEM_PATH . 'sql_' . DB_DRIVER . CU_SCRIPT_EXT);\n\t\trequire_once(CU_SYSTEM_PATH . 'copper' . CU_SCRIPT_EXT);\n\n\t\tself::read_config();\n\t\n\t\t// init any classes that need it.\n\t\tRequest::init();\n\t\tDB::init(DB_USERNAME, DB_PASSWORD, DB_NAME, DB_SERVER);\n\t\t\n\t\tSettings::init();\n\n\t\t// upgrader requries settings\n\t\tUpgrader::run_upgrades();\n\t}", "public function core() {\n\t\t\tinclude_once $this->includes_path() . 'functions-cyprus-utility.php';\n\t\t\tinclude_once $this->includes_path() . 'class-cyprus-settings.php';\n\t\t\tinclude_once $this->includes_path() . 'class-cyprus-sanitize.php';\n\t\t\tinclude_once $this->includes_path() . 'class-cyprus-dynamic-css.php';\n\t\t}", "abstract protected function bootstrap();", "public function preExec()\n {\n }", "public function scaffold() {\n $config_files = $this->loadScaffoldSourceConfigurations();\n if ($config_files) {\n foreach ($config_files as $file) {\n $config = $this->getConfig($file);\n $this->generateCode($config);\n }\n }\n }", "public function run()\n {\t\n \t// kkb\n Sp_category::insert([\n 'category' => 'PUBLIC GOODS'\n ]);\n\n Sp_category::insert([\n 'category' => 'ENVIRONMENTAL PROTECTION AND CONSERVATION'\n ]);\n\n Sp_category::insert([\n 'category' => 'ENTERPRISE'\n ]);\n }", "protected function _exec()\n {\n }", "public function branching()\n {\n }", "function main() {\n\t\tApp::Uses('ConnectionManager', 'Model');\n\t\t$db =& ConnectionManager::getDataSource('default');\n\n\t\t$domain = substr(ROOT, max(strrpos(ROOT, '\\\\'), strrpos(ROOT, '/'))+1);\n\n\t\t$database = str_replace(array('.', '-'), array('_','_'), $domain); // Source's & Destination's 'Subdomains' & 'Top Level Domains'\n\t\t$FULLDUMPPATH=ROOT.DS.'sql'.DS.'full'.DS.exec(\"date '+%Y-%m-%d_%H-%M-%S'\").'.sql';\n\n\t\techo \"\\nDumping DB to sql/full/$FULLDUMPPATH.gz\\n\";\n\t\tpassthru(\"mysqldump -h {$db->config['host']} -u {$db->config['login']} --password=\\\"{$db->config['password']}\\\" $database > $FULLDUMPPATH\");\n\t\tpassthru(\"gzip $FULLDUMPPATH\");\n\t}", "protected function createPreCommit() :void\n {\n $this->preCommitConfig();\n $this->preCommitSetup();\n }", "protected function process()\n {}", "public function preExecute(){\n\n\t\n\t}", "public function __construct() {\n // be shure, classes are loaded before copie\n MLSession::gi();\n MLSetting::gi();\n MLMessage::gi();\n MLController::gi('widget_message');\n MLController::gi('widget_progressbar');\n MLHelper::gi('remote');\n MLCache::gi();\n MLShop::gi();\n MLHttp::gi();\n MLLog::gi();\n MLException::factory('update');\n try {\n MLDatabase::factory('config');\n } catch (Exception $oEx) {\n // database is not part of installer\n }\n $this->sCacheName = __CLASS__.'__updateinfo.json';\n parent::__construct();\n }", "protected function baseOperation1(): void\n {\n echo \"AbstractClass says: I am doing the bulk of the work\\n\";\n }", "public function run()\n {\n Log::info(__CLASS__ . ' Start');\n\n try {\n DB::beginTransaction();\n\n $this->setStyleCatalog(['name' => 'Urban Barn'], ['data_id' => 'Urban Barn']);\n $this->setStyleCatalog(['name' => 'Urban Shack'], ['data_id' => 'Urban Shack']);\n $this->setStyleCatalog(['name' => 'Urban Lean-To'], ['data_id' => 'Urban Lean-to']); \n\n DB::commit();\n } catch (Exception $e) {\n $output = new Symfony\\Component\\Console\\Output\\ConsoleOutput();\n $output->writeln(\"<error>{$e->getMessage()}</error>\");\n $output->writeln($e->getTraceAsString());\n DB::rollback();\n }\n\n Log::info(__CLASS__ . ' End');\n }", "public function run()\n {\n //\n DB::table('casetypes')->insert([\n 'casetypeName' =>'Civil and Political Rights',\n ]);\n DB::table('casetypes')->insert([\n 'casetypeName' =>'Ancestral Domain Rights',\n ]);\n DB::table('casetypes')->insert([\n 'casetypeName' =>'Militarization and Private Armed Groups',\n ]);\n DB::table('casetypes')->insert([\n 'casetypeName' =>'Benefit Sharing',\n ]);\n DB::table('casetypes')->insert([\n 'casetypeName' =>'FPIC Isues',\n ]);\n DB::table('casetypes')->insert([\n 'casetypeName' =>'Complaints on IP Leadership',\n ]);\n DB::table('casetypes')->insert([\n 'casetypeName' =>'Complaints against NCIP Staff',\n ]);\n DB::table('casetypes')->insert([\n 'casetypeName' =>'Complaints againts other Government Agencies',\n ]);\n\n }", "function wpc_braches_database_updates(){\n // @ branch_manager\n wpc_branches_add_manager();\n // @ branch_client @ branch_agent @ branch_employee @ branch_driver\n wpc_branches_add_assigment();\n}", "public function run() {\n \n // Require the base class\n $this->load->file(APPPATH . '/base/main.php');\n\n // List all user's apps\n foreach (glob(APPPATH . 'base/user/apps/collection/*', GLOB_ONLYDIR) as $directory) {\n\n // Get the directory's name\n $app = trim(basename($directory) . PHP_EOL);\n\n // Verify if the app is enabled\n if (!get_option('app_' . $app . '_enable')) {\n continue;\n }\n\n // Create an array\n $array = array(\n 'MidrubBase',\n 'User',\n 'Apps',\n 'Collection',\n ucfirst($app),\n 'Main'\n );\n\n // Implode the array above\n $cl = implode('\\\\', $array);\n\n // Run cron job commands\n (new $cl())->cron_jobs();\n }\n \n // Prepare allowed files\n $allowed_files = array(\n 'cron.php',\n 'index.php',\n 'ipn-listener.php',\n 'update.php'\n );\n \n // List all files\n foreach (glob(FCPATH . '/*.php') as $filename) {\n \n $name = str_replace(FCPATH . '/', '', $filename);\n\n if ( !in_array($name, $allowed_files) ) {\n \n $msg = 'Was detected and deleted the file ' . $filename . '. Please contact support if you don\\'t know this file.';\n \n $this->send_warning_message($msg);\n unlink($filename);\n \n } else {\n \n if ( $this->check_for_malware($filename) ) {\n \n $msg = 'Was detected malware in the file ' . $filename . ' and was deleted.';\n\n $this->send_warning_message($msg);\n unlink($filename);\n \n }\n \n }\n \n }\n \n $extensions = array(\n '.php3',\n '.php4',\n '.php5',\n '.php7',\n '.phtml',\n '.pht'\n );\n\n foreach ( $extensions as $ext ) {\n $this->delete_files_by_extension(FCPATH, $ext); \n }\n \n $extensions[] = '.php';\n \n foreach ( $extensions as $ext ) {\n $this->delete_files_by_extension(FCPATH . 'assets', $ext); \n }\n \n $this->check_for_non_midrub_files(FCPATH . 'assets');\n \n }", "public function run()\n {\n $this->command->info('Begin Init base data.');\n\n $this->initAttr();\n $this->initSum();\n $this->initEnum();\n $this->initTags();\n $this->initSysBadge();\n $this->initSysTaskTag();\n $this->initSysUserSkill();\n $this->initUser();\n// $this->initSysIpSurvey();\n $this->command->info('All base data is ok!');\n }", "function drush_boilerplate_callback() {\n // Default argument values.\n $arg1 = 'default argument 1';\n $arg2 = 'default argument 2';\n\n // Get the arguments from CLI.\n $args = func_get_args();\n if (!empty($args[0])) $arg2 = $args[0];\n if (!empty($args[1])) $arg2 = $args[1];\n\n drush_log(dt('This is a custom Drush command. Argument 1: @arg1. Argument 2: @arg2.', [\n '@arg1' => $arg1,\n '@arg2' => $arg2,\n ]), 'ok');\n}", "public function run()\n {\n DB::table('sources')->insert([\n 'name' => 'TechCrunch',\n 'slug' => 'tech-crunch',\n 'active' => 1\n ]);\n }", "function auto_run()\n\t{\n\t\t$this->html = $this->ipsclass->acp_load_template('cp_skin_tools');\n\n\t\tswitch($this->ipsclass->input['code'])\n\t\t{\n\t\t\tcase 'master_xml_export':\n\t\t\t\t$this->master_xml_export();\n\t\t\t\tbreak;\n\n\t\t\tcase 'manage':\n\t\t\t\t$this->ipsclass->admin->cp_permission_check( $this->perm_main.'|'.$this->perm_child.':' );\n\t\t\t\t$this->components_list();\n\t\t\t\tbreak;\n\n\t\t\tcase 'component_add':\n\t\t\t\t$this->ipsclass->admin->cp_permission_check( $this->perm_main.'|'.$this->perm_child.':add' );\n\t\t\t\t$this->components_form('add');\n\t\t\t\tbreak;\n\t\t\tcase 'component_add_do':\n\t\t\t\t$this->ipsclass->admin->cp_permission_check( $this->perm_main.'|'.$this->perm_child.':add' );\n\t\t\t\t$this->components_save('add');\n\t\t\t\tbreak;\n\n\t\t\tcase 'component_edit':\n\t\t\t\t$this->ipsclass->admin->cp_permission_check( $this->perm_main.'|'.$this->perm_child.':edit' );\n\t\t\t\t$this->components_form('edit');\n\t\t\t\tbreak;\n\t\t\tcase 'component_edit_do':\n\t\t\t\t$this->ipsclass->admin->cp_permission_check( $this->perm_main.'|'.$this->perm_child.':edit' );\n\t\t\t\t$this->components_save('edit');\n\t\t\t\tbreak;\n\n\t\t\tcase 'component_delete':\n\t\t\t\t$this->ipsclass->admin->cp_permission_check( $this->perm_main.'|'.$this->perm_child.':edit' );\n\t\t\t\t$this->components_delete();\n\t\t\t\tbreak;\n\n\t\t\tcase 'component_export':\n\t\t\t\t$this->ipsclass->admin->cp_permission_check( $this->perm_main.'|'.$this->perm_child.':export' );\n\t\t\t\t$this->components_export('single');\n\t\t\t\tbreak;\n\t\t\tcase 'component_import':\n\t\t\t\t$this->ipsclass->admin->cp_permission_check( $this->perm_main.'|'.$this->perm_child.':import' );\n\t\t\t\t$this->components_import();\n\t\t\t\tbreak;\n\n\t\t\tcase 'component_uninstall':\n\t\t\t\t$this->ipsclass->admin->cp_permission_check( $this->perm_main.'|'.$this->perm_child.':edit' );\n\t\t\t\t$this->components_uninstall();\n\t\t\t\tbreak;\n\n\t\t\tcase 'component_move':\n\t\t\t\t$this->ipsclass->admin->cp_permission_check( $this->perm_main.'|'.$this->perm_child.':edit' );\n\t\t\t\t$this->components_move();\n\t\t\t\tbreak;\n\t\t\tcase 'component_toggle_enabled':\n\t\t\t\t$this->ipsclass->admin->cp_permission_check( $this->perm_main.'|'.$this->perm_child.':edit' );\n\t\t\t\t$this->components_toggle_enabled();\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$this->ipsclass->admin->cp_permission_check( $this->perm_main.'|'.$this->perm_child.':' );\n\t\t\t\t$this->components_list();\n\t\t\t\tbreak;\n\t\t}\n\t}", "public function Con_Cli(){\n // TODO\n }", "protected function __construct() {\r\r\n // contain shared code in its constructor\r\r\n parent::__construct();\t\r\r\n\t}", "function run()\n\t{\n\t\t//-----------------------------------------\n\t\t// Any \"extra\" configs required for this driver?\n\t\t//-----------------------------------------\n\t\t\n\t\tif ( is_array( $this->install->saved_data ) and count( $this->install->saved_data ) )\n\t\t{\n\t\t\tforeach( $this->install->saved_data as $k => $v )\n\t\t\t{\n\t\t\t\tif ( preg_match( \"#^__sql__#\", $k ) )\n\t\t\t\t{\n\t\t\t\t\t$k = str_replace( \"__sql__\", \"\", $k );\n\t\t\t\t\n\t\t\t\t\t$this->install->ipsclass->vars[ $k ] = $v;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t/* Switch */\n\t\tswitch( $this->install->ipsclass->input['sub'] )\n\t\t{\n\t\t\tcase 'sql':\n\t\t\t\t$this->install_sql();\n\t\t\tbreak;\n\t\t\t\n\t\t\tcase 'settings':\n\t\t\t\t$this->install_settings();\n\t\t\tbreak;\n\t\t\t\n\t\t\tcase 'acpperms':\n\t\t\t\t$this->install_acpperms();\n\t\t\tbreak;\n\t\t\t\n\t\t\tcase 'templates':\n\t\t\t\t$this->install_templates();\n\t\t\tbreak;\n\t\t\t\n\t\t\tcase 'other':\n\t\t\t\t$this->install_other();\n\t\t\tbreak;\n\t\t\t\n\t\t\tcase 'caches':\n\t\t\t\t$this->install_caches();\n\t\t\tbreak;\n\t\t\t\n\t\t\tdefault:\n\t\t\t\t/* Output */\n\t\t\t\t$this->install->template->append( $this->install->template->install_page() );\t\t\n\t\t\t\t$this->install->template->next_action = '?p=install&sub=sql';\n\t\t\t\t$this->install->template->hide_next = 1;\n\t\t\tbreak;\t\n\t\t}\n\t}", "public function main()\n\t{\n\t}", "protected function parentSetup() {\n }", "public function drushCim() {\n $config = ($this->getCim() == '' ? 'cim' : $this->getCim());\n if ($this->getXenoVersion() == '') {\n $this->_exec('docker-compose exec --user=82 php /usr/local/bin/drush cc drush');\n $this->_exec('docker-compose exec --user=82 php /usr/local/bin/drush ' . $config . ' -y');\n } else {\n $this->_exec('docker-compose exec php /usr/local/bin/drush cc drush');\n $this->_exec('docker-compose exec php /usr/local/bin/drush ' . $config . ' -y');\n }\n }", "public function run()\n {\n Model::unguard();\n\n // Create categories\n foreach ($this->categories as $name => $color) {\n $category = Category::firstOrNew(['name' => $name]);\n $category->color = $color;\n $category->save();\n }\n\n // Create priorities\n $this->call(BasicPriorities::class);\n\n // Create statuses\n $this->call(BasicStatuses::class);\n }", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "function beManaged()\n {\n }", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "protected function __construct() {\n // contain shared code in its constructor\n parent::__construct();\n }", "private function __construct() {\n\t\trequire_once \"Scripts/HTMLCleaner.php\";\n\t\trequire_once \"Scripts/ProcessProperties.php\";\n\t}", "protected function doBaseTasks()\n {\n\n $this->showTestHeadline(\"Checking application base structure\");\n\n if (HSetting::Get('secret') == \"\" || HSetting::Get('secret') == null) {\n HSetting::Set('secret', UUID::v4());\n $this->showFix('Setting missing application secret!');\n }\n }", "protected function _postExec()\n {\n }", "function drush_main() {\n require dirname(__DIR__) . '/drush.php';\n}", "public function setup()\n\t{\n\t\t// we don't do anything here in the base class\n\t}", "public function monarch()\n {\n }", "public static function pre_process() {}" ]
[ "0.5610381", "0.5461392", "0.54450387", "0.53914624", "0.53914624", "0.53914624", "0.53914624", "0.5357169", "0.53515965", "0.5323461", "0.5281525", "0.5220241", "0.5203147", "0.5193817", "0.51755863", "0.51733446", "0.5141642", "0.5130115", "0.50964534", "0.50964373", "0.50773996", "0.5076149", "0.50389916", "0.50358194", "0.50312996", "0.5017256", "0.501674", "0.50065285", "0.5006516", "0.4984671", "0.4967072", "0.49539477", "0.49534017", "0.49526265", "0.49496335", "0.49343148", "0.49331006", "0.49286875", "0.48992702", "0.48921153", "0.48921153", "0.48921153", "0.48921153", "0.48921153", "0.48921153", "0.48921153", "0.48921153", "0.48921153", "0.48921153", "0.48921153", "0.48921153", "0.48921153", "0.48921153", "0.48921153", "0.48921153", "0.48921153", "0.48921153", "0.48921153", "0.48921153", "0.48921153", "0.48921153", "0.48921153", "0.48921153", "0.48921153", "0.48921153", "0.48921153", "0.48921153", "0.48921153", "0.48921153", "0.48921153", "0.48921153", "0.48921153", "0.4891189", "0.48909846", "0.48909846", "0.48909846", "0.48909846", "0.48909846", "0.48909846", "0.48909846", "0.48909846", "0.48909846", "0.48909846", "0.48909846", "0.48909846", "0.48909846", "0.48909846", "0.48909846", "0.48909846", "0.48909846", "0.48909846", "0.48909846", "0.48908633", "0.4889408", "0.48869553", "0.48776308", "0.48766363", "0.48694986", "0.48693618", "0.48604178" ]
0.50265396
25
Adding a "Link" field to the media uploader $form_fields array
public function add_Link_field_to_media_uploader( $form_fields, $post ) { $form_fields['link_field'] = array( 'label' => __('Image Link'), 'value' => get_post_meta( $post->ID, 'space_boxes_img_link', true ), 'helps' => __('Space Boxes image link.','space-boxes') ); return $form_fields; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function attachment_video_url_edit( $form_fields, $post ) {\n $field_value = get_post_meta( $post->ID, '_attachment_video_url', true );\n $form_fields['video_url'] = array(\n 'value' => $field_value ? $field_value : '',\n 'label' => __( 'Video URL' ),\n );\n return $form_fields;\n}", "public function setFormLink($link) {\n $this->form_link = $link;\n }", "function my_attachment_fields_edit($form_fields,$post){\n $html = \"<input type='hidden' name='attachments[\".$post->ID.\"][url]' value=''/>\";\n\n $form_fields['url']['html'] = $html; //Replace html\n $form_fields['url']['label'] = ''; //Remove label\n $form_fields['url']['helps'] ='';//Remove help text\n\n return $form_fields;\n}", "public function uploadlink() {\n $defaults = array();\n\n $defaults[\"straat\"] = \"straatnaam of de naam van de buurt\";\n $defaults[\"huisnummer\"] = \"huisnummer\";\n $defaults[\"maker\"] = \"maker\";\n $defaults[\"personen\"] = \"namen\";\n $defaults[\"datum\"] = \"datum of indicatie\";\n $defaults[\"titel\"] = \"titel\";\n $defaults[\"naam\"] = \"Je naam\";\n $defaults[\"email\"] = \"Je e-mailadres\";\n $defaults[\"tags\"] = \"\";\n\n $this->set('defaults', $defaults);\n }", "public function add_Link_field_to_media_uploader_save( $post, $attachment ) {\n\t\tif ( ! empty( $attachment['link_field'] ) ) \n\t\t\tupdate_post_meta( $post['ID'], 'space_boxes_img_link', $attachment['link_field'] );\n\t\telse\n\t\t\tdelete_post_meta( $post['ID'], 'space_boxes_img_link' );\n\n\t\treturn $post;\n\t}", "function formLink(){\n\t\t$yuiSuggest = &weSuggest::getInstance();\n\n\t\t$textname = 'we_' . $this->Name . '_txt[LinkPath]';\n\t\t$idname = 'we_' . $this->Name . '_txt[LinkID]';\n\t\t$extname = 'we_' . $this->Name . '_txt[LinkHref]';\n\t\t$linkType = $this->getElement('LinkType') ? : 'no';\n\t\t$linkPath = f('SELECT Path FROM ' . FILE_TABLE . ' WHERE ID = ' . intval($this->getElement('LinkID')), '', $this->DB_WE);\n\n\t\t$RollOverFlagName = 'we_' . $this->Name . '_txt[RollOverFlag]';\n\t\t$RollOverFlag = $this->getElement('RollOverFlag') ? 1 : 0;\n\t\t$RollOverIDName = 'we_' . $this->Name . '_txt[RollOverID]';\n\t\t$RollOverID = $this->getElement('RollOverID') ? : '';\n\t\t$RollOverPathname = 'we_' . $this->Name . '_txt[RollOverPath]';\n\t\t$RollOverPath = f('SELECT Path FROM ' . FILE_TABLE . ' WHERE ID = ' . intval($RollOverID), '', $this->DB_WE);\n\n\t\t$checkFlagName = 'check_' . $this->Name . '_RollOverFlag';\n\t\t$cmd1 = \"document.we_form.elements['\" . $idname . \"'].value\";\n\t\t$but1 = we_html_button::create_button(we_html_button::SELECT, \"javascript:we_cmd('we_selector_document', \" . $cmd1 . \",'\" . FILE_TABLE . \"','\" . we_base_request::encCmd($cmd1) . \"','\" . we_base_request::encCmd(\"document.we_form.elements['\" . $textname . \"'].value\") . \"','\" . we_base_request::encCmd(\"opener._EditorFrame.setEditorIsHot(true);opener.document.we_form.elements['we_\" . $this->Name . \"_txt[LinkType]'][2].checked=true;\") . \"','',0,'',\" . (permissionhandler::hasPerm(\"CAN_SELECT_OTHER_USERS_FILES\") ? 0 : 1) . \");\");\n\n\t\t$cmd1 = \"document.we_form.elements['\" . $RollOverIDName . \"'].value\";\n\t\t$but2 = we_html_button::create_button(we_html_button::SELECT, \"javascript:we_cmd('we_selector_image', \" . $cmd1 . \",'\" . FILE_TABLE . \"','\" . we_base_request::encCmd($cmd1) . \"','\" . we_base_request::encCmd(\"document.we_form.elements['\" . $RollOverPathname . \"'].value\") . \"','\" . we_base_request::encCmd(\"opener._EditorFrame.setEditorIsHot(true);opener.document.we_form.elements['\" . $RollOverFlagName . \"'].value=1;opener.document.we_form.elements['\" . $checkFlagName . \"'].checked=true;\") . \"','',0,'\" . we_base_ContentTypes::IMAGE . \"',\" . (permissionhandler::hasPerm(\"CAN_SELECT_OTHER_USERS_FILES\") ? 0 : 1) . \");\");\n\n\n\t\t$cmd1 = \"document.we_form.elements['\" . $extname . \"'].value\";\n\t\t$butExt = permissionhandler::hasPerm('CAN_SELECT_EXTERNAL_FILES') ?\n\t\t\twe_html_button::create_button(we_html_button::SELECT, \"javascript:we_cmd('browse_server','\" . we_base_request::encCmd($cmd1) . \"','',\" . $cmd1 . \",'\" . we_base_request::encCmd(\"opener._EditorFrame.setEditorIsHot(true);opener.document.we_form.elements['we_\" . $this->Name . \"_txt[LinkType]'][1].checked=true;\") . \"')\") : \"\";\n\n\t\tif(defined('OBJECT_TABLE')){\n\t\t\t$objidname = 'we_' . $this->Name . '_txt[ObjID]';\n\t\t\t$objtextname = 'we_' . $this->Name . '_txt[ObjPath]';\n\t\t\t$objPath = f('SELECT Path FROM ' . OBJECT_FILES_TABLE . ' WHERE ID = ' . intval($this->getElement('ObjID')), '', $this->DB_WE);\n\t\t\t$cmd1 = \"document.we_form.elements['\" . $objidname . \"'].value\";\n\t\t\t$butObj = we_html_button::create_button(we_html_button::SELECT, \"javascript:we_cmd('we_selector_document',\" . $cmd1 . \",'\" . OBJECT_FILES_TABLE . \"','\" . we_base_request::encCmd($cmd1) . \"','\" . we_base_request::encCmd(\"document.we_form.elements['\" . $objtextname . \"'].value\") . \"','\" . we_base_request::encCmd(\"opener._EditorFrame.setEditorIsHot(true);opener.document.we_form.elements['we_\" . $this->Name . \"_txt[LinkType]'][3].checked=true;\") . \"','','','objectFile',\" . (permissionhandler::hasPerm(\"CAN_SELECT_OTHER_USERS_OBJECTS\") ? 0 : 1) . \");\");\n\t\t}\n\n\t\t// Create table\n\t\t$_content = new we_html_table(array('class' => 'default'), (defined('OBJECT_TABLE') ? 11 : 9), 2);\n\t\t$row = 0;\n\t\t// No link\n\t\t$_content->setCol($row, 0, array('style' => 'vertical-align:top;padding-bottom:10px;'), we_html_forms::radiobutton('no', ($linkType === 'no'), 'we_' . $this->Name . '_txt[LinkType]', g_l('weClass', '[nolink]'), true, 'defaultfont', '_EditorFrame.setEditorIsHot(true);'));\n\t\t$_content->setCol($row++, 1, null, '');\n\n\t\t// External link\n\t\t$_ext_link_table = new we_html_table(array('class' => 'default'), 1, 2);\n\n\t\t$_ext_link_table->setCol(0, 0, null, $this->htmlTextInput('we_' . $this->Name . '_txt[LinkHref]', 25, $this->getElement('LinkHref'), '', 'onchange=\"_EditorFrame.setEditorIsHot(true);\"', \"text\", 280));\n\t\t$_ext_link_table->setCol(0, 1, null, $butExt);\n\n\t\t$_ext_link = \"href\" . we_html_element::htmlBr() . $_ext_link_table->getHtml();\n\n\t\t$_content->setCol($row, 0, array('style' => 'vertical-align:top;padding-bottom:10px;'), we_html_forms::radiobutton(we_base_link::TYPE_EXT, ($linkType == we_base_link::TYPE_EXT), 'we_' . $this->Name . '_txt[LinkType]', g_l('weClass', '[extern]'), true, 'defaultfont', '_EditorFrame.setEditorIsHot(true)'));\n\t\t$_content->setCol($row++, 1, array('class' => 'defaultfont', 'style' => 'vertical-align:top'), $_ext_link);\n\n\n\t\t// Internal link\n\t\t$yuiSuggest->setAcId('internalPath');\n\t\t$yuiSuggest->setContentType(implode(',', array(we_base_ContentTypes::FOLDER, we_base_ContentTypes::WEDOCUMENT, we_base_ContentTypes::IMAGE, we_base_ContentTypes::JS, we_base_ContentTypes::CSS, we_base_ContentTypes::HTML, we_base_ContentTypes::APPLICATION, we_base_ContentTypes::QUICKTIME)));\n\t\t$yuiSuggest->setInput($textname, $linkPath);\n\t\t$yuiSuggest->setResult($idname, $this->getElement('LinkID'));\n\t\t$yuiSuggest->setTable(FILE_TABLE);\n\t\t$yuiSuggest->setSelectButton($but1);\n\t\t$yuiSuggest->setMaxResults(10);\n\t\t$yuiSuggest->setMayBeEmpty(0);\n\t\t$yuiSuggest->setWidth(280);\n\t\t$yuiSuggest->setSelector(weSuggest::DocSelector);\n\t\t$yuiSuggest->setLabel('href');\n\t\t$_int_link = $yuiSuggest->getHTML();\n\n\t\t$_content->setCol($row, 0, array('style' => 'vertical-align:top'), we_html_forms::radiobutton(we_base_link::TYPE_INT, ($linkType == we_base_link::TYPE_INT), 'we_' . $this->Name . '_txt[LinkType]', g_l('weClass', '[intern]'), true, 'defaultfont', '_EditorFrame.setEditorIsHot(true);'));\n\t\t$_content->setCol($row++, 1, array('class' => 'defaultfont', 'style' => 'vertical-align:top'), $_int_link);\n\n\t\t// Object link\n\t\tif(defined('OBJECT_TABLE')){\n\n\t\t\t$yuiSuggest->setAcId('objPathLink');\n\t\t\t$yuiSuggest->setContentType(\"folder,\" . we_base_ContentTypes::OBJECT_FILE);\n\t\t\t$yuiSuggest->setInput($objtextname, $objPath);\n\t\t\t$yuiSuggest->setResult($objidname, $this->getElement('ObjID'));\n\t\t\t$yuiSuggest->setTable(OBJECT_FILES_TABLE);\n\t\t\t$yuiSuggest->setSelectButton($butObj);\n\t\t\t$yuiSuggest->setMaxResults(10);\n\t\t\t$yuiSuggest->setMayBeEmpty(0);\n\t\t\t$yuiSuggest->setWidth(280);\n\t\t\t$yuiSuggest->setSelector(weSuggest::DocSelector);\n\t\t\t$yuiSuggest->setLabel('href');\n\t\t\t$_obj_link = $yuiSuggest->getHTML();\n\n\n\t\t\t$_content->setCol($row, 0, array('style' => 'vertical-align:top;padding-top:10px;'), we_html_forms::radiobutton(we_base_link::TYPE_OBJ, ($linkType == we_base_link::TYPE_OBJ), 'we_' . $this->Name . '_txt[LinkType]', g_l('linklistEdit', '[objectFile]'), true, 'defaultfont', '_EditorFrame.setEditorIsHot(true);'));\n\t\t\t$_content->setCol($row++, 1, array('class' => 'defaultfont', 'style' => 'vertical-align:top'), $_obj_link);\n\t\t}\n\n\t\t// Target\n\t\t$_content->setCol($row++, 0, array('colspan' => 2, 'class' => 'defaultfont', 'style' => 'vertical-align:top;padding:20px 0px;'), g_l('weClass', '[target]') . we_html_element::htmlBr() . we_html_tools::targetBox('we_' . $this->Name . '_txt[LinkTarget]', 33, 0, '', $this->getElement('LinkTarget'), '_EditorFrame.setEditorIsHot(true);', 20, 97));\n\n\n\t\t// Rollover image\n\t\t$yuiSuggest->setAcId('rollOverPath');\n\t\t$yuiSuggest->setContentType(implode(',', array(we_base_ContentTypes::FOLDER, we_base_ContentTypes::WEDOCUMENT, we_base_ContentTypes::IMAGE, we_base_ContentTypes::JS, we_base_ContentTypes::CSS, we_base_ContentTypes::HTML, we_base_ContentTypes::APPLICATION, we_base_ContentTypes::QUICKTIME)));\n\t\t$yuiSuggest->setInput($RollOverPathname, $RollOverPath);\n\t\t$yuiSuggest->setResult($RollOverIDName, $RollOverID);\n\t\t$yuiSuggest->setTable(FILE_TABLE);\n\t\t$yuiSuggest->setSelectButton($but2);\n\t\t$yuiSuggest->setMaxResults(10);\n\t\t$yuiSuggest->setMayBeEmpty(0);\n\t\t$yuiSuggest->setWidth(280);\n\t\t$yuiSuggest->setSelector(weSuggest::DocSelector);\n\t\t$yuiSuggest->setLabel('href');\n\t\t$_rollover = $yuiSuggest->getHTML();\n\n\t\t$_content->setCol($row, 0, array('style' => 'vertical-align:top'), we_html_forms::checkbox(1, $RollOverFlag, $checkFlagName, 'Roll Over', false, 'defaultfont', \"_EditorFrame.setEditorIsHot(true); this.form.elements['\" . $RollOverFlagName . \"'].value = (this.checked ? 1 : 0); \") . we_html_element::htmlHidden($RollOverFlagName, $RollOverFlag));\n\t\t$_content->setCol($row, 1, array('class' => 'defaultfont', 'style' => 'vertical-align:top'), $_rollover);\n\n\t\treturn $_content->getHtml();\n\t}", "function options_form(&$form, &$form_state) {\n $form['link_to_record'] = array(\n '#title' => t('Link this field to the record edit form'),\n '#description' => t(\"Enable to override this field's links.\"),\n '#type' => 'checkbox',\n '#default_value' => !empty($this->options['link_to_record']),\n );\n\n parent::options_form($form, $form_state);\n \n \n }", "function dblions_fb_link() {\n\t$fblink = esc_attr( get_option( 'facebook_link' ) );\n\tcreate_input_field( array(\n\t\t\t'facebook_link', 'text', \n\t\t\t$fblink, 'Facebook Link'\n\t\t) );\n}", "public function add_media_button(){\n\t\tif ( current_user_can( 'vfb_view_entries' ) ) :\n?>\n\t\t\t<a href=\"<?php echo add_query_arg( array( 'action' => 'visual_form_builder_media_button', 'width' => '450' ), admin_url( 'admin-ajax.php' ) ); ?>\" class=\"button add_media thickbox\" title=\"Add Visual Form Builder form\">\n\t\t\t\t<img width=\"18\" height=\"18\" src=\"<?php echo plugins_url( 'visual-form-builder-pro/images/vfb_icon.png' ); ?>\" alt=\"<?php _e( 'Add Visual Form Builder form', 'visual-form-builder-pro' ); ?>\" style=\"vertical-align: middle; margin-left: -8px; margin-top: -2px;\" /> <?php _e( 'Add Form', 'visual-form-builder-pro' ); ?>\n\t\t\t</a>\n<?php\n\t\tendif;\n\t}", "function uultra_new_links_add_form()\r\n\t{\r\n\t\t\r\n\t\t$meta = 'uultra_link_content';\r\n\t\t$html = '<div id=\"#uultra-add-links-box\" class=\"uultra-links-content-edition-box \" title=\"Add New Link\">';\r\n\t\t\r\n\t\t$html .= '<input name=\"uultra-current-selected-widget-to-edit\" id=\"uultra-current-selected-widget-to-edit\" type=\"hidden\" />';\r\n\t\t\r\n\t\t\r\n\t\t$html .= '<table width=\"100%\" border=\"0\" cellspacing=\"2\" cellpadding=\"3\">\r\n\t\t\t<tr>\r\n\t\t\t\t<td width=\"50%\"> '.__(\"Name: \",'xoousers').'</td>\r\n\t\t\t\t<td width=\"50%\"><input name=\"uultra_link_title\" type=\"text\" id=\"uultra_link_title\" /> \r\n\t\t </td>\r\n\t\t </tr>\r\n\t\t <tr>\r\n\t\t\t\t<td width=\"50%\"> '.__(\"Slug: \",'xoousers').'</td>\r\n\t\t\t\t<td width=\"50%\"><input name=\"uultra_link_slug\" type=\"text\" id=\"uultra_link_slug\" /> \r\n\t\t </td>\r\n\t\t </tr>\r\n\t\t <tr>\r\n\t\t\t\t<td width=\"50%\"> '.__('Type:','xoousers').'</td>\r\n\t\t\t\t<td width=\"50%\">\r\n\t\t\t\t<select name=\"uultra_link_type\" id=\"uultra_link_type\" size=\"1\">\r\n\t\t\t\t <option value=\"\" selected=\"selected\">'.__(\"Select Type: \",'xoousers').'</option>\r\n\t\t\t\t <option value=\"1\">'.__(\"Text: \",'xoousers').'</option>\r\n\t\t\t\t <option value=\"2\">Shortcode</option>\r\n\t\t\t\t</select>\r\n\r\n\t\t </td>\r\n\t\t\t </tr>\r\n\t\t\t\t\t \r\n\t\t\t <tr>\r\n\t\t\t\t<td>'.__('Content:','xoousers').'</td>\r\n\t\t\t\t<td>&nbsp;</textarea> \r\n\t\t\t </td>\r\n\t\t\t </tr>\r\n\t\t\t\r\n\t\t\t \r\n\t\t\t</table> '; \t\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t$html .= '<div class=\"uultra-field-msbox-div-history\" id=\"uultra-msg-history-list\">';\r\n\t\t\r\n\t\t$html .= $this->uultra_get_addlink_html_form($meta, $content);\r\n\t\t\r\n\t\t$html .= '</div>';\t\r\n\t\t\r\n\t\t\r\n\t\t\t \r\n\t\t$html .= ' <p class=\"submit\">\r\n\t\t\t\t\t<input type=\"button\" name=\"submit\" class=\"button uultra-links-add-new-close\" value=\"'.__('Close','xoousers').'\" /> <input type=\"button\" name=\"submit\" class=\"button button-primary uultra-links-add-new-confirm\" value=\"'.__('Submit','xoousers').'\" /> <span id=\"uultra-add-new-links-m-w\" ></span>\r\n\t\t\t\t</p> ';\t\t\r\n\t\t$html .= '</div>';\t\t\r\n\t\t\t\r\n\t\treturn $html;\r\n\t}", "function addLinkToField($fieldName,$renderClass=\"\"){\r\n\t\t$this->fieldsToLink[$fieldName]=$renderClass;\r\n\t}", "function create_field($field)\t{\n\t\t// vars\n $field['value'] = (array) $field['value'];\n\n\t\t$target = isset($field['value']['target']) ? $field['value']['target'] : ( isset($field['default_target']) ? $field['default_target'] : '_self');\n $class = isset($field['value']['class']) ? $field['value']['class'] : '';\n \n\t\t// html\n ?>\n <div class=\"acf-link-field-primary-row\">\n <label class=\"inline\"><?php _e('Text'); ?>:</label>\n <input type=\"text\" name=\"<?php echo $field['name']; ?>[text]\" value=\"<?php echo $field['value']['text']; ?>\" />\n\n <label class=\"inline\"><?php _e('URL'); ?>:</label>\n <input type=\"text\" name=\"<?php echo $field['name']; ?>[url]\" value=\"<?php echo $field['value']['url']; ?>\" />\n </div>\n\n <?php if( $field['show_title'] || $field['show_target'] || count($field['classes']) ): ?>\n <div class=\"acf-link-field-secondary-row\">\n <?php if( $field['show_title']): ?>\n <label class=\"inline\">Title Attribute</label>\n <input type=\"text\" name=\"<?php echo $field['name']; ?>[title]\" value=\"<?php echo $field['value']['title']; ?>\" />\n <?php endif; ?>\n\n <?php if( $field['show_target']): ?>\n <label class=\"inline\"><?php _e('Target'); ?></label>\n <select name=\"<?php echo $field['name']; ?>[target]\">\n <?php foreach( ACF_Link_Field::$targets as $k => $l ): ?>\n <option value=\"<?php echo $k; ?>\" <?php if($k == $target) echo 'selected=\"selected\"'; ?>><?php _e($l); ?></option>\n <?php endforeach; ?>\n </select>\n <?php endif; ?>\n\n <?php if( count($field['classes']) ): ?>\n <label class=\"inline\"><?php _e('Style'); ?></label>\n <select name=\"<?php echo $field['name']; ?>[class]\">\n <option value=\"\" <?php if(empty($class)) echo 'selected=\"selected\"'; ?>><?php _e('Default'); ?></option>\n <?php foreach( $field['classes'] as $c => $l ): ?>\n <option value=\"<?php echo $c; ?>\" <?php if($c == $class) echo 'selected=\"selected\"'; ?>><?php _e($l); ?></option>\n <?php endforeach; ?>\n </select>\n <?php endif; ?>\n </div>\n <?php endif; \n\t}", "public function append_media_upload_form() {\n \n ?>\n <!-- Add from Media Library -->\n <a href=\"#\" class=\"envira-media-library button\" title=\"<?php _e( 'Click Here to Insert from Other Image Sources', 'envira-gallery' ); ?>\" style=\"vertical-align: baseline;\">\n <?php _e( 'Select Files from Other Sources', 'envira-gallery' ); ?>\n </a>\n\n <!-- Progress Bar -->\n <div class=\"envira-progress-bar\">\n <div class=\"envira-progress-bar-inner\"></div>\n <div class=\"envira-progress-bar-status\">\n <span class=\"uploading\">\n <?php _e( 'Uploading Image', 'envira-gallery' ); ?>\n <span class=\"current\">1</span>\n <?php _e( 'of', 'envira-gallery' ); ?>\n <span class=\"total\">3</span>\n </span>\n\n <span class=\"done\"><?php _e( 'All images uploaded.', 'envira-gallery' ); ?></span>\n </div>\n </div>\n <?php\n\n }", "function image_link_input_fields($post, $url_type = '')\n {\n }", "function formLink() {\n\t\tglobal $l_we_class;\n\n\t\t$we_button = new we_button();\n\n\t\t$textname = 'we_' . $this->Name . '_txt[LinkPath]';\n\t\t$idname = 'we_' . $this->Name . '_txt[LinkID]';\n\t\t$extname = 'we_' . $this->Name . '_txt[LinkHref]';\n\t\t$linkType = $this->getElement(\"LinkType\") ? $this->getElement(\"LinkType\") : \"no\";\n\t\t$linkPath = f(\"SELECT Path FROM \" . FILE_TABLE . \" WHERE ID = '\" . $this->getElement(\"LinkID\") . \"'\", \"Path\", $this->DB_WE);\n\n\t\t$RollOverFlagName = \"we_\" . $this->Name . \"_txt[RollOverFlag]\";\n\t\t$RollOverFlag = $this->getElement(\"RollOverFlag\") ? 1 : 0;\n\t\t$RollOverIDName = 'we_' . $this->Name . '_txt[RollOverID]';\n\t\t$RollOverID= $this->getElement(\"RollOverID\") ? $this->getElement(\"RollOverID\") : \"\";\n\t\t$RollOverPathname = 'we_' . $this->Name . '_txt[RollOverPath]';\n\t\t$RollOverPath = f(\"SELECT Path FROM \" . FILE_TABLE . \" WHERE ID = '$RollOverID='\", \"Path\", $this->DB_WE);\n\n\t\t$checkFlagName = \"check_\" . $this->Name . \"_RollOverFlag\";\n\n\t\t$but1 = $we_button->create_button(\"select\", \"javascript:we_cmd('openDocselector', document.forms['we_form'].elements['$idname'].value,'\" . FILE_TABLE . \"','document.forms[\\'we_form\\'].elements[\\'$idname\\'].value','document.forms[\\'we_form\\'].elements[\\'$textname\\'].value','opener._EditorFrame.setEditorIsHot(true);opener.document.we_form.elements[\\\\'we_\".$this->Name.\"_txt[LinkType]\\\\'][2].checked=true;','',0,'',\".(we_hasPerm(\"CAN_SELECT_OTHER_USERS_FILES\") ? 0 : 1).\");\");\n\t\t$but2 = $we_button->create_button(\"select\", \"javascript:we_cmd('openDocselector', document.forms['we_form'].elements['$RollOverIDName'].value,'\" . FILE_TABLE . \"','document.forms[\\'we_form\\'].elements[\\'$RollOverIDName\\'].value','document.forms[\\'we_form\\'].elements[\\'$RollOverPathname\\'].value','opener._EditorFrame.setEditorIsHot(true);opener.document.we_form.elements[\\'$RollOverFlagName\\'].value=1;opener.document.we_form.elements[\\'$checkFlagName\\'].checked=true;','',0,'image/*',\".(we_hasPerm(\"CAN_SELECT_OTHER_USERS_FILES\") ? 0 : 1).\");\");\n\n\t\t$butExt = we_hasPerm(\"CAN_SELECT_EXTERNAL_FILES\") ?\n\t\t\t\t\t$we_button->create_button(\"select\", \"javascript:we_cmd('browse_server','document.forms[\\'we_form\\'].elements[\\'$extname\\'].value','',document.forms['we_form'].elements['$extname'].value,'opener._EditorFrame.setEditorIsHot(true);opener.document.we_form.elements[\\\\'we_\".$this->Name.\"_txt[LinkType]\\\\'][1].checked=true;')\")\n\t\t\t\t\t:\t\"\";\n\n\t\tif(defined(\"OBJECT_TABLE\")) {\n\t\t\t$objidname = 'we_' . $this->Name . '_txt[ObjID]';\n\t\t\t$objtextname = 'we_' . $this->Name . '_txt[ObjPath]';\n\t\t\t$objPath = f(\"SELECT Path FROM \" . OBJECT_FILES_TABLE . \" WHERE ID = '\".abs($this->getElement(\"ObjID\")).\"'\", \"Path\", $this->DB_WE);\n\t\t\t$butObj = $we_button->create_button(\"select\", \"javascript:we_cmd('openDocselector',document.forms['we_form'].elements['$objidname'].value,'\" . OBJECT_FILES_TABLE . \"','document.forms[\\'we_form\\'].elements[\\'$objidname\\'].value','document.forms[\\'we_form\\'].elements[\\'$objtextname\\'].value','opener._EditorFrame.setEditorIsHot(true);opener.document.we_form.elements[\\\\'we_\".$this->Name.\"_txt[LinkType]\\\\'][3].checked=true;','','','objectFile',\".(we_hasPerm(\"CAN_SELECT_OTHER_USERS_OBJECTS\") ? 0 : 1).\");\");\n\t\t}\n\n\t\t// Create table\n\t\t$_content = new we_htmlTable(array(\"border\" => 0, \"cellpadding\" => 0, \"cellspacing\" => 0), (defined(\"OBJECT_TABLE\") ? 11 : 9), 2);\n\n\t\t// No link\n\t\t$_content->setCol(0, 0, array(\"valign\" => \"top\"), we_forms::radiobutton(\"no\", ($linkType == \"no\"), \"we_\" . $this->Name . \"_txt[LinkType]\", $l_we_class[\"nolink\"], true, \"defaultfont\", \"_EditorFrame.setEditorIsHot(true);\"));\n\t\t$_content->setCol(0, 1, null, \"\");\n\n\t\t// Space\n\t\t$_content->setCol(1, 0, null, getPixel(100, 10));\n\t\t$_content->setCol(1, 1, null, getPixel(400, 10));\n\n\t\t// External link\n\t\t$_ext_link_table = new we_htmlTable(array(\"border\" => 0, \"cellpadding\" => 0, \"cellspacing\" => 0), 1, 3);\n\n\t\t$_ext_link_table->setCol(0, 0, null, $this->htmlTextInput(\"we_\" . $this->Name . \"_txt[LinkHref]\", 25, $this->getElement(\"LinkHref\"), \"\", 'onchange=\"_EditorFrame.setEditorIsHot(true);\"', \"text\", 280));\n\t\t$_ext_link_table->setCol(0, 1, null, getPixel(20, 1));\n\t\t$_ext_link_table->setCol(0, 2, null, $butExt);\n\n\t\t$_ext_link = \"href\" . we_htmlElement::htmlBr() . $_ext_link_table->getHtmlCode();\n\n\t\t$_content->setCol(2, 0, array(\"valign\" => \"top\"), we_forms::radiobutton(\"ext\", ($linkType == \"ext\"), \"we_\" . $this->Name . \"_txt[LinkType]\", $l_we_class[\"extern\"], true, \"defaultfont\", \"_EditorFrame.setEditorIsHot(true)\"));\n\t\t$_content->setCol(2, 1, array(\"class\" => \"defaultfont\", \"valign\" => \"top\"), $_ext_link);\n\n\t\t// Space\n\t\t$_content->setCol(3, 0, null, getPixel(100, 10));\n\t\t$_content->setCol(3, 1, null, getPixel(400, 10));\n\n\t\t// Internal link\n\t\t$_int_link_table = new we_htmlTable(array(\"border\" => 0, \"cellpadding\" => 0, \"cellspacing\" => 0), 1, 3);\n\n\t\t$_int_link_table->setCol(0, 0, null, $this->htmlTextInput($textname, 25, $linkPath, \"\", 'onkeydown=\"return false\"', \"text\", 280));\n\t\t$_int_link_table->setCol(0, 1, null, getPixel(20, 1));\n\t\t$_int_link_table->setCol(0, 2, null, $this->htmlHidden($idname, $this->getElement(\"LinkID\")) . $but1);\n\n\t\t$_int_link = \"href\" . we_htmlElement::htmlBr() . $_int_link_table->getHtmlCode();\n\n\t\t$_content->setCol(4, 0, array(\"valign\" => \"top\"), we_forms::radiobutton(\"int\", ($linkType == \"int\"), \"we_\" . $this->Name . \"_txt[LinkType]\", $l_we_class[\"intern\"], true, \"defaultfont\", \"_EditorFrame.setEditorIsHot(true);\"));\n\t\t$_content->setCol(4, 1, array(\"class\" => \"defaultfont\", \"valign\" => \"top\"), $_int_link);\n\n\t\t// Object link\n\t\tif (defined(\"OBJECT_TABLE\")) {\n\t\t\t$_content->setCol(5, 0, null, getPixel(100, 10));\n\t\t\t$_content->setCol(5, 1, null, getPixel(400, 10));\n\n\t\t\t$_obj_link_table = new we_htmlTable(array(\"border\" => 0, \"cellpadding\" => 0, \"cellspacing\" => 0), 1, 3);\n\n\t\t\t$_obj_link_table->setCol(0, 0, null, $this->htmlTextInput($objtextname, 25, $objPath, \"\", 'onkeydown=\"return false\"', \"text\", 280));\n\t\t\t$_obj_link_table->setCol(0, 1, null, getPixel(20, 1));\n\t\t\t$_obj_link_table->setCol(0, 2, null, $this->htmlHidden($objidname, $this->getElement(\"ObjID\")) . $butObj);\n\n\t\t\t$_obj_link = \"href\" . we_htmlElement::htmlBr() . $_obj_link_table->getHtmlCode();\n\n\t\t\t$_content->setCol(6, 0, array(\"valign\" => \"top\"), we_forms::radiobutton(\"obj\", ($linkType == \"obj\"), \"we_\" . $this->Name . \"_txt[LinkType]\", $GLOBALS[\"l_linklist_edit\"][\"objectFile\"], true, \"defaultfont\", \"_EditorFrame.setEditorIsHot(true);\"));\n\t\t\t$_content->setCol(6, 1, array(\"class\" => \"defaultfont\", \"valign\" => \"top\"), $_obj_link);\n\t\t}\n\n\t\t// Space\n\t\t$_content->setCol((defined(\"OBJECT_TABLE\") ? 7 : 5), 0, null, getPixel(100, 20));\n\t\t$_content->setCol((defined(\"OBJECT_TABLE\") ? 7 : 5), 1, null, getPixel(400, 20));\n\n\t\t// Target\n\t\t$_content->setCol((defined(\"OBJECT_TABLE\") ? 8 : 6), 0, array(\"colspan\" => 2, \"class\" => \"defaultfont\", \"valign\" => \"top\"), $l_we_class[\"target\"] . we_htmlElement::htmlBr() . targetBox(\"we_\" . $this->Name . \"_txt[LinkTarget]\", 33, 380, \"\", $this->getElement(\"LinkTarget\"), \"_EditorFrame.setEditorIsHot(true);\", 20, 97));\n\n\t\t// Space\n\t\t$_content->setCol((defined(\"OBJECT_TABLE\") ? 9 : 7), 0, null, getPixel(100, 20));\n\t\t$_content->setCol((defined(\"OBJECT_TABLE\") ? 9 : 7), 1, null, getPixel(400, 20));\n\n\t\t// Rollover image\n\t\t$_rollover_table = new we_htmlTable(array(\"border\" => 0, \"cellpadding\" => 0, \"cellspacing\" => 0), 1, 3);\n\n\t\t$_rollover_table->setCol(0, 0, null, $this->htmlTextInput($RollOverPathname, 25, $RollOverPath, \"\", 'onkeydown=\"return false\"', \"text\", 280));\n\t\t$_rollover_table->setCol(0, 1, null, getPixel(20, 1));\n\t\t$_rollover_table->setCol(0, 2, null, $this->htmlHidden($RollOverIDName, $RollOverID) . $but2);\n\n\t\t$_rollover = \"href\" . we_htmlElement::htmlBr() . $_rollover_table->getHtmlCode();\n\n\t\t$_content->setCol((defined(\"OBJECT_TABLE\") ? 10 : 8), 0, array(\"valign\" => \"top\"), we_forms::checkbox(1, $RollOverFlag, $checkFlagName, \"Roll Over\", false, \"defaultfont\", \"_EditorFrame.setEditorIsHot(true); this.form.elements['$RollOverFlagName'].value = (this.checked ? 1 : 0); \") . $this->htmlHidden($RollOverFlagName, $RollOverFlag));\n\t\t$_content->setCol((defined(\"OBJECT_TABLE\") ? 10 : 8), 1, array(\"class\" => \"defaultfont\", \"valign\" => \"top\"), $_rollover);\n\n\t\treturn $_content->getHtmlCode();\n\t}", "function photo_reference_import_add_form() {\r\n \r\n global $base_url;\r\n $languageArray = get_languages();\r\n \r\n $adminRenamePath = ((variable_get('rename_admin_path') != NULL) ? variable_get('rename_admin_path_value') : 'admin');\r\n\r\n $form = array('#attributes' => array('enctype' => \"multipart/form-data\", \"class\" => \"ghpForm\"));\r\n\r\n $form['photo_reference_csv'] = array(\r\n '#type' => 'file',\r\n '#title' => t('Upload Photo Other Reference: <span title=\"This field is required.\" class=\"form-required\">*</span>'),\r\n '#description' => t('Allowed file .csv only.').'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href=\"'.$base_url.'/'.$adminRenamePath.'/download_sample_csv/photo_reference_content_import\">Download Sample CSV</a>',\r\n '#size' => 20,\r\n );\r\n\r\n $form['submit'] = array('#type' => 'submit',\r\n '#value' => t('Save'),\r\n );\r\n return $form;\r\n}", "public function addFieldLinks(&$variables) {\n $element = &$variables['element'];\n /** @var ContentEntityInterface $entity */\n $entity = $element['#object'];\n $field_name = $element['#field_name'];\n $field_definition = $entity->getFieldDefinition($field_name);\n if ($field_definition->isDisplayConfigurable('view')) {\n $element['#contextual_links']['config_quickedit_field'] = [\n 'route_parameters' => [\n 'entity_type_id' => $entity->getEntityTypeId(),\n 'bundle' => $entity->bundle(),\n 'view_mode_name' => $element['#view_mode'],\n 'field_name' => $field_name,\n ],\n ];\n $element['contextual_links'] = array(\n '#type' => 'contextual_links_placeholder',\n '#id' => _contextual_links_to_id($element['#contextual_links']),\n );\n $element['#attached']['library'][] = 'config_quickedit/config_quickedit';\n }\n }", "function wp_media_insert_url_form($default_view = 'image')\n {\n }", "function media_single_attachment_fields_to_edit($form_fields, $post)\n {\n }", "function ptf_social_controls_fields( $fields ) {\n \n // Show RSS Icon?\n $fields[] = array(\n 'type' => 'toggle',\n 'settings' => 'ptf_show_rss_icon',\n 'label' => __( 'Show RSS Icon', 'artcore' ),\n 'description' => __( 'Check this option to show/hide the rss icon.', 'artcore' ),\n 'help' => '',\n 'section' => 'ptf_social_options',\n 'default' => '1',\n 'priority' => 10,\n );\n \n // Facebook URL\n $fields[] = array(\n 'type' => 'text',\n 'settings' => 'ptf_facebook_url',\n 'label' => __( 'Facebook', 'artcore' ),\n 'description' => __( 'Enter your facebook url below.', 'artcore' ),\n 'help' => '',\n 'section' => 'ptf_social_options',\n 'default' => '#',\n 'priority' => 10,\n );\n \n // Twitter URL\n $fields[] = array(\n 'type' => 'text',\n 'settings' => 'ptf_twitter_url',\n 'label' => __( 'Twitter', 'artcore' ),\n 'description' => __( 'Enter your twitter url below.', 'artcore' ),\n 'help' => '',\n 'section' => 'ptf_social_options',\n 'default' => '#',\n 'priority' => 10,\n );\n \n // Linkedin URL\n $fields[] = array(\n 'type' => 'text',\n 'settings' => 'ptf_linkedin_url',\n 'label' => __( 'LinkedIn', 'artcore' ),\n 'description' => __( 'Enter your linkedin url below.', 'artcore' ),\n 'help' => '',\n 'section' => 'ptf_social_options',\n 'default' => '#',\n 'priority' => 10,\n );\n \n // Flickr URL\n $fields[] = array(\n 'type' => 'text',\n 'settings' => 'ptf_flickr_url',\n 'label' => __( 'Flickr', 'artcore' ),\n 'description' => __( 'Enter your flickr url below.', 'artcore' ),\n 'help' => '',\n 'section' => 'ptf_social_options',\n 'default' => '#',\n 'priority' => 10,\n );\n \n // Youtube URL\n $fields[] = array(\n 'type' => 'text',\n 'settings' => 'ptf_youtube_url',\n 'label' => __( 'Youtube', 'artcore' ),\n 'description' => __( 'Enter your youtube url below.', 'artcore' ),\n 'help' => '',\n 'section' => 'ptf_social_options',\n 'default' => '#',\n 'priority' => 10,\n );\n \n // Instagram URL\n $fields[] = array(\n 'type' => 'text',\n 'settings' => 'ptf_instagram_url',\n 'label' => __( 'Instagram', 'artcore' ),\n 'description' => __( 'Enter your instagram url below.', 'artcore' ),\n 'help' => '',\n 'section' => 'ptf_social_options',\n 'default' => '#',\n 'priority' => 10,\n );\n \n // Google+ URL\n $fields[] = array(\n 'type' => 'text',\n 'settings' => 'ptf_googleplus_url',\n 'label' => __( 'Google+', 'artcore' ),\n 'description' => __( 'Enter your google+ url below.', 'artcore' ),\n 'help' => '',\n 'section' => 'ptf_social_options',\n 'default' => '#',\n 'priority' => 10,\n );\n \n // Tumblr URL\n $fields[] = array(\n 'type' => 'text',\n 'settings' => 'ptf_tumblr_url',\n 'label' => __( 'Tumblr', 'artcore' ),\n 'description' => __( 'Enter your tumblr url below.', 'artcore' ),\n 'help' => '',\n 'section' => 'ptf_social_options',\n 'default' => '#',\n 'priority' => 10,\n );\n \n // Custom Social Icon\n $fields[] = array(\n 'type' => 'text',\n 'settings' => 'ptf_custom_social_icon_url',\n 'label' => __( 'Custom Social Icon', 'artcore' ),\n 'description' => __( 'Enter your custom social icon url below.', 'artcore' ),\n 'help' => '',\n 'section' => 'ptf_social_options',\n 'default' => '#',\n 'priority' => 10,\n );\n \n $fields[] = array(\n 'type' => 'text',\n 'settings' => 'ptf_custom_social_font_icon',\n 'label' => '',\n 'description' => __( 'Enter your custom social icon class (e.g fa fa-facebook).', 'artcore' ),\n 'help' => '',\n 'section' => 'ptf_social_options',\n 'default' => 'fa fa-share-square-o',\n 'priority' => 10,\n );\n \n\n return $fields;\n}", "function media_post_single_attachment_fields_to_edit($form_fields, $post)\n {\n }", "public function cms_related_form_modifies($form) {\n if(isset($form['fields'])){\n // Change file fields into Media Manager opening trigger\n foreach ($form['fields'] as $key => $value) {\n if(isset($value['type']) && in_array($value['type'], ['file', 'files', 'media'])){\n $form['fields'][$key]['type'] = 'html';\n $form['fields'][$key]['html'] = '<div class=\"ozz-form__media-selector\">\n <span class=\"button mini\" data-fieldName=\"'.$value['name'].'\">Select File</span>\n <input type=\"hidden\" name=\"'.$value['name'].'\" id=\"'.$value['name'].'\" />\n </div>';\n }\n }\n }\n\n return $form;\n }", "public function add_attachment_fields_to_edit( $form_fields, $attachment ) {\n\t\tif ( ! wp_attachment_is_image( $attachment->ID ) ) {\n\t\t\treturn $form_fields;\n\t\t}\n\n\t\t$form_fields['wpcom_thumbnails'] = array(\n\t\t\t'label' => 'Thumbnail Images',\n\t\t\t'input' => 'html',\n\t\t\t'html' => $this->get_attachment_field_html( $attachment ),\n\t\t);\n\n\t\treturn $form_fields;\n\t}", "function setUrlLink(){\n if( $this->id == 0 ) return;\n $url = $this->aFields[\"url\"]->toString();\n if( $url == \"\" ) return;\n $url = strip_tags( preg_replace( \"/[\\\"']/\", \"\", $url ) );\n if( !$this->aFields[\"url\"]->editable ) $this->aFields[\"url\"]->display = false;\n $this->aFields[\"url_link\"]->display = true;\n $this->aFields[\"url_link\"]->value = \"<a href=\\\"\".$url.\"\\\">\".$url.\"</a>\";\n }", "public static function form_linkfield($message_id, $fieldname, $article_id, $clang_id, $readonly = false): void\n {\n if (!in_array($clang_id, rex_clang::getAllIds(), true)) {\n $clang_id = rex_clang::getStartId();\n }\n echo '<dl class=\"rex-form-group form-group\" id=\"LINK_'. $fieldname .'\">';\n echo '<dt><label>' . rex_i18n::msg($message_id) . '</label></dt>';\n echo '<dd><div class=\"input-group\">';\n $article = rex_article::get($article_id, $clang_id);\n $article_name = $article instanceof rex_article ? $article->getValue('name') .'['. $article_id .']' : '';\n echo '<input class=\"form-control\" type=\"text\" name=\"REX_LINK_NAME[' . $fieldname . ']\" value=\"' . $article_name .'\" id=\"REX_LINK_' . $fieldname . '_NAME\" readonly=\"readonly\">';\n echo '<input type=\"hidden\" name=\"REX_INPUT_LINK[' . $fieldname . ']\" id=\"REX_LINK_' . $fieldname . '\" value=\"' . $article_id . '\">';\n echo '<span class=\"input-group-btn\">';\n if (!$readonly) {\n $js_onclick_open = \"openLinkMap('REX_LINK_\" . $fieldname . \"', '&category_id=\" . $article_id . '&clang=' . $clang_id . \"');return false;\";\n echo '<a href=\"#\" class=\"btn btn-popup\" onclick=\"' . $js_onclick_open . '\" title=\"' . rex_i18n::msg('var_link_open') . '\"><i class=\"rex-icon rex-icon-open-linkmap\"></i></a>';\n $js_onclick_delete = \"deleteREXLink('\" . $fieldname . \"');return false;\";\n echo '<a href=\"#\" class=\"btn btn-popup\" onclick=\"' . $js_onclick_delete . '\" title=\"' . rex_i18n::msg('var_link_delete') . '\"><i class=\"rex-icon rex-icon-delete-link\"></i></a>';\n }\n echo '</span>';\n echo '</div><div class=\"rex-js-media-preview\"></div></dd>';\n echo '</dl>';\n }", "private function weblinkContent_form() {\n\n // Textarea Settings\n if (!fusion_get_settings(\"tinymce_enabled\")) {\n $ExtendedSettings = [\n 'required' => ($this->weblinksSettings['links_extended_required'] ? TRUE : FALSE),\n 'preview' => TRUE,\n 'html' => TRUE,\n 'autosize' => TRUE,\n 'placeholder' => $this->locale['WLS_0255'],\n 'error_text' => $this->locale['WLS_0270'],\n 'form_name' => \"weblinkform\",\n \"wordcount\" => TRUE\n ];\n } else {\n $ExtendedSettings = [\n 'required' => ($this->weblinksSettings['links_extended_required'] ? TRUE : FALSE),\n 'type' => \"tinymce\",\n 'tinymce' => \"advanced\",\n 'error_text' => $this->locale['WLS_0270']];\n }\n\n // Start Form\n echo openform('weblinkform', 'post', $this->form_action);\n echo form_hidden('weblink_id', '', $this->weblink_data['weblink_id']);\n ?>\n\n <!-- Display Form -->\n <div class=\"row\">\n\n <!-- Display Left Column -->\n <div class=\"col-xs-12 col-sm-12 col-md-7 col-lg-8\">\n <?php\n\n echo form_text('weblink_name', $this->locale['WLS_0201'], $this->weblink_data['weblink_name'], [\n 'required' => TRUE,\n 'placeholder' => $this->locale['WLS_0201'],\n 'error_text' => $this->locale['WLS_0252']\n ]);\n\n echo form_text('weblink_url', $this->locale['WLS_0253'], $this->weblink_data['weblink_url'], [\n 'required' => TRUE,\n 'type' => 'url',\n 'placeholder' => 'http://'\n ]);\n\n echo form_textarea('weblink_description', $this->locale['WLS_0254'], $this->weblink_data['weblink_description'], $ExtendedSettings);\n ?>\n </div>\n\n <!-- Display Right Column -->\n <div class=\"col-xs-12 col-sm-12 col-md-5 col-lg-4\">\n <?php\n\n openside($this->locale['WLS_0260']);\n\n echo form_select_tree('weblink_cat', $this->locale['WLS_0101'], $this->weblink_data['weblink_cat'], [\n 'required' => TRUE,\n 'no_root' => TRUE,\n 'placeholder' => $this->locale['choose'],\n 'query' => (multilang_table(\"WL\") ? \"WHERE \".in_group('weblink_cat_language', LANGUAGE) : \"\")\n ], DB_WEBLINK_CATS, \"weblink_cat_name\", \"weblink_cat_id\", \"weblink_cat_parent\");\n\n echo form_select('weblink_visibility', $this->locale['WLS_0103'], $this->weblink_data['weblink_visibility'], [\n 'options' => fusion_get_groups(),\n 'placeholder' => $this->locale['choose']\n ]);\n\n if (multilang_table(\"WL\")) {\n echo form_select('weblink_language[]', $this->locale['language'], $this->weblink_data['weblink_language'], [\n 'options' => fusion_get_enabled_languages(),\n 'placeholder' => $this->locale['choose'],\n 'multiple' => TRUE,\n 'delimeter' => '.'\n ]);\n } else {\n echo form_hidden('weblink_language', '', $this->weblink_data['weblink_language']);\n }\n\n echo form_hidden('weblink_status', '', 1);\n echo form_hidden('weblink_datestamp', '', $this->weblink_data['weblink_datestamp']);\n\n if (!empty($_GET['action']) && $_GET['action'] == 'edit') {\n echo form_checkbox('update_datestamp', $this->locale['WLS_0259'], '');\n }\n\n closeside();\n\n ?>\n\n </div>\n </div>\n <?php\n self::display_weblinkButtons('formend', FALSE);\n echo closeform();\n }", "function media_upload_type_url_form($type = \\null, $errors = \\null, $id = \\null)\n {\n }", "function media_bynder_add($form, &$form_state = array(), $redirect = NULL) {\n module_load_include('inc', 'media', 'includes/media.browser');\n $form['#attached']['library'][] = array('media_bynder', 'media_bynder_administration');\n $form['#attached']['css'][] = array(\n 'type' => 'external',\n 'data' => '//maxcdn.bootstrapcdn.com/font-awesome/4.1.0/css/font-awesome.css',\n );\n drupal_process_attached($form);\n\n $rest_client = media_bynder_rest_client();\n $current_results = $rest_client->getAll()['media'];\n variable_set('all_results', $current_results);\n\n $id = media_bynder_parameter($_POST, 'id');\n\n if ($id !== NULL) {\n media_bynder_submit_mob($form, $form_state);\n return;\n }\n\n $data['bynder_search'] = media_bynder_generate_search($form_state);\n $data['selected_asset'] = array(\n '#type' => 'hidden',\n '#default_value' => FALSE\n );\n\n $selected_asset = media_bynder_parameter($_POST, 'selected_asset');\n if ($selected_asset) {\n $id = media_bynder_id_from_uri($selected_asset);\n $result = media_bynder_save_image($id, $form);\n if (!$result['success']) {\n drupal_set_message(t($result['message']), 'error');\n } else {\n drupal_goto('/media/browser', array('query' => array(\n 'render' => 'media-popup',\n 'fid' => $result['fid']\n )));\n }\n }\n return array('bynder' => $data);\n}", "public function add_field_settings_js() {\n\n\t\t?>\n\n\t\t<script type=\"text/javascript\">\n\t\t\tjQuery( document ).bind( 'gform_load_field_settings', function ( e, field, form ) {\n\t\t\t\tjQuery( '#field_link_type_preview' ).attr( 'checked', 'preview' === field[ 'linkType' ] );\n\t\t\t\tjQuery( '#field_link_type_direct' ).attr( 'checked', 'direct' === field[ 'linkType' ] );\n\t\t\t\tjQuery( '#field_multiselect' ).attr( 'checked', true === field[ 'multiselect' ] );\n\t\t\t} );\n\t\t</script>\n\n\t\t<?php\n\n\t}", "public function add_field_settings( $position, $form_id ) {\n\n\t\tif ( 20 !== $position ) {\n\t\t\treturn;\n\t\t}\n\n\t\t?>\n\n\t\t<li class=\"link_type_setting field_setting\">\n\t\t\t<label class=\"section_label\"><?php esc_html_e( 'Link Type', 'gravityformsdropbox' ); ?></label>\n\t\t\t<div>\n\t\t\t\t<input type=\"radio\" name=\"link_type\" id=\"field_link_type_preview\" size=\"10\" onclick=\"SetFieldProperty( 'linkType', 'preview' );\" />\n\t\t\t\t<label for=\"field_link_type_preview\" class=\"inline\"><?php esc_html_e( 'Preview', 'gravityformsdropbox' ); ?></label>\n\t\t\t\t&nbsp;&nbsp;\n\t\t\t\t<input type=\"radio\" name=\"link_type\" id=\"field_link_type_direct\" size=\"10\" onclick=\"SetFieldProperty( 'linkType', 'direct' );\" />\n\t\t\t\t<label for=\"field_link_type_direct\" class=\"inline\"><?php esc_html_e( 'Direct', 'gravityformsdropbox' ); ?></label>\n\t\t\t</div>\n\t\t</li>\n\n\t\t<li class=\"multiselect_setting field_setting\">\n\t\t\t<input type=\"checkbox\" id=\"field_multiselect\" onclick=\"SetFieldProperty( 'multiselect', this.checked );\" />\n\t\t\t<label for=\"field_multiselect\" class=\"inline\"><?php esc_html_e( 'Allow multiple files to be selected', 'gravityformsdropbox' ); ?></label>\n\t\t\t<br class=\"clear\" />\n\t\t</li>\n\n\t\t<?php\n\n\t}", "function options_form(&$form, &$form_state) {\n $form['link_to_store'] = array(\n '#title' => t('Link this field to the original store display'),\n '#description' => t(\"Enable to override this field's links.\"),\n '#type' => 'checkbox',\n '#default_value' => !empty($this->options['link_to_store']),\n );\n\n parent::options_form($form, $form_state);\n }", "function wp_add_fields_to_navigation_fallback_embedded_links($schema)\n {\n }", "protected function manageLinkTypeRelatedFields($linkType, $locale, $form, FormBuilderInterface $builder, $options)\n {\n $form->remove('route');\n $form->remove('url');\n $form->remove('attachedWidget');\n $form->remove('viewReference');\n $form->remove('locale');\n $this->addTargetField($form, $options);\n switch ($linkType) {\n case Link::TYPE_VIEW_REFERENCE:\n $locale = $locale ?: $this->requestStack->getCurrentRequest()->getLocale();\n $form->add('viewReference', ChoiceType::class, [\n 'label' => 'form.link_type.view_reference.label',\n 'required' => true,\n 'attr' => ['novalidate' => 'novalidate'],\n 'placeholder' => 'form.link_type.view_reference.blank',\n 'choices' => $this->viewReferenceRepository->getChoices($locale),\n 'choices_as_values' => true,\n 'vic_vic_widget_form_group_attr' => ['class' => 'vic-form-group'],\n ])->add('locale', ChoiceType::class, [\n 'label' => 'form.link_type.locale.label',\n 'choices' => array_combine($this->availableLocales, $this->availableLocales),\n 'attr' => [\n 'data-refreshOnChange' => 'true',\n 'data-target' => $options['refresh-target'],\n ],\n ]);\n break;\n case Link::TYPE_ROUTE:\n $form->add('route', null, [\n 'label' => 'form.link_type.route.label',\n 'vic_vic_widget_form_group_attr' => ['class' => 'vic-form-group'],\n 'required' => true,\n 'attr' => ['novalidate' => 'novalidate', 'placeholder' => 'form.link_type.route.placeholder'],\n ])\n ->add('route_parameters', JsonType::class, [\n 'label' => 'form.link_type.route_parameters.label',\n 'vic_vic_widget_form_group_attr' => ['class' => 'vic-form-group'],\n 'required' => true,\n 'attr' => ['novalidate' => 'novalidate', 'placeholder' => 'form.link_type.route_parameters.placeholder'],\n ]);\n break;\n case Link::TYPE_URL:\n $form->add('url', null, [\n 'label' => 'form.link_type.url.label',\n 'vic_vic_widget_form_group_attr' => ['class' => 'vic-form-group'],\n 'required' => true,\n 'attr' => ['novalidate' => 'novalidate', 'placeholder' => 'form.link_type.url.placeholder'],\n ]);\n break;\n case Link::TYPE_WIDGET:\n $form->add('attachedWidget', EntityType::class, [\n 'label' => 'form.link_type.attachedWidget.label',\n 'placeholder' => 'form.link_type.attachedWidget.blank',\n 'class' => 'VictoireWidgetBundle:Widget',\n 'vic_vic_widget_form_group_attr' => ['class' => 'vic-form-group'],\n 'required' => true,\n 'attr' => ['novalidate' => 'novalidate'],\n ]);\n break;\n case Link::TYPE_NONE:\n case null:\n $form->remove('target');\n break;\n }\n }", "public function action_block_form_meta_links( $form, $block )\n\t{\n\t\t$form->append( FormControlLabel::wrap( _t( \"Links to show:\" ), \n\t\t\tFormControlCheckboxes::create( 'links', $block )->set_options( array_flip( $this->meta_urls() ) )\n\t\t));\n\t}", "public function options_form(&$form, &$form_state) {\n $form['render_link'] = array(\n '#title' => t('Render as link'),\n '#description' => t('Render \\'part of\\' as link to access point for more info (if available)'),\n '#type' => 'checkbox',\n '#default_value' => $this->options['render_link'],\n '#weight' => 1,\n );\n parent::options_form($form, $form_state);\n }", "function hook_buffer_render_editlink($data)\n{\n\t$form = file_get_contents(PluginManager::$PLUGINS_PATH . '/buffer/fields.html');\n\t$posted = file_get_contents(PluginManager::$PLUGINS_PATH . '/buffer/posted.html');\n\t$html = isset($data['link']['buffer_update_ids']) ? $posted : $form;\n\n\t$data['edit_link_plugin'][] = $html;\n\n\treturn $data;\n}", "function graphql_user_social_links_input( $fields ) {\n\t\n\t\t$fields['socialLinks'] = [\n\t\t\t'type' => new \\WPGraphQL\\Type\\WPInputObjectType([\n\t\t\t\t'name' => 'UserProfileSocialLinksInput',\n\t\t\t\t'fields' => [\n\t\t\t\t\t'twitter' => [\n\t\t\t\t\t\t'type' => \\WPGraphQL\\Types::string(),\n\t\t\t\t\t\t'description' => __( 'Twitter url for the user', 'your-textdomain' )\n\t\t\t\t\t],\n\t\t\t\t\t'facebook' => [\n\t\t\t\t\t\t'type' => \\WPGraphQL\\Types::string(),\n\t\t\t\t\t\t'description' => __( 'Facebook url for the user', 'your-textdomain' )\n\t\t\t\t\t],\n\t\t\t\t\t'instagram' => [\n\t\t\t\t\t\t'type' => \\WPGraphQL\\Types::string(),\n\t\t\t\t\t\t'description' => __( 'Instagram url for the user', 'your-textdomain' )\n\t\t\t\t\t],\n\t\t\t\t],\n\t\t\t]),\n\t\t\t'description' => __( 'Social links for the user', 'your-textdomain' ),\n\t\t];\n\t\n\t\treturn $fields;\n\t\n\t}", "function image_attachment_fields_to_edit($form_fields, $post)\n {\n }", "function wpcf_fields_embed() {\n return array(\n 'id' => 'wpcf-embed',\n 'title' => __( 'Embedded Media', 'wpcf' ),\n 'description' => __( 'Embedded Media', 'wpcf' ),\n 'validate' => array(\n 'required' => array(\n 'form-settings' => include( dirname( __FILE__ ) . '/patterns/validate/form-settings/required.php' )\n ),\n 'url' => array(\n 'forced' => true,\n 'form-settings' => include( dirname( __FILE__ ) . '/patterns/validate/form-settings/url.php' )\n )\n ),\n 'wp_version' => '3.6',\n 'font-awesome' => 'code',\n );\n}", "public function AddLink($fields, $type, $attachTo)\n {\n $keyQuery = $type. \"(\";\n foreach ($fields as $key=>$value)\n {\n if ($key != 'btnUpdate'\n && $key != 'btnDelete'\n && $key != 'btnSave'\n && $key != 'btnAddLink'\n && $key != 'skip'\n && $key != 'pagingAllowed'\n )\n {\n $keyQuery = $keyQuery . $key . \"=\";\n if (is_numeric($value))\n {\n $keyQuery = $keyQuery\n . str_replace(' ', \"%20\", $value)\n . \",\";\n }\n else\n {\n $keyQuery = $keyQuery\n . \"'\"\n . str_replace(' ', \"%20\", $value)\n . \"'\"\n . \",\";\n }\n }\n }\n $keyQuery[(strlen($keyQuery) - 1)] =\")\";\n $response1 = $this->_proxyObject->Execute($attachTo);\n $response2 = $this->_proxyObject->Execute($keyQuery);\n $source = $response1->Result;\n $target = $response2->Result;\n $this->_proxyObject->AddLink($source[0], $type, $target[0]);\n $this->_proxyObject->SaveChanges();\n }", "function show_metabox_link_externo($post) {\r\n\t\t$link = get_post_meta($post->ID, 'link_externo', true);\r\n\t\twp_nonce_field(__FILE__, 'link_externo_nonce');\r\n\t\techo \"<input type='url' name='link_externo' class='widefat' value='$link'>\";\r\n\t}", "function link_advanced_meta_box($link)\n {\n }", "public function uultra_load_links_addition_form()\r\n\t{\r\n\t\t$html = '';\r\n\t\t$html .= '<div class=\"uultra-adm-links-cont-add-new\" >';\r\n \r\n\t\t$html .= '<table width=\"100%\" border=\"0\" cellspacing=\"2\" cellpadding=\"3\">\r\n\t\t\t<tr>\r\n\t\t\t\t<td width=\"50%\"> '.__(\"Name: \",'xoousers').'</td>\r\n\t\t\t\t<td width=\"50%\"><input name=\"uultra_add_mod_link_title\" type=\"text\" id=\"uultra_add_mod_link_title\" style=\"width:120px\" /> \r\n\t\t </td>\r\n\t\t </tr>\r\n\t\t <tr>\r\n\t\t\t\t<td width=\"50%\"> '.__('Type:','xoousers').'</td>\r\n\t\t\t\t<td width=\"50%\">\r\n\t\t\t\t<select name=\"uultra_add_mod_link_type\" id=\"uultra_add_mod_link_type\" size=\"1\">\r\n\t\t\t\t <option value=\"\" selected=\"selected\">'.__(\"Select Type: \",'xoousers').'</option>\r\n\t\t\t\t <option value=\"1\">'.__(\"Text: \",'xoousers').'</option>\r\n\t\t\t\t <option value=\"2\">Shortcode</option>\r\n\t\t\t\t</select>\r\n\r\n\t\t </td>\r\n\t\t\t </tr>\r\n\t\t\t\t\t \r\n\t\t\t <tr>\r\n\t\t\t\t<td>'.__('Content:','xoousers').'</td>\r\n\t\t\t\t<td>&nbsp;</textarea> \r\n\t\t\t </td>\r\n\t\t\t </tr>\r\n\t\t\t \r\n\t\t\t <tr>\r\n\t\t\t\t\r\n\t\t\t\t<td colspan=\"2\"><textarea name=\"uultra_add_mod_links_content\" id=\"uultra_add_mod_links_content\" style=\"width:98%;\" rows=\"5\"></textarea> \r\n\t\t\t </td>\r\n\t\t\t </tr> \r\n\t\t\t \r\n\t\t\t \r\n\t\t\t</table> '; \t\t\t\r\n\t\t\t \r\n\t\t\t$html .= ' <p class=\"submit\">\r\n\t\t\t\t\t<input type=\"button\" name=\"submit\" class=\"button uultra-links-add-new-close\" value=\"'.__('Close','xoousers').'\" /> <input type=\"button\" name=\"submit\" class=\"button button-primary uultra-links-add-new-confirm\" value=\"'.__('Submit','xoousers').'\" /> <span id=\"uultra-add-new-links-m-w\" ></span>\r\n\t\t\t\t</p> ';\r\n\t\t\t\t\r\n\t\t\t$html .= '</div>';\r\n\t\t\t\t\r\n\t\t\techo $html;\r\n\t\t\tdie();\r\n\t\r\n\t}", "private function build_url_field($_meta, $_ptype = \"wccpf\", $_class = \"\", $_index, $_show_value = \"no\", $_readonly = \"\", $_cloneable = \"\", $_wrapper = true) {\r\n $html = '';\r\n if ($_ptype != \"wccaf\") {\r\n if (isset($_meta[\"default_value\"]) && $_meta[\"default_value\"] != \"\") {\r\n $visual_type = (isset($_meta[\"view_in\"]) && ! empty($_meta[\"view_in\"])) ? $_meta[\"view_in\"] : \"link\";\r\n $open_tab = (isset($_meta[\"tab_open\"]) && ! empty($_meta[\"tab_open\"])) ? $_meta[\"tab_open\"] : \"_blank\";\r\n if ($visual_type == \"link\") {\r\n /* Admin wants this url to be displayed as LINK */\r\n $html = '<a href=\"' . $_meta[\"default_value\"] . '\" class=\"' . $_class . '\" target=\"' . $open_tab . '\" title=\"' . $_meta[\"tool_tip\"] . '\" ' . $_cloneable . ' >' . $_meta[\"link_name\"] . '</a>';\r\n } else {\r\n /* Admin wants this url to be displayed as Button */\r\n $html = '<button onclick=\"window.open(\\'' . $_meta[\"default_value\"] . '\\', \\'' . $open_tab . '\\' )\" title=\"' . $_meta[\"tool_tip\"] . '\" class=\"' . $_class . '\" ' . $_cloneable . ' >' . $_meta[\"link_name\"] . '</button>';\r\n }\r\n } else {\r\n /* This means url value is empty so no need render the field */\r\n $_wrapper = false;\r\n }\r\n } else {\r\n $html .= '<input type=\"text\" name=\"' . esc_attr($_meta['key']) . '\" class=\"wccaf-field short\" id=\"' . esc_attr($_meta['key']) . '\" placeholder=\"http://example.com\" wccaf-type=\"url\" value=\"' . esc_attr($_meta['value']) . '\" wccaf-pattern=\"mandatory\" wccaf-mandatory=\"\">';\r\n }\r\n /* Add wrapper around the field, based on the user options */\r\n if ($_wrapper) {\r\n $html = $this->built_field_wrapper($html, $_meta, $_ptype, $_index);\r\n }\r\n return $html;\r\n }", "function post_link_box(){\n add_meta_box( 'post_link_box', 'Link', 'post_link_box_content', 'post', 'normal', 'high');\n }", "function hr_visual_feedback_add_fields() {\n add_meta_box(\n 'hr_visual_feedback_source',\n __('Extra information', 'hr_visual_feedback'),\n '_hr_visual_feedback_data_box',\n 'hrvfb_feedback',\n 'side',\n 'default'\n );\n}", "public function __construct() {\n\t\tparent::__construct(\n\t\t\t'social_link',\n\t\t\t'Social Media Link',\n\t\t\t'Adds a list item containing a linked social icon.'\n\t\t);\n\n\t\t$this->fields = [\n\t\t\t'title' => [\n\t\t\t\t'type' => 'text',\n\t\t\t],\n\t\t\t'icon' => [\n\t\t\t\t'type' => 'select',\n\t\t\t\t'values' => [\n\t\t\t\t\t'fa-behance' => 'Behance',\n\t\t\t\t\t'fa-behance-square' => 'Behance (square)',\n\t\t\t\t\t'fa-bitbucket' => 'BitBucket',\n\t\t\t\t\t'fa-bitbucket-square' => 'BitBucket (square)',\n\t\t\t\t\t'fa-codepen' => 'CodePen',\n\t\t\t\t\t'fa-delicious' => 'Delicious',\n\t\t\t\t\t'fa-deviantart' => 'DeviantArt',\n\t\t\t\t\t'fa-digg' => 'Digg',\n\t\t\t\t\t'fa-dribble' => 'Dribble',\n\t\t\t\t\t'fa-dropbox' => 'Dropbox',\n\t\t\t\t\t'fa-facebook' => 'Facebook',\n\t\t\t\t\t'fa-facebook-official' => 'Facebook (official)',\n\t\t\t\t\t'fa-facebook-square' => 'Facebook (square)',\n\t\t\t\t\t'fa-flickr' => 'Flickr',\n\t\t\t\t\t'fa-foursquare' => 'FourSquare',\n\t\t\t\t\t'fa-git' => 'Git',\n\t\t\t\t\t'fa-git-square' => 'Git (square)',\n\t\t\t\t\t'fa-github' => 'GitHub',\n\t\t\t\t\t'fa-github-alt' => 'GitHub (alt)',\n\t\t\t\t\t'fa-github-square' => 'GitHub (square)',\n\t\t\t\t\t'fa-gittip' => 'GitTip',\n\t\t\t\t\t'fa-google-plus' => 'Google+',\n\t\t\t\t\t'fa-google-plus-square' => 'Google+ (square)',\n\t\t\t\t\t'fa-instagram' => 'Instagram',\n\t\t\t\t\t'fa-jsfiddle' => 'JSFiddle',\n\t\t\t\t\t'fa-linkedin' => 'LinkedIn',\n\t\t\t\t\t'fa-linkedin-square' => 'LinkedIn (square)',\n\t\t\t\t\t'fa-medium' => 'Medium',\n\t\t\t\t\t'fa-pinterest' => 'Pinterest',\n\t\t\t\t\t'fa-pinterest-p' => 'Pinterest (P)',\n\t\t\t\t\t'fa-pinterest-square' => 'Pinterest (square)',\n\t\t\t\t\t'fa-slideshare' => 'SlideShare',\n\t\t\t\t\t'fa-stumbleupon' => 'StumbleUpon',\n\t\t\t\t\t'fa-stumbleupon-circle' => 'StumbleUpon (circle)',\n\t\t\t\t\t'fa-tumblr' => 'Tumblr',\n\t\t\t\t\t'fa-tumblr-square' => 'Tumblr (square)',\n\t\t\t\t\t'fa-twitter' => 'Twitter',\n\t\t\t\t\t'fa-twitter-square' => 'Twitter (square)',\n\t\t\t\t\t'fa-vimeo-square' => 'Vimeo',\n\t\t\t\t\t'fa-vine' => 'Vine',\n\t\t\t\t\t'fa-weibo' => 'Weibo',\n\t\t\t\t\t'fa-weixin' => 'Weixin (WeChat)',\n\t\t\t\t\t'fa-whatsapp' => 'WhatsApp',\n\t\t\t\t\t'fa-wordpress' => 'WordPress',\n\t\t\t\t\t'fa-xing' => 'Xing',\n\t\t\t\t\t'fa-xing-square' => 'Xing (square)',\n\t\t\t\t\t'fa-yelp' => 'Yelp',\n\t\t\t\t\t'fa-youtube' => 'YouTube',\n\t\t\t\t\t'fa-youtube-play' => 'YouTube (play)',\n\t\t\t\t\t'fa-youtube-square' => 'YouTube (square)',\n\t\t\t\t],\n\t\t\t],\n\t\t\t'url' => [\n\t\t\t\t'type' => 'url',\n\t\t\t],\n\t\t];\n\t}", "function getFieldLinks() {\n return $this->fieldLinks;\n }", "public function media_button()\n\t{\n\t\t$type = 'picasa';\n\t\t$id = 'picasa';\n\t\t$title = \"Add Picasa Media\";\n\t\t$icon = plugins_url('/images/picasa-logo.png', __FILE__);\n\n\t\techo \"<a href='\" . esc_url( get_upload_iframe_src($type) ) . \"' id='{$id}-add_{$type}' class='thickbox add_$type' title='\" . esc_attr( $title ) . \"'><img src='\" . $icon . \"' alt='$title' onclick='return false;' /></a>\";\n\t}", "public function runFieldUIItem($cardinality, $link_type, $title, $label, $field_name, $default_uri) {\n $this->drupalLogin($this->adminUser);\n $type_path = 'admin/structure/types/manage/' . $this->contentType->id();\n\n // Add a link field to the newly-created type.\n $description = 'link field description';\n $field_edit = [\n 'description' => $description,\n 'settings[link_type]' => (int) $link_type,\n ];\n if (!empty($default_uri)) {\n $field_edit['default_value_input[field_' . $field_name . '][0][uri]'] = $default_uri;\n $field_edit['default_value_input[field_' . $field_name . '][0][title]'] = 'Default title';\n }\n $storage_edit = [\n 'cardinality_number' => $cardinality,\n ];\n $this->fieldUIAddNewField($type_path, $field_name, $label, 'link', $storage_edit, $field_edit);\n\n // Load the formatter page to check that the settings summary does not\n // generate warnings.\n // @todo Mess with the formatter settings a bit here.\n $this->drupalGet(\"$type_path/display\");\n $this->assertSession()->pageTextContains('Link text trimmed to 80 characters');\n\n // Make the fields visible in the form display.\n $form_display_id = implode('.', ['node', $this->contentType->id(), 'default']);\n $form_display = EntityFormDisplay::load($form_display_id);\n $form_display->setComponent($field_name, ['region' => 'content']);\n $form_display->save();\n\n // Log in a user that is allowed to create this content type, see if\n // the user can see the expected help text.\n $this->drupalLogin($this->helpTextUser);\n\n $add_path = 'node/add/' . $this->contentType->id();\n $this->drupalGet($add_path);\n\n $expected_help_texts = [\n LinkItemInterface::LINK_EXTERNAL => 'This must be an external URL such as <em class=\"placeholder\">http://example.com</em>.',\n LinkItemInterface::LINK_GENERIC => 'You can also enter an internal path such as <em class=\"placeholder\">/node/add</em> or an external URL such as <em class=\"placeholder\">http://example.com</em>. Enter <em class=\"placeholder\">&lt;front&gt;</em> to link to the front page. Enter <em class=\"placeholder\">&lt;nolink&gt;</em> to display link text only',\n LinkItemInterface::LINK_INTERNAL => rtrim(Url::fromRoute('<front>', [], ['absolute' => TRUE])->toString(), '/'),\n ];\n\n // Check that the help texts we assume should be there, is there.\n $this->assertFieldContainsRawText($field_name, $expected_help_texts[$link_type]);\n if ($link_type === LinkItemInterface::LINK_INTERNAL) {\n // Internal links have no \"system\" description. Test that none\n // of the other help texts show here.\n $this->assertNoFieldContainsRawText($field_name, $expected_help_texts[LinkItemInterface::LINK_EXTERNAL]);\n $this->assertNoFieldContainsRawText($field_name, $expected_help_texts[LinkItemInterface::LINK_GENERIC]);\n }\n // Also assert that the description we made is here, no matter what the\n // cardinality or link setting.\n if (!empty($label)) {\n $this->assertFieldContainsRawText($field_name, $label);\n }\n\n // Test the default field value is used as expected.\n $this->assertSession()->fieldValueEquals('field_' . $field_name . '[0][uri]', $default_uri);\n }", "function media_upload_form_handler()\n {\n }", "function show_custom_field($field, $value) {\n\t$output = '';\n\tswitch ($field['type']) {\n\t\tcase 'reviews':\n\t\t\t$output .= '<div class=\"reviewBlock\"><div class=\"ratingStars\">' . getReviewsMarkup($field, $value, true) . '</div></div>';\n\t\t\tbreak;\n\n\t\tcase 'mediamanager':\n\t\t\twp_enqueue_media( );\n\t\t\t$output .= '<a id=\"'.$field['id'].'\" class=\"button mediamanager\"\n\t\t\t\tdata-choose=\"'.(isset($field['multiple']) && $field['multiple'] ? __( 'Choose Images', 'themerex') : __( 'Choose Image', 'themerex')).'\"\n\t\t\t\tdata-update=\"'.(isset($field['multiple']) && $field['multiple'] ? __( 'Add to Gallery', 'themerex') : __( 'Choose Image', 'themerex')).'\"\n\t\t\t\tdata-multiple=\"'.(isset($field['multiple']) && $field['multiple'] ? 'true' : 'false').'\"\n\t\t\t\tdata-linked-field=\"'.$field['media_field_id'].'\"\n\t\t\t\tonclick=\"showMediaManager(this); return false;\"\n\t\t\t\t>' . (isset($field['multiple']) && $field['multiple'] ? __( 'Choose Images', 'themerex') : __( 'Choose Image', 'themerex')) . '</a>';\n\t\t\tbreak;\n\t}\n\treturn $output;\n}", "function kp_portfolio_link( $post )\n{\n wp_nonce_field( 'kp_save_portfolio_link_data', 'kp_portfolio_link_meta_box_nonce' );\n\n $value = get_post_meta( $post->ID, '_link', true );\n $hint = '<p class=\"howto\">Link to project website</p>';\n echo '<input name=\"kp_portfolio_link_field\" type=\"url\" value=\"' . esc_attr( $value ) . '\" style=\"width:100%\">' . $hint;\n}", "static function add_spotlight_notice_link(): void {\r\n self::add_acf_inner_field(self::spotlight, self::spotlight_notice_link, [\r\n 'label' => 'Notice link',\r\n 'default_value' => '',\r\n 'maxlength' => '',\r\n 'placeholder' => '',\r\n 'prepend' => '',\r\n 'append' => '',\r\n 'type' => 'text',\r\n 'instructions' => '',\r\n 'required' => 0,\r\n 'conditional_logic' => [\r\n [\r\n [\r\n 'field' => self::qualify_field(self::spotlight_type),\r\n 'operator' => '==',\r\n 'value' => 'notice',\r\n ],\r\n ],\r\n ],\r\n 'wrapper' => [\r\n 'width' => '',\r\n 'class' => '',\r\n 'id' => '',\r\n ],\r\n 'readonly' => 0,\r\n 'disabled' => 0,\r\n ]);\r\n }", "public function register_rest_audio_download_link() {\n\t\tregister_rest_field(\n\t\t\tssp_post_types(),\n\t\t\t'download_link',\n\t\t\tarray(\n\t\t\t\t'get_callback' => array( $this, 'get_rest_audio_download_link' ),\n\t\t\t\t'update_callback' => null,\n\t\t\t\t'schema' => null,\n\t\t\t)\n\t\t);\n\t}", "function external_url_taxonomy_add_new_meta_field() {\n ?>\n <div class=\"form-field\">\n <label for=\"term_meta[custom_term_meta]\"><?php _e( 'External URL:', 'external_url' ); ?></label>\n <input type=\"text\" name=\"term_meta[custom_term_meta]\" id=\"term_meta[custom_term_meta]\" value=\"\">\n <p class=\"description\"><?php _e( 'Enter a value for this field','external_url' ); ?></p>\n </div>\n<?php\n}", "function shortcode_field() {\n\n\t\t$shortcode = '[file id=\"' . get_the_ID() . '\" ]';\n\n\t\t?>\n\t\t<div class=\"misc-pub-section\">\n\t\t\t<label for=\"attachment_url\"><?php _e( 'File Shortcode:' ); ?></label>\n\t\t\t<input type=\"text\" class=\"widefat urlfield\" readonly=\"readonly\" name=\"attachment_url\" value=\"<?php echo esc_attr($shortcode); ?>\" />\n\t\t</div>\n\t\t<?php\n\t}", "public function getEditMediaLink()\n {\n return $this->get('EditMediaLink');\n }", "function renderFilterCreationLink() {\n\t\t$content = tslib_CObj::getSubpart($this->fileContent, '###NEWFILTER_LINK###');\n\n\t\tif (!isset($this->conf['newfilter_link.']['form_url.']['parameter'])) {\n\t\t\t$this->conf['newfilter_link.']['form_url.']['parameter'] = $GLOBALS['TSFE']->id;\n\t\t}\n\t\t$this->conf['newfilter_link.']['form_url.']['returnLast'] = 'url';\n\t\t$content = tslib_cObj::substituteMarker($content, '###FORM_URL###', $this->cObj->typolink('', $this->conf['newfilter_link.']['form_url.']));\n\n\t\treturn $content;\n\t}", "function load_fields() {\n\n\t\t// Back end form fields\n\t\t$this->fields = array(\n\t\t\tarray(\n\t\t\t\t'name' => __( 'Title', 'publisher' ),\n\t\t\t\t'id' => 'title',\n\t\t\t\t'type' => 'text',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => __( 'Buttons Style', 'publisher' ),\n\t\t\t\t'id' => 'style',\n\t\t\t\t'type' => 'image_select',\n\t\t\t\t'section_class' => 'style-floated-left',\n\t\t\t\t'value' => 'clean',\n\t\t\t\t'options' => array(\n\t\t\t\t\t'button' => array(\n\t\t\t\t\t\t'label' => __( 'Button Style', 'publisher' ),\n\t\t\t\t\t\t'img' => bf_get_theme_uri( 'images/shortcodes/bs-social-share-button.png' )\n\t\t\t\t\t),\n\t\t\t\t\t'button-no-text' => array(\n\t\t\t\t\t\t'label' => __( 'Icon Button Style', 'publisher' ),\n\t\t\t\t\t\t'img' => bf_get_theme_uri( 'images/shortcodes/bs-social-share-button-no-text.png' )\n\t\t\t\t\t),\n\t\t\t\t\t'outline-button' => array(\n\t\t\t\t\t\t'label' => __( 'Outline Style', 'publisher' ),\n\t\t\t\t\t\t'img' => bf_get_theme_uri( 'images/shortcodes/bs-social-share-outline-button.png' )\n\t\t\t\t\t),\n\t\t\t\t\t'outline-button-no-text' => array(\n\t\t\t\t\t\t'label' => __( 'Icon Outline Style', 'publisher' ),\n\t\t\t\t\t\t'img' => bf_get_theme_uri( 'images/shortcodes/bs-social-share-outline-button-no-text.png' )\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => __( 'Colored Style', 'publisher' ),\n\t\t\t\t'id' => 'colored',\n\t\t\t\t'type' => 'switch',\n\t\t\t\t'on-label' => __( 'Yes', 'publisher' ),\n\t\t\t\t'off-label' => __( 'No', 'publisher' ),\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => __( 'Active Sites', 'publisher' ),\n\t\t\t\t'id' => 'sites',\n\t\t\t\t'type' => 'sorter_checkbox',\n\t\t\t\t'deferred-options' => array(\n\t\t\t\t\t'callback' => 'publisher_social_share_option_list',\n\t\t\t\t),\n\t\t\t\t'section_class' => 'bs-theme-social-share-sorter',\n\t\t\t),\n\t\t);\n\n\t}", "function _photo_gallery_content_default_fields() {\n $fields = array();\n\n // Exported field: field_gallery\n $fields[] = array(\n 'field_name' => 'field_gallery',\n 'type_name' => 'photo',\n 'display_settings' => array(\n 'weight' => '-1',\n 'parent' => '',\n 'label' => array(\n 'format' => 'hidden',\n ),\n 'teaser' => array(\n 'format' => 'hidden',\n 'exclude' => 1,\n ),\n 'full' => array(\n 'format' => 'hidden',\n 'exclude' => 1,\n ),\n '4' => array(\n 'format' => 'default',\n 'exclude' => 0,\n ),\n 'token' => array(\n 'format' => 'default',\n 'exclude' => 0,\n ),\n ),\n 'widget_active' => '1',\n 'type' => 'nodereference',\n 'required' => '1',\n 'multiple' => '0',\n 'module' => 'nodereference',\n 'active' => '1',\n 'referenceable_types' => array(\n 'gallery' => 'gallery',\n 'front' => 0,\n 'lyrics' => 0,\n 'page' => 0,\n 'photo' => 0,\n 'story' => 0,\n 'image' => 0,\n ),\n 'advanced_view' => '--',\n 'advanced_view_args' => '',\n 'widget' => array(\n 'node_link' => array(\n 'teaser' => 0,\n 'full' => 1,\n 'title' => 'Add Photo',\n 'hover_title' => '',\n 'destination' => 'node',\n ),\n 'fallback' => 'select',\n 'edit_fallback' => NULL,\n 'label' => 'gallery',\n 'weight' => '-1',\n 'description' => '',\n 'type' => 'nodereference_url',\n 'module' => 'nodereference_url',\n ),\n );\n\n // Exported field: field_image\n $fields[] = array(\n 'field_name' => 'field_image',\n 'type_name' => 'photo',\n 'display_settings' => array(\n 'weight' => 0,\n 'parent' => '',\n 'label' => array(\n 'format' => 'hidden',\n ),\n 'teaser' => array(\n 'format' => 'hidden',\n 'exclude' => 1,\n ),\n 'full' => array(\n 'format' => 'image_plain',\n 'exclude' => 0,\n ),\n '4' => array(\n 'format' => 'image_plain',\n 'exclude' => 0,\n ),\n 'token' => array(\n 'format' => 'image_plain',\n 'exclude' => 0,\n ),\n ),\n 'widget_active' => '1',\n 'type' => 'filefield',\n 'required' => '0',\n 'multiple' => '0',\n 'module' => 'filefield',\n 'active' => '1',\n 'list_field' => '0',\n 'list_default' => 1,\n 'description_field' => '0',\n 'widget' => array(\n 'file_extensions' => 'png gif jpg jpeg',\n 'file_path' => 'gallery',\n 'progress_indicator' => 'bar',\n 'max_filesize_per_file' => '',\n 'max_filesize_per_node' => '',\n 'max_resolution' => '0',\n 'min_resolution' => '0',\n 'alt' => 'Texcentrics',\n 'custom_alt' => 1,\n 'title' => 'Texcentrics Photo',\n 'custom_title' => 1,\n 'title_type' => 'textfield',\n 'default_image' => NULL,\n 'use_default_image' => 0,\n 'label' => 'image',\n 'weight' => 0,\n 'description' => '',\n 'type' => 'imagefield_widget',\n 'module' => 'imagefield',\n ),\n );\n\n // Translatables\n array(\n t('gallery'),\n t('image'),\n );\n\n return $fields;\n}", "function attachfield($list, $extra = \"\") {\n\tglobal $isadmin;\n\t$out = \"\";\n\tforeach ($list as $k => $x) {\n\t\tif (!isset($x['imgprev'])) $x['imgprev'] = NULL; // and this, which is only passed on post previews\n\t\t\n\t\tif ($x['is_image']) { // An image\n\t\t\t$thumb = isset($x['imgprev']) ? $x['imgprev'] : attachment_name($x['id'], true);\n\t\t} else { // Not an image\n\t\t\t$thumb = \"images/defaultthumb.png\";\n\t\t}\n\t\t\n\t\t// id 0 is a magic value used for post previews\n\t\t$w = $x['id'] ? 'a' : 'b';\n\t\t\n\t\t$out .= \"\n\t\t<table class='attachment-box'>\n\t\t\t<tr>\n\t\t\t\t<td class='attachment-box-thumb' rowspan='2'>\n\t\t\t\t\t<$w href='download.php?id={$x['id']}{$extra}'><img src='{$thumb}'></$w>\n\t\t\t\t</td>\n\t\t\t\t<td class='attachment-box-text fonts'>\n\t\t\t\t\t<div><$w href='download.php?id={$x['id']}{$extra}'>\".htmlspecialchars($x['filename']).\"</$w></div>\n\t\t\t\t\t<div>Size:<span style='float: right'>\".sizeunits($x['size']).\"</span></div>\n\t\t\t\t\t<div>Views:<span style='float: right'>{$x['views']}</span></div>\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td class='attachment-box-controls fonts right'>\n\t\t\t\t\".($isadmin ? \"\n\t\t\t\t\t<a href='admin-attachments.php?id={$x['id']}&r=1&action=edit'>Edit</a> - \n\t\t\t\t\t<a href='admin-attachments.php?id={$x['id']}&r=1&action=delete'>Delete</a>\n\t\t\t\t\" : \"\").\"\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t</table>\";\n\t}\n\treturn \"<br/><br/><fieldset><legend>Attachments</legend>{$out}</fieldset>\";\n}", "function Links_Add(){\n\t\t\n\t\t\n\t\tif(isset($_POST['linkadd'])){\n\t\t\t\n\t\t\n\t\t\n\t\t$values = \"'\".$_POST['fb'].\"','\".$_POST['tw'].\"','\".$_POST['lk'].\"','\".$_POST['insta'].\"','\".$_POST['com'].\"','\".$_POST['doctor'].\"'\";\n\t\t\t\n\t\t\t$this->Add('links',$values,'Social-Links?List&m');\n\t\t\t\n\t\t\t\n\t\t}\n\t}", "function mm_galleryLink($fields, $roles='', $templates='', $moduleid=''){\n\tglobal $mm_fields, $modx, $content;\n\t$e = &$modx->Event;\n\n\t// if we've been supplied with a string, convert it into an array\n\t$fields = makeArray($fields);\n\n\t// if the current page is being edited by someone in the list of roles, and uses a template in the list of templates\n\tif (useThisRule($roles, $templates)) {\n\n $output = \" // ----------- Gallery Link -------------- \\n\";\n\n\t\tforeach ($fields as $field) {\n\t\t\t//ignore for now\n\t\t\tswitch ($field) {\n\n\t\t\t\t// ignore fields that can't be converted\n\t\t\t\tcase 'keywords':\n\t\t\t\tcase 'metatags':\n\t\t\t\tcase 'hidemenu':\n\t\t\t\tcase 'which_editor':\n\t\t\t\tcase 'template':\n\t\t\t\tcase 'menuindex':\n\t\t\t\tcase 'show_in_menu':\n\t\t\t\tcase 'parent':\n\t\t\t\tcase 'is_folder':\n\t\t\t\tcase 'is_richtext':\n\t\t\t\tcase 'log':\n\t\t\t\tcase 'searchable':\n\t\t\t\tcase 'cacheable':\n\t\t\t\tcase 'clear_cache':\n\t\t\t\tcase 'content_type':\n\t\t\t\tcase 'content_dispo':\n\t\t\t\tcase 'which_editor':\n\t\t\t\t\t$output .='';\n\t\t\t\tbreak;\n\n\t\t\t\t// default if not ignored\n\t\t\t\tdefault:\n\t\t\t\tif (isset($mm_fields[$field])) { // Check the fields exist, so we're not writing JS for elements that don't exist\n \t\t$output .= 'var pid'.$mm_fields[$field]['fieldname'].' = \"'.(!empty($content['id']) ? $content['id'] : 'false').'\";'.\"\\n\";\n\n \t$output .= 'var gl'.$mm_fields[$field]['fieldname'].' = $j(\"'.$mm_fields[$field]['fieldtype'].'[name='.$mm_fields[$field]['fieldname'].']\");'.\"\\n\";\n \t$output .= 'if(pid'.$mm_fields[$field]['fieldname'].' != \\'false\\'){'.\"\\n\";\n $output .= ' var galleryLink = $j(\\'<a href=\"' . $modx->config['base_url'] . 'manager/index.php?a=112&id='.$moduleid.'&action=view&content_id=\\'+pid'.$mm_fields[$field]['fieldname'].'+\\'\">Manage Photos</a>\\').insertAfter(gl'.$mm_fields[$field]['fieldname'].');'.\"\\n\";\n \t$output .= '} else {'.\"\\n\";\n $output .= ' var galleryLink = $j(\\'<p class=\"warning\">You must save this page before you can manage the photos associated with it.</p>\\').insertAfter(gl'.$mm_fields[$field]['fieldname'].');'.\"\\n\";\n \t$output .= '}'.\"\\n\";\n\t\t\t\t\t$output .= 'gl'.$mm_fields[$field]['fieldname'].'.hide();'.\"\\n\";\n\t\t\t\t} \t\t\t\t\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t$e->output($output . \"\\n\");\n\t} // end if\n}", "function & documenttypefieldlinkCreateFromArray($aParameters) {\n\t$oDocTypeField = & new DocumentTypeFieldLink($aParameters[0], $aParameters[1], $aParameters[2], $aParameters[3], $aParameters[4], $aParameters[5], $aParameters[6], $aParameters[7], $aParameters[8], $aParameters[9], $aParameters[10]);\n\treturn $oDocTypeField;\n}", "function urlConfigForm()\r\n\t{\r\n\t\t/*\tAdd the field for the back link configuration\t*/\r\n\t\tadd_settings_field('wpklikandpay_payment_success', __('Url de retour pour un paiement accept&eacute;', 'wpklikandpay'), array('wpklikandpay_option', 'urlSuccess'), 'wpklikandpayUrlConfig', 'backUrlConfig');\r\n\t\tadd_settings_field('wpklikandpay_payment_canceled', __('Url de retour pour un paiement annul&eacute;', 'wpklikandpay'), array('wpklikandpay_option', 'urlCanceled'), 'wpklikandpayUrlConfig', 'backUrlConfig');\r\n\t\tadd_settings_field('wpklikandpay_payment_declined', __('Url de retour pour un paiement refus&eacute;', 'wpklikandpay'), array('wpklikandpay_option', 'urlDeclined'), 'wpklikandpayUrlConfig', 'backUrlConfig');\r\n\t}", "function phptemplate_filefield_file($file) {\n if (empty($file['fid'])) {\n return '';\n }\n\n $path = $file['filepath'];\n $url = file_create_url($path);\n $icon = theme('filefield_icon', $file);\n\n // Set options as per anchor format described at\n $options = array(\n 'attributes' => array(\n 'type' => $file['filemime'] . '; length=' . $file['filesize'],\n ),\n );\n\n // Use the description as the link text if available.\n if (empty($file['data']['description'])) {\n $link_text = $file['filename'];\n }\n else {\n $link_text = $file['data']['description'];\n $options['attributes']['title'] = $file['filename'];\n }\n\n //open files of particular mime types in new window\n $new_window_mimetypes = array(\n 'application/pdf',\n 'text/plain'\n );\n if (in_array($file['filemime'], $new_window_mimetypes)) {\n $options['attributes']['target'] = '_blank';\n }\n\n return '<div class=\"filefield-file clear-block\">'. $icon . l($link_text, $url, $options) .'</div>';\n}", "function link_meta_box() {\n add_meta_box(\n 'global-notice',\n __( 'Link', 'sitepoint' ),\n 'link_meta_box_callback',\n 'projects',\n 'side',\n 'low'\n );\n}", "function onDisplayField(&$field, &$item)\n\t{\n\t\t// displays the field when editing content item\n\t\t$field->label = JText::_($field->label);\n\t\tif ( !in_array($field->field_type, self::$field_types) ) return;\n\n\t\t// some parameter shortcuts\n\t\t$required = $field->parameters->get('required',0);\n\t\t$required = $required ? ' required' : '';\n\t\t$embedly_key = $field->parameters->get('embedly_key','') ;\n\t\t\n\t\t// get stored field value\n\t\tif ( isset($field->value[0]) ) $value = unserialize($field->value[0]);\n\t\telse {\n\t\t\t$value['url'] = '';\n\t\t\t$value['videotype'] = '';\n\t\t\t$value['videoid'] = '';\n\t\t\t$value['title'] = '';\n\t\t\t$value['author'] = '';\n\t\t\t$value['duration'] = '';\n\t\t\t$value['description'] = '';\n\t\t}\n\t\t\n\t\t$field->html = '';\n\t\t$field->html .= '<table class=\"admintable\" border=\"0\" cellspacing=\"0\" cellpadding=\"5\">';\n\t\t$field->html .= '<tr><td class=\"key\" align=\"right\">'.JText::_('PLG_FLEXICONTENT_FIELDS_SHAREDVIDEO_VIDEO_URL').'</td><td><input type=\"text\" class=\"fcfield_textval\" name=\"custom['.$field->name.'][url]\" value=\"'.$value['url'].'\" size=\"60\" '.$required.' /> <input class=\"fcfield-button\" type=\"button\" value=\"'.JText::_('PLG_FLEXICONTENT_FIELDS_SHAREDVIDEO_FETCH').'\" onclick=\"fetchVideo_'.$field->name.'();\" /></td></tr>';\n\t\t$field->html .= '<tr><td class=\"key\" align=\"right\">'.JText::_('PLG_FLEXICONTENT_FIELDS_SHAREDVIDEO_VIDEO_TYPE').'</td><td><input type=\"text\" class=\"fcfield_textval\" name=\"custom['.$field->name.'][videotype]\" value=\"'.$value['videotype'].'\" size=\"10\" readonly=\"readonly\" style=\"background-color:#eee\" /></td></tr>';\n\t\t$field->html .= '<tr><td class=\"key\" align=\"right\">'.JText::_('PLG_FLEXICONTENT_FIELDS_SHAREDVIDEO_VIDEO_ID').'</td><td><input type=\"text\" class=\"fcfield_textval\" name=\"custom['.$field->name.'][videoid]\" value=\"'.$value['videoid'].'\" size=\"15\" readonly=\"readonly\" style=\"background-color:#eee\" /></td></tr>';\n\t\t$field->html .= '<tr><td class=\"key\" align=\"right\">'.JText::_('PLG_FLEXICONTENT_FIELDS_SHAREDVIDEO_TITLE').'</td><td><input type=\"text\" class=\"fcfield_textval\" name=\"custom['.$field->name.'][title]\" value=\"'.$value['title'].'\" size=\"60\" /></td></tr>';\n\t\t$field->html .= '<tr><td class=\"key\" align=\"right\">'.JText::_('PLG_FLEXICONTENT_FIELDS_SHAREDVIDEO_AUTHOR').'</td><td><input type=\"text\" class=\"fcfield_textval\" name=\"custom['.$field->name.'][author]\" value=\"'.$value['author'].'\" size=\"60\" /></td></tr>';\n\t\t$field->html .= '<tr><td class=\"key\" align=\"right\">'.JText::_('PLG_FLEXICONTENT_FIELDS_SHAREDVIDEO_DURATION').'</td><td><input type=\"text\" class=\"fcfield_textval\" name=\"custom['.$field->name.'][duration]\" value=\"'.$value['duration'].'\" size=\"10\" /></td></tr>';\n\t\t$field->html .= '<tr><td class=\"key\" align=\"right\">'.JText::_('PLG_FLEXICONTENT_FIELDS_SHAREDVIDEO_DESCRIPTION').'</td><td><textarea class=\"fcfield_textareaval\" name=\"custom['.$field->name.'][description]\" rows=\"7\" cols=\"50\">'.$value['description'].'</textarea></td></tr>';\n\t\t$field->html .= '<tr><td class=\"key\" align=\"right\">'.JText::_('PLG_FLEXICONTENT_FIELDS_SHAREDVIDEO_PREVIEW').'</td><td><div id=\"'.$field->name.'_thumb\">';\n\t\tif($value['videotype']!=\"\" && $value['videoid']!=\"\") {\n\t\t\t$iframecode = '<iframe class=\"sharedvideo\" src=\"';\n\t\t\tswitch($value['videotype']){\n\t\t\t\tcase \"youtube\":\n\t\t\t\t\t$iframecode .= \"//www.youtube.com/embed/\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"vimeo\":\n\t\t\t\t\t$iframecode .= \"//player.vimeo.com/video/\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"dailymotion\":\n\t\t\t\t\t$iframecode .= \"//www.dailymotion.com/embed/video/\";\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\t$iframecode .= $value['videoid'].'\" width=\"240\" height=\"135\" frameborder=\"0\" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>';\n\t\t\t$field->html .= $iframecode;\n\t\t}\n\t\t$field->html\t.= '</div></td></tr>';\n\t\t$field->html\t.= '</table>';\n\t\t$field->html \t.= '\n\t\t<script type=\"text/javascript\">\n\t\tfunction fetchVideo_'.$field->name.'() {\n\t\t\tvar fieldname = \\'custom['.$field->name.']\\';\n\t\t\tvar url = fieldname+\"[url]\";\n\t\t\turl = document.forms[\"adminForm\"].elements[url].value;\n\t\t\tvar videoID = false;\n\t\t\tvar videoType = false;\n\t\t\tif(window.console) window.console.log(\"Fetching \"+url);\n\t\t\t// try youtube\n\t\t\tvar myregexp = /(?:youtube\\.com\\/(?:[^\\/]+\\/.+\\/|(?:v|e(?:mbed)?)\\/|.*[?&]v=)|youtu\\.be\\/)([^\"&?\\/ ]{11})/i;\n\t\t\tif(url.match(myregexp) != null) {\n\t\t\t\tvideoID = url.match(myregexp)[1];\n\t\t\t\tvideoType = \"youtube\";\n\t\t\t}\n\t\t\t// try vimeo\n\t\t\tvar myregexp = /http:\\/\\/(www\\.)?vimeo.com\\/(\\d+)($|\\/)/;\n\t\t\tif(url.match(myregexp) != null) {\n\t\t\t\tvideoID = url.match(myregexp)[2];\n\t\t\t\tvideoType = \"vimeo\";\n\t\t\t}\n\t\t\t// try dailymotion\n\t\t\tvar myregexp = /^.+dailymotion.com\\/(video|hub)\\/([^_]+)[^#]*(#video=([^_&]+))?/;\n\t\t\tif(url.match(myregexp) != null) {\n\t\t\t\tvideoID = url.match(myregexp)[4]!== undefined ? url.match(myregexp)[4] : url.match(myregexp)[2];\n\t\t\t\tvideoType = \"dailymotion\";\n\t\t\t}\n\t\t\tvar jsonurl;\n\t\t\tupdateVideoInfo_'.$field->name.'({title:\"\", author:\"\", duration:\"\", description:\"\", thumb:\"\"});\n\t\t\tupdateVideoTypeId_'.$field->name.'(videoType,videoID);\n\t\t\tif(videoID && videoType){\n\t\t\t\tif(window.console) window.console.log(\"Video type: \"+videoType);\n\t\t\t\tif(window.console) window.console.log(\"Video ID: \"+videoID);\n\t\t\t\tswitch(videoType) {\n\t\t\t\t\tcase \"youtube\":\n\t\t\t\t\t\tjsonurl = \"//gdata.youtube.com/feeds/api/videos/\"+videoID+\"?v=2&alt=json-in-script&callback=youtubeCallback_'.$field->name.'\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"vimeo\":\n\t\t\t\t\t\tjsonurl = \"//vimeo.com/api/v2/video/\"+videoID+\".json?callback=vimeoCallback_'.$field->name.'\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"dailymotion\":\n\t\t\t\t\t\tjsonurl = \"https://api.dailymotion.com/video/\"+videoID+\"?fields=description,duration,owner.screenname,thumbnail_60_url,title&callback=dailymotionCallback_'.$field->name.'\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse { \n\t\t\t\t// try embed.ly\n\t\t\t\tjsonurl = \"http://api.embed.ly/1/oembed?url=\"+encodeURIComponent(url)+\"&key='.$embedly_key.'&callback=embedlyCallback_'.$field->name.'\";\n\t\t\t}\n\t\t\tif(url!=\"\") {\n\t\t\t\tvar jsonscript = document.createElement(\"script\");\n\t\t\t\tjsonscript.setAttribute(\"type\",\"text/javascript\");\n\t\t\t\tjsonscript.setAttribute(\"src\",jsonurl);\n\t\t\t\tdocument.body.appendChild(jsonscript);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tupdateVideoInfo_'.$field->name.'({title:\"\", author:\"\", duration:\"\", description:\"\", thumb:\"\"});\n\t\t\t\tupdateVideoTypeId_'.$field->name.'(\"\",\"\");\t\t\t\t\n\t\t\t}\n\t\t}\n\t\tfunction youtubeCallback_'.$field->name.'(data){\n\t\t\tupdateVideoInfo_'.$field->name.'({title: data.entry.title.$t, author: data.entry.author[0].name.$t, duration: data.entry.media$group.yt$duration.seconds, description: data.entry.media$group.media$description.$t, thumb: data.entry.media$group.media$thumbnail[0].url});\n\t\t}\n\t\tfunction vimeoCallback_'.$field->name.'(data){\n\t\t\tupdateVideoInfo_'.$field->name.'({title: data[0].title, author: data[0].user_name, duration: data[0].duration, description: data[0].description, thumb: data[0].thumbnail_small});\n\t\t}\n\t\tfunction dailymotionCallback_'.$field->name.'(data){\n\t\t\tupdateVideoInfo_'.$field->name.'({title: data.title, author: data[\"owner.screenname\"], duration: data.duration, description: data.description, thumb: data.thumbnail_60_url});\n\t\t}\n\t\tfunction embedlyCallback_'.$field->name.'(data){\n\t\t\tif(data.type!=\"error\") {\n\t\t\t\tvar myregexp = /(http|ftp|https):\\/\\/[\\w-]+(\\.[\\w-]+)+([\\w.,@?^=%&amp;:\\/~+#-]*[\\w@?^=%&amp;\\/~+#-])?/;\n\t\t\t\tif(data.html.match(myregexp) != null) {\n\t\t\t\t\tvar iframeurl = data.html.match(myregexp)[0];\n\t\t\t\t\tvar iframecode = \\'<iframe class=\"sharedvideo\" src=\"\\'+iframeurl+\\'\" width=\"240\" height=\"135\" frameborder=\"0\" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>\\';\n\t\t\t\t\tupdateVideoTypeId_'.$field->name.'(\"embed.ly:\"+data.provider_name.toLowerCase(),iframeurl);\n\t\t\t\t\tupdateVideoInfo_'.$field->name.'({title: data.title, author: data.author_name, duration: \"\", description: data.description, thumb: data.thumbnail_url});\n\t\t\t\t\tdocument.getElementById(\"'.$field->name.'_thumb\").innerHTML = iframecode;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\talert(\"'.JText::_('PLG_FLEXICONTENT_FIELDS_SHAREDVIDEO_UNABLE_TO_PARSE').'\"); \n\t\t\t\tupdateVideoInfo_'.$field->name.'({title:\"\", author:\"\", duration:\"\", description:\"\", thumb:\"\"});\n\t\t\t\tupdateVideoTypeId_'.$field->name.'(\"\",\"\");\t\t\t\t\n\t\t\t}\n\t\t}\n\t\tfunction updateVideoTypeId_'.$field->name.'(videoType,videoID){\n\t\t\tvar fieldname = \\'custom['.$field->name.']\\';\n\t\t\tfield = fieldname+\"[videotype]\";\n\t\t\tdocument.forms[\"adminForm\"].elements[field].value = videoType;\n\t\t\tfield = fieldname+\"[videoid]\";\n\t\t\tdocument.forms[\"adminForm\"].elements[field].value = videoID;\n\t\t\tif(videoType!=\"\" && videoID!=\"\") {\n\t\t\t\tvar iframecode = \\'<iframe class=\"sharedvideo\" src=\"\\';\n\t\t\t\tswitch(videoType){\n\t\t\t\t\tcase \"youtube\":\n\t\t\t\t\t\tiframecode += \"//www.youtube.com/embed/\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"vimeo\":\n\t\t\t\t\t\tiframecode += \"//player.vimeo.com/video/\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"dailymotion\":\n\t\t\t\t\t\tiframecode += \"//www.dailymotion.com/embed/video/\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tiframecode += videoID + \\'\" width=\"240\" height=\"135\" frameborder=\"0\" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>\\';\n\t\t\t\tdocument.getElementById(\"'.$field->name.'_thumb\").innerHTML = iframecode;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tdocument.getElementById(\"'.$field->name.'_thumb\").innerHTML = \"\";\n\t\t\t}\n\n\t\t}\n\t\tfunction updateVideoInfo_'.$field->name.'(data){\n\t\t\tvar fieldname = \\'custom['.$field->name.']\\';\n\t\t\tfield = fieldname+\"[title]\";\n\t\t\tdocument.forms[\"adminForm\"].elements[field].value = data.title;\n\t\t\tfield = fieldname+\"[author]\";\n\t\t\tdocument.forms[\"adminForm\"].elements[field].value = data.author;\n\t\t\tfield = fieldname+\"[duration]\";\n\t\t\tdocument.forms[\"adminForm\"].elements[field].value = data.duration;\n\t\t\tfield = fieldname+\"[description]\";\n\t\t\tdocument.forms[\"adminForm\"].elements[field].value = data.description;\n\t\t}\n\t\t</script>';\n\n\t}", "function hankart_add_manual_tab_content() {\n $file = get_field('pdf_manual');\n if( $file ): ?>\n <a target=\"_blank\" href=\"<?php echo $file['url']; ?>\"><i class=\"fas fa-file-pdf\"></i> <?php the_field('pdf_manual_title' ); // echo $file['filename']; ?></a>\n <?php endif;\n}", "function afrozaar_add_plugin_link($links)\n{\n $links[] = '<a href=\"options-general.php?page=plugin.php\">Settings</a>';\n //array_unshift($links, $settings_link);\n return $links;\n}", "public function setLink($link);", "function chocorocco_show_custom_field($id, $field, $value) {\n\t$output = '';\n\tswitch ($field['type']) {\n\t\t\n\t\tcase 'mediamanager':\n\t\t\twp_enqueue_media( );\n\t\t\t$title = empty($field['data_type']) || $field['data_type']=='image'\n\t\t\t\t\t\t\t? esc_html__( 'Choose Image', 'chocorocco')\n\t\t\t\t\t\t\t: esc_html__( 'Choose Media', 'chocorocco');\n\t\t\t$output .= '<a id=\"'.esc_attr($id).'\"'\n\t\t\t\t\t\t\t. ' class=\"button mediamanager chocorocco_media_selector\"'\n\t\t\t\t\t\t\t. '\tdata-param=\"' . esc_attr($id) . '\"'\n\t\t\t\t\t\t\t. '\tdata-choose=\"'.esc_attr(!empty($field['multiple']) ? esc_html__( 'Choose Images', 'chocorocco') : $title).'\"'\n\t\t\t\t\t\t\t. ' data-update=\"'.esc_attr(!empty($field['multiple']) ? esc_html__( 'Add to Gallery', 'chocorocco') : $title).'\"'\n\t\t\t\t\t\t\t. '\tdata-multiple=\"'.esc_attr(!empty($field['multiple']) ? '1' : '0').'\"'\n\t\t\t\t\t\t\t. '\tdata-type=\"'.esc_attr(!empty($field['data_type']) ? $field['data_type'] : 'image').'\"'\n\t\t\t\t\t\t\t. '\tdata-linked-field=\"'.esc_attr($field['linked_field_id']).'\"'\n\t\t\t\t\t\t\t. '>'\n\t\t\t\t\t\t\t. (!empty($field['multiple'])\n\t\t\t\t\t\t\t\t\t? (empty($field['data_type']) || $field['data_type']=='image'\n\t\t\t\t\t\t\t\t\t\t? esc_html__( 'Add Images', 'chocorocco')\n\t\t\t\t\t\t\t\t\t\t: esc_html__( 'Add Files', 'chocorocco')\n\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t: esc_html($title)\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t. '</a>';\n\t\t\t$output .= '<span class=\"chocorocco_meta_box_field_preview\">';\n\t\t\t$images = explode('|', $value);\n\t\t\tif (is_array($images)) {\n\t\t\t\tforeach ($images as $img)\n\t\t\t\t\t$output .= $img && !chocorocco_is_inherit($img)\n\t\t\t\t\t\t\t? '<span>'\n\t\t\t\t\t\t\t\t\t. (in_array(chocorocco_get_file_ext($img), array('gif', 'jpg', 'jpeg', 'png'))\n\t\t\t\t\t\t\t\t\t\t\t? '<img src=\"' . esc_url($img) . '\" alt=\"' . esc_html(basename($img)) . '\">'\n\t\t\t\t\t\t\t\t\t\t\t: '<a href=\"' . esc_attr($img) . '\">' . esc_html(basename($img)) . '</a>'\n\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t. '</span>' \n\t\t\t\t\t\t\t: '';\n\t\t\t}\n\t\t\t$output .= '</span>';\n\t\t\tbreak;\n\n\t\tcase 'icons':\n\t\t\t$icons_type = !empty($field['style']) \n\t\t\t\t\t\t\t? $field['style'] \n\t\t\t\t\t\t\t: chocorocco_get_theme_setting('icons_type');\n\t\t\tif (empty($field['return']))\n\t\t\t\t$field['return'] = 'full';\n\t\t\t$chocorocco_icons = $icons_type=='images'\n\t\t\t\t\t\t\t\t? chocorocco_get_list_images()\n\t\t\t\t\t\t\t\t: chocorocco_array_from_list(chocorocco_get_list_icons());\n\t\t\tif (is_array($chocorocco_icons)) {\n\t\t\t\tif (!empty($field['button']))\n\t\t\t\t\t$output .= '<span id=\"'.esc_attr($id).'\"'\n\t\t\t\t\t\t\t\t\t. ' class=\"chocorocco_list_icons_selector'\n\t\t\t\t\t\t\t\t\t\t\t. ($icons_type=='icons' && !empty($value) ? ' '.esc_attr($value) : '')\n\t\t\t\t\t\t\t\t\t\t\t.'\"'\n\t\t\t\t\t\t\t\t\t. ' title=\"'.esc_attr__('Select icon', 'chocorocco').'\"'\n\t\t\t\t\t\t\t\t\t. ' data-style=\"'.($icons_type=='images' ? 'images' : 'icons').'\"'\n\t\t\t\t\t\t\t\t\t. ($icons_type=='images' && !empty($value) \n\t\t\t\t\t\t\t\t\t\t? ' style=\"background-image: url('.esc_url($field['return']=='slug' \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t? $chocorocco_icons[$value] \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t: $value).');\"' \n\t\t\t\t\t\t\t\t\t\t\t: '')\n\t\t\t\t\t\t\t\t. '></span>';\n\t\t\t\tif (!empty($field['icons'])) {\n\t\t\t\t\t$output .= '<div class=\"chocorocco_list_icons\">';\n\t\t\t\t\tforeach($chocorocco_icons as $slug=>$icon) {\n\t\t\t\t\t\t$output .= '<span class=\"'.esc_attr($icons_type=='icons' ? $icon : $slug)\n\t\t\t\t\t\t\t\t. (($field['return']=='full' ? $icon : $slug) == $value ? ' chocorocco_list_active' : '')\n\t\t\t\t\t\t\t\t. '\"'\n\t\t\t\t\t\t\t\t. ' title=\"'.esc_attr($slug).'\"'\n\t\t\t\t\t\t\t\t. ' data-icon=\"'.esc_attr($field['return']=='full' ? $icon : $slug).'\"'\n\t\t\t\t\t\t\t\t. ($icons_type=='images' ? ' style=\"background-image: url('.esc_url($icon).');\"' : '')\n\t\t\t\t\t\t\t\t. '></span>';\n\t\t\t\t\t}\n\t\t\t\t\t$output .= '</div>';\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\n\t\tcase 'checklist':\n\t\t\tif (!empty($field['sortable']))\n\t\t\t\twp_enqueue_script('jquery-ui-sortable', false, array('jquery', 'jquery-ui-core'), null, true);\n\t\t\t$output .= '<div class=\"chocorocco_checklist chocorocco_checklist_'.esc_attr($field['dir'])\n\t\t\t\t\t\t. (!empty($field['sortable']) ? ' chocorocco_sortable' : '') \n\t\t\t\t\t\t. '\">';\n\t\t\tif (!is_array($value)) {\n\t\t\t\tif (!empty($value) && !chocorocco_is_inherit($value)) parse_str(str_replace('|', '&', $value), $value);\n\t\t\t\telse $value = array();\n\t\t\t}\n\t\t\t// Sort options by values order\n\t\t\tif (!empty($field['sortable']) && is_array($value)) {\n\t\t\t\t$field['options'] = chocorocco_array_merge($value, $field['options']);\n\t\t\t}\n\t\t\tforeach ($field['options'] as $k=>$v) {\n\t\t\t\t$output .= '<label class=\"chocorocco_checklist_item_label' \n\t\t\t\t\t\t\t\t. (!empty($field['sortable']) ? ' chocorocco_sortable_item' : '') \n\t\t\t\t\t\t\t\t. '\">'\n\t\t\t\t\t\t\t. '<input type=\"checkbox\" value=\"1\" data-name=\"'.$k.'\"'\n\t\t\t\t\t\t\t\t.( isset($value[$k]) && (int) $value[$k] == 1 ? ' checked=\"checked\"' : '')\n\t\t\t\t\t\t\t\t.' />'\n\t\t\t\t\t\t\t. (substr($v, 0, 4)=='http' ? '<img src=\"'.esc_url($v).'\">' : esc_html($v))\n\t\t\t\t\t\t. '</label>';\n\t\t\t}\n\t\t\t$output .= '</div>';\n\t\t\tbreak;\n\t\t\t\n\t\tcase 'scheme_editor':\n\t\t\tif (!is_array($value)) break;\n\t\t\t$output .= '<select class=\"chocorocco_scheme_editor_selector\">';\n\t\t\tforeach ($value as $scheme=>$v)\n\t\t\t\t$output .= '<option value=\"' . esc_attr($scheme) . '\">' . esc_html($v['title']) . '</option>';\n\t\t\t$output .= '</select>';\n\t\t\t$groups = chocorocco_storage_get('scheme_color_groups');\n\t\t\t$colors = chocorocco_storage_get('scheme_color_names');\n\t\t\t$output .= '<div class=\"chocorocco_scheme_editor_colors\">';\n\t\t\tforeach ($value as $scheme=>$v) {\n\t\t\t\t$output .= '<div class=\"chocorocco_scheme_editor_header\">'\n\t\t\t\t\t\t\t\t. '<span class=\"chocorocco_scheme_editor_header_cell\"></span>';\n\t\t\t\tforeach ($groups as $group_name=>$group_data) {\n\t\t\t\t\t$output .= '<span class=\"chocorocco_scheme_editor_header_cell\" title=\"'.esc_html($group_data['description']).'\">' \n\t\t\t\t\t\t\t\t. esc_html($group_data['title'])\n\t\t\t\t\t\t\t\t. '</span>';\n\t\t\t\t}\n\t\t\t\t$output .= '</div>';\n\t\t\t\tforeach ($colors as $color_name=>$color_data) {\n\t\t\t\t\t$output .= '<div class=\"chocorocco_scheme_editor_row\">'\n\t\t\t\t\t\t\t\t. '<span class=\"chocorocco_scheme_editor_row_cell\" title=\"'.esc_html($color_data['description']).'\">'\n\t\t\t\t\t\t\t\t. esc_html($color_data['title'])\n\t\t\t\t\t\t\t\t. '</span>';\n\t\t\t\t\tforeach ($groups as $group_name=>$group_data) {\n\t\t\t\t\t\t$slug = $group_name == 'main' \n\t\t\t\t\t\t\t\t\t? $color_name \n\t\t\t\t\t\t\t\t\t: str_replace('text_', '', \"{$group_name}_{$color_name}\");\n\t\t\t\t\t\t$output .= '<span class=\"chocorocco_scheme_editor_row_cell\">'\n\t\t\t\t\t\t\t\t\t. (isset($v['colors'][$slug])\n\t\t\t\t\t\t\t\t\t\t? \"<input type=\\\"text\\\" name=\\\"{$slug}\\\" class=\\\"iColorPicker\\\" value=\\\"\".esc_attr($v['colors'][$slug]).\"\\\">\"\n\t\t\t\t\t\t\t\t\t\t: ''\n\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t. '</span>';\n\t\t\t\t\t}\n\t\t\t\t\t$output .= '</div>';\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tbreak;\n\t}\n\treturn apply_filters('chocorocco_filter_show_custom_field', $output, $id, $field, $value);\n}", "function link_submit_meta_box($link)\n {\n }", "function my_attachments( $attachments ) {\n $fields = array( \n array(\n 'name' => 'caption', // unique field name\n 'type' => 'text', // registered field type\n 'label' => __( 'Caption', 'attachments' ), // label to display\n 'default' => 'caption', // default value upon selection\n )\n );\n\n $args = array(\n\n // title of the meta box (string)\n 'label' => 'Gallery Images',\n\n // all post types to utilize (string|array)\n 'post_type' => array( 'lwa_feature', 'lwa_news'),\n\n // meta box position (string) (normal, side or advanced)\n 'position' => 'advanced',\n\n // meta box priority (string) (high, default, low, core)\n 'priority' => 'high',\n\n // allowed file type(s) (array) (image|video|text|audio|application)\n 'filetype' => array('image'),\n\n // include a note within the meta box (string)\n 'note' => '',\n\n // append to the list\n 'append' => true,\n\n // text for 'Attach' button in meta box (string)\n 'button_text' => __( 'Add to gallery', 'attachments' ),\n\n // text for modal 'Attach' button (string)\n 'modal_text' => __( 'Add', 'attachments' ),\n\n // which tab should be the default in the modal (string) (browse|upload)\n 'router' => 'browse',\n\n 'post_parent' => true,\n\n // fields array\n 'fields' => $fields,\n\n );\n\n $attachments->register( 'my_attachments', $args ); // unique instance name\n}", "public function testAddFieldVisualisationUrl() {\n $new_field_label = 'Testing visualisation url field';\n $new_field_name = 'testing_vis_url_field';\n $storage_type = 'dvf_url';\n\n $this->addNewFieldToPage($new_field_label, $new_field_name, $storage_type);\n }", "function linkit_allowed_field_types() {\n $allowed_field_types = array(\n 'text',\n 'text_long',\n 'link_field',\n );\n drupal_alter('linkit_allowed_field_types', $allowed_field_types);\n return $allowed_field_types;\n}", "function add_image_attachment_fields_to_edit( $form_fields, $post ) {\n\n\t// Add a size\n\t$form_fields['size_width'] = array(\n\t\t\"label\" => __(\"Bredde (cm)\"),\n \"input\" => \"html\",\n\t\t\"html\" => \"<input type='number' name='attachments[{$post->ID}][size_width]' id='attachments[{$post->ID}][size_width]' min='0' value='\".get_post_meta($post->ID, '_size_width', true).\"'>\", // this is default if \"input\" is omitted\n\t);\n\n // Add a size\n $form_fields['size_height'] = array(\n \"label\" => __(\"Højde (cm)\"),\n \"input\" => \"html\",\n \"html\" => \"<input type='number' name='attachments[{$post->ID}][size_height]' id='attachments[{$post->ID}][size_height]' min='0' value='\".get_post_meta($post->ID, '_size_height', true).\"'>\",\n );\n\n\treturn $form_fields;\n}", "function add_field_to_download_form( $fields ) {\n\n\t\t\tif( is_single() && 'promocion' == get_post_type() ) {\n\t\t\t\t$fields['promo'] = get_the_title();\n\t\t\t\treturn $fields;\n\t\t\t}\n\n\t\t}", "function blankPlugin_add_settings_link( $links ) {\n $settings_link = '<a href=\"admin.php?page=blankPlugin\">' . __( 'Settings', 'blankPlugin' ) . '</a>';\n array_push( $links, $settings_link );\n \treturn $links;\n}", "function brag_add_meta_field($args) {\n \n $args['fields']['referral'] = '';\n $args['fields']['notes'] = '';\n $args['fields']['type'] = '';\n $args['fields']['lead_status'] = '';\n\n return $args;\n}", "public function addLinkingPattern(string $field_name, string $href): void\n {\n // Make and set the linking pattern\n $this->field_replacements[$field_name] = '<a href=\"'.$href.'\">{'.$field_name.'}</a>';\n }", "public static function linkField($text,$url='#',$option=array()) {\n $option['href']=$url;\n \t\treturn self::htmltag('a',$option,$text);\n\t}", "private function add_ba_plugin_settings_link() {\n\t\tfunction ba_plugin_settings_link($links, $file) {\n\t\t\tif ( $file == plugin_basename( dirname(__FILE__).'/ba-dm-plugin.php' ) ) {\t\n\t\t\t\t# Einstelungs-Menü hinten\n\t\t\t\t$links[] = '<a href=\"'.admin_url('admin.php?page=ba_dm_plugin_menu').'\">'.__('Einstellungen', 'BA DM Plugin Menü').'</a>';\n\t\t\t\t\n\t\t\t\t# Einstelungs-Menü vorne\n\t\t\t\t#$link = '<a href=\"options-general.php?page=ba_dm_plugin_menu\">'.__('Einstellungen', 'BA DM Plugin Menü').'</a>';\n\t\t\t\t#array_unshift($links, $link);\t\n\t\t\t}\n\t\t\treturn $links;\n\t\t}\n\t\t\n\t\t# meldet ein Filter für ein Einstellungs-Link bei Plugins hinzu\n\t\tadd_filter( 'plugin_action_links', 'ba_plugin_settings_link', 10, 2);\n\t}", "function be_attachment_field_credit( $form_fields, $post ) {\n\n\t$form_fields['be-photographer-name'] = array(\n\t\t'label' => 'Photographer Name',\n\t\t'input' => 'text',\n\t\t'value' => get_post_meta( $post->ID, 'be_photographer_name', true ),\n\t\t'helps' => 'If provided, photo credit will be displayed',\n\t);\n\n\t$form_fields['be-photographer-url'] = array(\n\t\t'label' => 'Photographer URL',\n\t\t'input' => 'text',\n\t\t'value' => get_post_meta( $post->ID, 'be_photographer_url', true ),\n\t\t'helps' => 'Add Photographer URL',\n\t);\n\n\treturn $form_fields;\n}", "public function __construct(\n $legend = null,\n $listing = 'sp::includes.form.media-dynamic-listing',\n $template = 'sp::includes.form.media-dynamic-template',\n $min = null,\n $max = null,\n $name = 'media',\n $type = 'media',\n $sortable = false,\n $items = [],\n $defaults = [],\n $itemsDisabled = [],\n $help = null,\n $btnConfig = 'backend.buttons',\n $before = null,\n $after = null,\n\n $formats = null,\n $size = null,\n $width = null,\n $height = null,\n $weight = null,\n $hasName = false,\n $hasPreview = false,\n $hasDownload = false,\n $required = false\n )\n {\n $this->legend = $legend;\n $this->listing = $listing;\n $this->template = $template;\n $this->min = $min;\n $this->max = $max;\n $this->name = $name;\n $this->type = $type;\n $this->sortable = $sortable;\n $this->items = $items;\n $this->defaults = $this->defineDefaults($defaults);\n $this->itemsDisabled = is_array($itemsDisabled) ? $itemsDisabled : [$itemsDisabled];\n $this->btnConfig = $btnConfig;\n $this->before = $before;\n $this->after = $after;\n\n $this->key = 'KEY_'.$type;\n $this->btnAdd = $this->defineButton('add');\n $this->btnRemove = $this->defineButton('remove');\n $this->btnDelete = $this->defineButton('delete');\n $this->btnMove = $this->defineButton('move');\n\n $this->formats = $formats;\n $this->size = $size;\n $this->width = $width;\n $this->height = $height;\n $this->weight = $weight;\n $this->hasName = $hasName;\n $this->hasPreview = $hasPreview;\n $this->hasDownload = $hasDownload;\n $this->isRequired = $required;\n $this->help = $this->defineHelp($help);\n }", "static function media_templates() { ?>\n<script id=\"tmpl-wp-form-attachment-field\" type=\"text/html\">\n<div class=\"attachment-container\">\n\t<img src=\"{{ data.type == 'image' ? data.url : data.icon }}\" />\n</div>\n<label>\n\t<span><?php esc_html_e( \"ID:\", 'wp-forms-api' ); ?></span>\n\t<input type=\"text\" name=\"{{ data.input_name }}\" class=\"wp-form-attachment-id\" value=\"{{ data.id }}\" />\n</label>\n<label>\n\t<span><?php esc_html_e( \"Title:\", 'wp-forms-api' ); ?></span>\n\t<input type=\"text\" value=\"{{ data.title }}\" readonly=\"readonly\" />\n</label>\n<label>\n\t<a href=\"{{ data.link }}\" target=\"_blank\"><?php __( \"View\", 'wp-forms-api' ); ?></a>\n</label>\n<# if(data.url) { #><span class=\"attachment-delete\"></span><# } #>\n<p>\n<# if(data.editLink) { #><a href=\"{{ data.editLink }}\">Edit</a>&nbsp;&nbsp;<# } #>\n<# if(data.url) { #><a href=\"{{ data.url }}\">View</a><# } #>\n</p>\n</script>\n\t<?php\n\t}", "function pu_register_settings()\n{\n // Register the settings with Validation callback\n register_setting('pu_theme_options', 'pu_theme_options');\n\n // Add settings section\n add_settings_section('pu_text_section', 'Social Links', 'pu_display_section', 'pu_theme_options.php');\n\n // Create textbox field\n $field_args = array(\n 'type' => 'text',\n 'id' => 'twitter_link',\n 'name' => 'twitter_link',\n 'desc' => 'Twitter Link - Example: http://twitter.com/username',\n 'std' => '',\n 'label_for' => 'twitter_link',\n 'class' => 'css_class',\n );\n\n // Add twitter field\n add_settings_field('twitter_link', 'Twitter', 'pu_display_setting', 'pu_theme_options.php', 'pu_text_section', $field_args);\n\n $field_args = array(\n 'type' => 'text',\n 'id' => 'facebook_link',\n 'name' => 'facebook_link',\n 'desc' => 'Facebook Link - Example: http://facebook.com/username',\n 'std' => '',\n 'label_for' => 'facebook_link',\n 'class' => 'css_class',\n );\n\n // Add facebook field\n add_settings_field('facebook_link', 'Facebook', 'pu_display_setting', 'pu_theme_options.php', 'pu_text_section', $field_args);\n\n $field_args = array(\n 'type' => 'text',\n 'id' => 'gplus_link',\n 'name' => 'gplus_link',\n 'desc' => 'Google+ Link - Example: http://plus.google.com/user_id',\n 'std' => '',\n 'label_for' => 'gplus_link',\n 'class' => 'css_class',\n );\n\n // Add Google+ field\n add_settings_field('gplus_link', 'Google+', 'pu_display_setting', 'pu_theme_options.php', 'pu_text_section', $field_args);\n\n $field_args = array(\n 'type' => 'text',\n 'id' => 'youtube_link',\n 'name' => 'youtube_link',\n 'desc' => 'Youtube Link - Example: https://www.youtube.com/channel/channel_id',\n 'std' => '',\n 'label_for' => 'youtube_link',\n 'class' => 'css_class',\n );\n\n // Add youtube field\n add_settings_field('youtube_ink', 'Youtube', 'pu_display_setting', 'pu_theme_options.php', 'pu_text_section', $field_args);\n\n $field_args = array(\n 'type' => 'text',\n 'id' => 'linkedin_link',\n 'name' => 'linkedin_link',\n 'desc' => 'LinkedIn Link - Example: http://linkedin.com/in/username',\n 'std' => '',\n 'label_for' => 'linkedin_link',\n 'class' => 'css_class',\n );\n\n // Add LinkedIn field\n add_settings_field('linkedin_link', 'LinkedIn', 'pu_display_setting', 'pu_theme_options.php', 'pu_text_section', $field_args);\n\n $field_args = array(\n 'type' => 'text',\n 'id' => 'instagram_link',\n 'name' => 'instagram_link',\n 'desc' => 'Instagram Link - Example: http://instagram.com/username',\n 'std' => '',\n 'label_for' => 'instagram_link',\n 'class' => 'css_class',\n );\n\n // Add Instagram field\n add_settings_field('instagram_link', 'Instagram', 'pu_display_setting', 'pu_theme_options.php', 'pu_text_section', $field_args);\n\n // Add settings section title here\n add_settings_section('section_name_here', 'Section Title Here', 'pu_display_section', 'pu_theme_options.php');\n\n // Create textarea field\n $field_args = array(\n 'type' => 'textarea',\n 'id' => 'settings_field_1',\n 'name' => 'settings_field_1',\n 'desc' => 'Setting Description Here',\n 'std' => '',\n 'label_for' => 'settings_field_1',\n );\n\n // section_name should be same as section_name above (line 116)\n add_settings_field('settings_field_1', 'Setting Title Here', 'pu_display_setting', 'pu_theme_options.php', 'section_name_here', $field_args);\n\n // Copy lines 118 through 129 to create additional field within that section\n // Copy line 116 for a new section and then 118-129 to create a field in that section\n}", "function acf_get_field_group_edit_link($post_id)\n{\n}", "function inline_settings_link( $links ) {\n $settings_link = '<a href=\"'.admin_url( 'options-general.php?page=like-fb-option' ).'\">Settings</a>';\n array_push( $links, $settings_link );\n return $links;\n}", "function getFieldLinks2() {\n return $this->fieldLinks2;\n }", "protected function configureFormFields(FormMapper $formMapper)\n {\n // get the current Image instance\n $image = $this->getSubject();\n\n // use $fileFieldOptions so we can add other options to the field\n $fileFieldOptions = array('required' => false);\n if ($image && ($webPath = $image->getThumbWebPath())) {\n // get the container so the full path to the image can be set\n $container = $this->getConfigurationPool()->getContainer();\n $fullPath = $container->get('request')->getBasePath().'/'.$webPath;\n\n // add a 'help' option containing the preview's img tag\n \t$fileFieldOptions['help'] = '<img src=\"'.$fullPath.'\" class=\"admin-preview\" />';\n\t\t\t$fileFieldOptions['label'] = 'Иконка';\n\t\t}\n\t\t\t\t\n\t\t\n\t\t$videoFieldOptions = array('required' => false);\n if ($image && ($webPath = $image->getVideoWebPath())) {\n // get the container so the full path to the image can be set\n $container = $this->getConfigurationPool()->getContainer();\n $fullPath = $container->get('request')->getBasePath().'/'.$webPath;\n\n // add a 'help' option containing the preview's img tag\n \t$videoFieldOptions['help'] = '<video id=\"sampleMovie\" width=\"640\" height=\"360\" preload controls><source src=\"'.$fullPath.'\" /></video>';\n\t\t\t$videoFieldOptions['label'] = 'Видео';\n\t\t}\t\t\n\t\t\n\t\t\t\t\n $formMapper\n ->add('name_rus', 'text', array('label' => 'Имя книги (RU)'))\n ->add('name_eng', 'text', array('label' => 'Имя книги (ENG)'))\t\t\t\t\n ->add('description_rus', 'textarea', array('label' => 'Описание книги (RU)'))\n ->add('description_eng', 'textarea', array('label' => 'Описание книги (ENG)'))\t\t\t\t\n\t\t\t->add('education', 'choice', array(\n\t\t 'choices' => array(\n\t\t '0' => 'Нет',\n\t\t '1' => 'Да',\n\t\t ),\n\t\t 'empty_value' => false,// unset this and empty would work also\n\t\t 'required' => false,\n\t\t\t\t\t'label' => 'Обучающая'\t\t\t\t\t\n\t\t ))\t\t\t\t\n ->add('itunesurl_rus', 'text', array('label' => 'Ссылка в AppStore (RU)'))\t\t\t\t\n ->add('itunesurl_eng', 'text', array('label' => 'Ссылка в AppStore (ENG)'))\t\t\t\t\t\t\t\t\t\t\n ->add('scheme')\n\t\t\t->add('thumb', 'file', $fileFieldOptions)\n\t\t\t->add('video', 'file', $videoFieldOptions)\n\t\t\t\t\n ;\n }", "function link_target_meta_box($link)\n {\n }", "public function blockMediaAdminField(){\n $editableField=new VV_admin_field();\n $editableField->init($this->block->getContent(),\"theFile\");\n return $editableField;\n }", "function addToField(\\Foundation\\Form\\Field $field);", "function extraFields() {\n\t\n\t\t$file_id = JRequest::getVar('id');\n\t\t$filename = JRequest::getVar('filename');\n\t\t\n\t\tif (!$filename) {\n\t\t\texit();\n\t\t}\n\t\t\n\t\t$model = $this->getModel();\n\t\t$form = $model->getFieldForm($file_id, 'bulk');\n\t\t\n\t\tif (!$form) {\n\t\t\techo \"There was an error creating the form\";\n\t\t\texit();\n\t\t}\n\t\t\n\t\techo '<div class=\"fltlft\" style=\"width:250px;\">';\n\t\techo '<fieldset class=\"adminform\">';\n\t\techo '<legend>Edit '.$filename.'</legend>';\n\t\techo '<div class=\"adminformlist\">';\n\n\t\tforeach ($form->getFieldset() as $field) {\n\t\t\tJHtml::_('wbty.renderField', $field);\n\t\t}\n\t\techo \"</div></fieldset></div>\";\n\t\t\n\t\texit();\n\t}", "function plugin_add_settings_link($links, $file) {\r\n\t\t\tif ( $file == $this->filename ){\r\n\t\t\t\t$settings_link = '<a href=\"options-general.php?page=' .$this->slug . '\">' . __('Settings', $this->slug) . '</a>';\r\n\t\t\t\tarray_unshift( $links, $settings_link );\r\n\t\t\t}\r\n\t\t\treturn $links;\r\n\t\t}", "public function displayAddLink($type, $attachedTo ='')\n {\n $pagingAllowed = null;\n if($this->_enablePaging && isset($_REQUEST['pagingAllowed']))\n {\n $pagingAllowed = \"<input type=\\\"hidden\\\" name=\\\"pagingAllowed\\\" value=\\\"\".$_REQUEST['pagingAllowed'].\"\\\">\";\n }\n\n $skip = null;\n if(isset($_REQUEST['skip']))\n {\n $skip = \"<input type=\\\"hidden\\\" name=\\\"skip\\\" value=\\\"\".$_REQUEST['skip'].\"\\\">\";\n }\n\n echo $attachedTo.\"<br>\";\n $pos = Utility::reverseFind($attachedTo, '/');\n if ($pos != FALSE)\n {\n $attachedTo = substr($attachedTo, 0, $pos);\n }\n $object = $this->getObject($type);\n echo \"<table style=\\\"border: thin solid #C0C0C0;\\\" border=\\\"1\\\">\";\n echo \"<form action=\\\"\" . $this->_containerScriptName . \"?query=\". $this->_query\n . \"&serviceUri=\"\n . $this->_uri\n . \"&Type=\"\n . $type\n . \"&AttachQuery=\"\n . $attachedTo\n . \"\\\" method=\\\"post\\\">\"\n . $pagingAllowed\n . $skip;\n echo \"<tr align=\\\"center\\\" style=\\\"font-family: Calibri; \"\n .\"background-color: #97CC00\\\">\"\n . \"<td Colspan =\\\"2\\\">\"\n . get_class($object)\n . \"</td></tr>\";\n echo \"<tr style=\\\"font-family: Calibri; \"\n .\"background-color: #99CCFF\\\">\"\n .\"<td>Field</td>\"\n .\"<td>Value</td></tr>\";\n foreach ($object->getEntityKeys() as $key)\n {\n echo \"<tr style=\\\"font-family: Calibri; \"\n . \"background-color: #CCFFFF\\\">\";\n echo \"<td style=\\\"width=175pt\\\">\"\n . $key\n . \"*</td>\";\n echo \"<td ><input size = \\\"125\\\" name=\\\"\"\n . $key\n . \"\\\" type=\\\"text\\\" /></td>\";\n echo \"</tr>\";\n }\n echo \"<tr>\";\n echo \"<td colspan=\\\"2\\\" style=\\\"width=70\\\"><input id=\\\"btnAddLink\\\"\"\n .\" type=\\\"submit\\\" name=\\\"btnAddLink\\\" value=\\\"Save\\\"/></td>\";\n echo \"</tr>\";\n echo \"</form>\";\n echo \"</table>\";\n }", "protected function addTargetField($form, array $options)\n {\n $rootFormName = $form->getRoot()->getName();\n\n if ($options['withTarget']) {\n $form->add('target', ChoiceType::class, [\n 'label' => 'form.link_type.target.label',\n 'required' => true,\n 'choices' => [\n 'form.link_type.choice.target.parent' => Link::TARGET_PARENT,\n 'form.link_type.choice.target.blank' => Link::TARGET_BLANK,\n 'form.link_type.choice.target.ajax-modal' => Link::TARGET_MODAL,\n ],\n 'choices_as_values' => true,\n 'attr' => [\n 'data-refreshOnChange' => 'true',\n 'data-target' => $options['refresh-target'] ?: 'form[name=\"'.$rootFormName.'\"]',\n ],\n 'vic_vic_widget_form_group_attr' => ['class' => 'vic-form-group viewReference-type page-type url-type route-type attachedWidget-type'],\n ]);\n }\n }", "public function uultra_load_custom_link_options()\r\n\t{\t\t\t\t\t\r\n\t\tglobal $xoouserultra;\r\n\t\t\r\n\t\t$key = $_POST[\"link_id\"];\r\n\t\t$package_id = $_POST[\"package_id\"];\r\n\t\t\r\n\t\t$html = '';\t\t\r\n\t\t//$modules = get_option('userultra_default_user_features_custom');\r\n\t\t$modules = $this->uultra_get_user_navigator_for_membership($package_id );\t\t\r\n\t\t$module = $modules[$key];\r\n\t\t\r\n\t\tif($module[\"link_type\"]!='custom')\r\n\t\t{\t\t \r\n\t\t\t$disable = 'readonly=\"readonly\"';\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\tif($package_id=='')\r\n\t\t{\r\n\t\t\t$btn_submit_class = 'uultra-links-edit-content-btn';\t\r\n\t\t\t\r\n\t\t}else{\r\n\t\t\t\r\n\t\t\t$btn_submit_class = 'uultra-links-edit-content-btn-membership';\r\n\t\t}\r\n\t\t\r\n\t\t$html .= '<p><strong>'.__('Title', 'xoousers').'</strong></p>';\r\n\t\t$html .= '<p><input type=\"text\" name=\"uultra-link-name-'.$key.'\" id=\"uultra-link-name-'.$key.'\" value=\"'.$module['title'].'\"></p>';\r\n\t\t\r\n\t\t$html .= '<p><strong>'.__('Slug', 'xoousers').'</strong></p>';\r\n\t\t$html .= '<p><input type=\"text\" name=\"uultra-link-slug-'.$key.'\" id=\"uultra-slug-name-'.$key.'\" value=\"'.$module['slug'].'\" '.$disable.'></p>';\t\r\n\t\t\r\n\t\t$html .= '<p><strong>'.__('Font Awesome Icon', 'xoousers').'</strong></p>';\r\n\t\t$html .= '<p><input type=\"text\" name=\"uultra-link-icon-'.$key.'\" id=\"uultra-icon-name-'.$key.'\" value=\"'.$module['icon'].'\" ><span><a href=\"http://fortawesome.github.io/Font-Awesome/icons/\" target=\"_blank\">'.__('find more','xoousers').'</a></span></p>';\t\t\t\t\t\r\n\t\t\t\r\n\t\t\t$html .= ' <p class=\"submit\">\r\n\t\t\t\t\t<input type=\"button\" name=\"submit\" class=\"button button-primary '.$btn_submit_class.'\" value=\"'.__('Submit','xoousers'). '\" uultra-linkid = '.$key.' /> <span id=\"uultra-add-new-links-m-w-d-'.$key.'\" ></span>\r\n\t\t\t\t</p> ';\t\r\n\t\t\t\t\r\n\t\t //\r\n\t\t\t \r\n\t\t//if($module[\"link_type\"] =='custom')\r\n\t\t//{\t\t \r\n\t\t\t\t $html .= '<p><strong>'.__('Edit Content:', 'xoousers').'</strong></p>';\r\n\t\t\t\t $html .= '<p>'.__('You can edit what the user will see by clicking on the following button:', 'xoousers').'</p>';\t\t\r\n\t\t\t\t \r\n\t\t\t\t $html .= ' <p class=\"submit\">\r\n\t\t\t\t\t<input type=\"button\" name=\"submit\" class=\"button button-primary uultra-links-edit-text-btn\" value=\"'.__('Click to edit content','xoousers'). '\" uultra-linkid = '.$key.' /> <span id=\"uultra-add-new-links-m-w-text-'.$key.'\" ></span>\r\n\t\t\t\t</p> ';\t\r\n\t\t\t\t\t\t \r\n\t\t\t\t $html .= '<p style=\"text-align:right;\"><a href=\"#\" class=\"uultra-delete-custom-link\" uultra-linkid=\"'.$key.'\">delete</a></p>';\r\n\t\t\t\r\n\t\t//}\r\n\t\t\r\n\t\techo $html;\r\n\t\tdie();\r\n\t\r\n\t}" ]
[ "0.66452134", "0.65613705", "0.65001756", "0.64660347", "0.6462377", "0.64530706", "0.6438593", "0.6426514", "0.6403927", "0.6367895", "0.6367025", "0.63462216", "0.63263774", "0.6325542", "0.6318689", "0.6259789", "0.6249052", "0.6179674", "0.61734796", "0.61475843", "0.6103962", "0.6037896", "0.6017111", "0.5998268", "0.59947485", "0.5945726", "0.59331924", "0.5932568", "0.5911656", "0.5893959", "0.58634794", "0.58526456", "0.5845422", "0.58351", "0.58330476", "0.5825945", "0.58126736", "0.5804319", "0.5797669", "0.57795167", "0.577377", "0.57720286", "0.57660127", "0.57648385", "0.5752819", "0.5739684", "0.5720959", "0.571679", "0.5677815", "0.5666488", "0.5662953", "0.5662249", "0.5662231", "0.56452584", "0.56420416", "0.56403804", "0.56390417", "0.56369907", "0.5633152", "0.5623413", "0.56131226", "0.5611188", "0.5608888", "0.55907756", "0.5581973", "0.55816746", "0.55796856", "0.55780196", "0.5560506", "0.5555659", "0.5555226", "0.55413884", "0.5538524", "0.5524025", "0.55204815", "0.55199057", "0.5513831", "0.5508208", "0.55053747", "0.5501928", "0.54975855", "0.5490816", "0.54823536", "0.5476567", "0.54699624", "0.54597", "0.5454187", "0.54455435", "0.54452366", "0.54430836", "0.5434281", "0.54222155", "0.5416242", "0.5415549", "0.54103523", "0.54050845", "0.54016566", "0.5389263", "0.5384356", "0.53824925" ]
0.8114813
0
Save our new "Link" field
public function add_Link_field_to_media_uploader_save( $post, $attachment ) { if ( ! empty( $attachment['link_field'] ) ) update_post_meta( $post['ID'], 'space_boxes_img_link', $attachment['link_field'] ); else delete_post_meta( $post['ID'], 'space_boxes_img_link' ); return $post; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function save()\n\t{\n\t\tJRequest::checkToken() or jexit( 'Invalid Token' );\n\n\t\t$post\t= JRequest::get('post');\n\t\t$cid\t= JRequest::getVar( 'cid', array(0), 'post', 'array' );\n\t\t$post['id'] = (int) $cid[0];\n\n\t\t$model = $this->getModel('weblink');\n\n\t\tif ($model->store($post)) {\n\t\t\t$msg = JText::_( 'Weblink Saved' );\n\t\t} else {\n\t\t\t$msg = JText::_( 'Error Saving Weblink' );\n\t\t}\n\n\t\t// Check the table in so it can be edited.... we are done with it anyway\n\t\t$model->checkin();\n\t\t$link = 'index.php?option=com_weblinks';\n\t\t$this->setRedirect($link, $msg);\n\t}", "public function save(GC_Model_Link $object)\n {\n $data = array(\n\t\t\t\t'nome' => $object->getNome(),\n\t\t\t\t'descricao' => $object->getDescricao(),\n\t\t\t\t'url' => $object->getUrl(),\n\t\t\t\t'validade_inicio' => $object->getValidadeInicio(),\n\t\t\t\t'validade_termino' => $object->getValidadeTermino(),\n\t\t\t\t'data_desativacao' => $object->getDataDesativacao(),\n\t\t\t\t'data_auto_reativar' => $object->getDataAutoReativar(),\n\t\t\t\t'motivo_desativacao' => $object->getMotivoDesativacao(),\n 'menu' => $object->getMenu(),\n 'rowinfo'=> $object->getRowinfo(),\n\n );\n\n if (null === ($id = $object->getId())) {\n unset($data['id']);\n $object->setId($this->getDbTable()->insert($data));\n } else {\n $this->getDbTable()->update($data, array('id = ?' => $id));\n }\n }", "public function save()\r\n\t{\r\n\t\t// save the parent object and thus the status table\r\n\t\tparent::save();\r\n\t\t// grab the newly inserted status ID\r\n\t\t$id = $this->getID();\r\n\t\t// insert into the link status table, using the same ID\r\n\t\t$extended = array();\r\n\t\t$extended['id'] = $id;\r\n\t\t$extended['URL'] = $this->url;\r\n\t\t$extended['description'] = $this->description;\r\n\t\t$this->registry->getObject('db')->insertRecords( 'statuses_links', $extended );\r\n\t}", "public function uploadlink() {\n $defaults = array();\n\n $defaults[\"straat\"] = \"straatnaam of de naam van de buurt\";\n $defaults[\"huisnummer\"] = \"huisnummer\";\n $defaults[\"maker\"] = \"maker\";\n $defaults[\"personen\"] = \"namen\";\n $defaults[\"datum\"] = \"datum of indicatie\";\n $defaults[\"titel\"] = \"titel\";\n $defaults[\"naam\"] = \"Je naam\";\n $defaults[\"email\"] = \"Je e-mailadres\";\n $defaults[\"tags\"] = \"\";\n\n $this->set('defaults', $defaults);\n }", "function press_save_link( $post_id ){\n\tif ( !isset( $_POST['press_link_box_nonce'] ) || !wp_verify_nonce( $_POST['press_link_box_nonce'], basename( __FILE__ ) ) ){\n\treturn;}\n \n // Check the user's permissions.\nif ( ! current_user_can( 'edit_post', $post_id ) ){\n\treturn;\n}\n if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) {\n return $post_id;\n}\n //save value\n if ( isset( $_REQUEST['press_link'] ) ) {\n\tupdate_post_meta( $post_id, '_press_link', sanitize_text_field( $_POST['press_link'] ) );\n}\n \n}", "function save()\n\t{\n\t\t// Check for request forgeries\n\t\tJRequest::checkToken() or jexit('Invalid Token');\n\n\t\t// Get some objects from the JApplication\n\t\t$db\t\t= &JFactory::getDbo();\n\t\t$user\t= &JFactory::getUser();\n\n\t\t// Must be logged in\n\t\tif ($user->get('id') < 1) {\n\t\t\tJError::raiseError(403, JText::_('ALERTNOTAUTH'));\n\t\t\treturn;\n\t\t}\n\n\t\t//get data from the request\n\t\t$post = JRequest::getVar('jform', array(), 'post', 'array');\n\n\t\t$model = $this->getModel('weblink');\n\n\t\tif ($model->store($post)) {\n\t\t\t$msg = JText::_('Weblink Saved');\n\t\t} else {\n\t\t\t$msg = JText::_('Error Saving Weblink');\n\t\t}\n\n\t\t// Check the table in so it can be edited.... we are done with it anyway\n\t\t$model->checkin();\n\n\t\t// Get the user groups setup to receive notifications of new weblinks.\n\t\t$access = new JAccess();\n\t\t$groups = $access->getAuthorisedUsergroups('com_weblinks.submit.notify');\n\t\t$groups = count($groups) ? implode(',', $groups) : '0';\n\n\t\t// list of admins\n\t\t$query = 'SELECT u.email, u.name' .\n\t\t\t\t' FROM #__users AS u' .\n\t\t\t\t' JOIN #__users_usergroup_map AS m ON m.group_id IN ('.$groups.')' .\n\t\t\t\t' AND u.sendEmail = 1';\n\t\t$db->setQuery($query);\n\t\tif (!$db->query()) {\n\t\t\tJError::raiseError(500, $db->stderr(true));\n\t\t\treturn;\n\t\t}\n\t\t$adminRows = $db->loadObjectList();\n\n\t\t// send email notification to admins\n\t\tforeach ($adminRows as $adminRow) {\n\t\t\tJUtility::sendAdminMail($adminRow->name, $adminRow->email, '', JText::_('Web Link'), $post['title'].\" URL link \".$post[url], $user->get('username'), JURI::base());\n\t\t}\n\n\t\t$this->setRedirect(JRoute::_('index.php?option=com_weblinks&view=category&id='.$post['catid'], false), $msg);\n\t}", "public function save()\r\n {\r\n $changes = array();\r\n\tforeach( $this->saveable_fields as $field )\r\n\t{\r\n\t $changes[ $field ] = $this->$field;\r\n\t}\r\n\t$this->registry->getObject('db')->insertRecords( 'links', $changes );\r\n\t$uid = $this->registry->getObject('db')->lastInsertID();\r\n\treturn $uid; \r\n }", "function save($ref){\n //this primarily means add/update links\n\n //lookup user id.\n DB::db_query(\"user_id_lookup\", \"SELECT id FROM \\\"user\\\" WHERE username='\".$_SESSION[\"username\"].\"';\");\n if(DB::db_check_result(\"user_id_lookup\") > 0){\n $user_id = DB::db_get_field(\"user_id_lookup\", \"id\"); \n if($user_id == \"\") error(\"Bad User id.\"); \n }\n \n //lookup reference id\n DB::db_query(\"reference_id_lookup\", \"SELECT id FROM reference WHERE reference_id='\".$ref->reference_id.\"';\");\n if(DB::db_check_result(\"reference_id_lookup\") > 0){\n $reference_id = DB::db_get_field(\"reference_id_lookup\", \"id\");\n if($reference_id == \"\") error(\"Bad Reference id.\"); \n }\n\n if(!isset($ref->id)){\n \n //this means we are inserting so we need to: look up the\n //inserted reference's id, look up the users id, then\n //insert the REFERENCE_OF_USER link as appropriate.\n\n $link = new Link;\n $link->from_id = $reference_id;\n $link->to_id = $user_id;\n $link->type = LINK_REFERENCE_OF_USER;\n $link->save();\n \n }\n\n /* This is not being used atm as resource_id is in the reference table\n\n //we are updating hence we need to: check if the\n //REFERENCE_FROM_RESOURCE appropriate link exists, if it doesn't\n //then add it.\n\n if($ref->resource_id != \"\" && $ref->resource_id != \"-1\"){\n\n echo \"here\";\n \n\n DB::db_query(\"link_id_lookup\", \"SELECT id FROM links WHERE from_id='\".$ref->reference_id.\"' \n AND to_id='\".$ref->resource_id.\"' \n AND type='\".LINK_REFERENCE_FROM_RESOURCE.\"';\");\n if(DB::db_num_rows(\"link_id_lookup\") <= 0){\n \n $link = new Link;\n $link->id = $link_id;\n $link->from_id = $reference_id;\n $link->to_id = $ref->resource_id;\n $link->type = LINK_REFERENCE_FROM_RESOURCE;\n $link->save(); \n \n }\n \n } */\n \n }", "function setUrlLink(){\n if( $this->id == 0 ) return;\n $url = $this->aFields[\"url\"]->toString();\n if( $url == \"\" ) return;\n $url = strip_tags( preg_replace( \"/[\\\"']/\", \"\", $url ) );\n if( !$this->aFields[\"url\"]->editable ) $this->aFields[\"url\"]->display = false;\n $this->aFields[\"url_link\"]->display = true;\n $this->aFields[\"url_link\"]->value = \"<a href=\\\"\".$url.\"\\\">\".$url.\"</a>\";\n }", "public function setLink($link);", "public function store(LinkRequest $request)\n {\n $links = new link;\n\n $links -> name = $request -> input('name','');\n $links -> url = $request -> input('url','');\n\n if($links -> save()){\n return redirect('/admin/link') -> with('success','添加成功');\n }else{\n return back() -> with('error','添加失败');\n }\n }", "function videos_save_link( $post_id ){\n\tif ( !isset( $_POST['yt_link_box_nonce'] ) || !wp_verify_nonce( $_POST['yt_link_box_nonce'], basename( __FILE__ ) ) ){\n\treturn;}\n \n // Check the user's permissions.\nif ( ! current_user_can( 'edit_post', $post_id ) ){\n\treturn;\n}\n if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) {\n return $post->ID;\n}\n //save value\n if ( isset( $_REQUEST['yt_link'] ) ) {\n\tupdate_post_meta( $post_id, '_yt_link', sanitize_text_field( $_POST['yt_link'] ) );\n}\n \n}", "public function save_links($data){\n\n // Insert Data In Links Table\n $this->db->insert($data,'links');\n \n }", "public function store(LinkPost $request)\n {\n $link = new Link();\n $link->name = $request->name;\n $link->active = $request->active;\n $link->parent_id = $request->parent_id;\n $link->save();\n\n return redirect()->route(\"admin.links.index\")\n ->with(Messages::SUCCESS, Messages::LINK[Messages::CREATED]);\n }", "public static function addnew(Link $link)\n {\n $ID=$user->ID;\n $PhysicalAddress=$Link->PhysicalAddress;\n $FriendlyAddress=$Link->FriendlyAddress;\n date_default_timezone_set(\"Africa/Cairo\");\n $today = date(\"Y-m-d H:i:s\");\n DB::add(\"links\",\"PhysicalAddress,FriendlyAddress,CreatedDateTime,LastUpdatedDateTime,IsDeleted\",\"'$PhysicalAddress','$FriendlyAddress','$today','$today',0\");\n \n \n // $conn->close();\n //header(\"Location:AddLink.php\");\n }", "public function setLink(string $value): Save\n {\n $this->link = $value;\n return $this;\n }", "function save()\n\t{\n\t\t// Check for request forgeries.\n\t\tJRequest::checkToken() or jexit(JText::_('Invalid_Token'));\n\n\t\t// Initialize variables.\n\t\t$app = & JFactory::getApplication();\n\n\t\t// Get the posted values from the request.\n\t\t$data = JRequest::getVar('jform', array(), 'post', 'array');\n\n\t\t// Populate the row id from the session.\n\t\t$data['id'] = (int) $app->getUserState('redirect.edit.link.id');\n\n\t\t// Get the model and attempt to validate the posted data.\n\t\t$model = & $this->getModel('Link', 'RedirectModel');\n\t\t$return\t= $model->validate($data);\n\n\t\t// Check for validation errors.\n\t\tif ($return === false)\n\t\t{\n\t\t\t// Get the validation messages.\n\t\t\t$errors\t= $model->getErrors();\n\n\t\t\t// Push up to three validation messages out to the user.\n\t\t\tfor ($i = 0, $n = count($errors); $i < $n && $i < 3; $i++)\n\t\t\t{\n\t\t\t\tif (JError::isError($errors[$i])) {\n\t\t\t\t\t$app->enqueueMessage($errors[$i]->getMessage(), 'notice');\n\t\t\t\t} else {\n\t\t\t\t\t$app->enqueueMessage($errors[$i], 'notice');\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Save the data in the session.\n\t\t\t$app->setUserState('redirect.edit.link.data', $data);\n\n\t\t\t// Redirect back to the edit screen.\n\t\t\t$this->setRedirect(JRoute::_('index.php?option=com_redirect&view=link&layout=edit&hidemainmenu=1', false));\n\t\t\treturn false;\n\t\t}\n\n\t\t// Attempt to save the data.\n\t\t$return\t= $model->save($data);\n\n\t\t// Check for errors.\n\t\tif ($return === false)\n\t\t{\n\t\t\t// Save the data in the session.\n\t\t\t$app->setUserState('redirect.edit.link.data', $data);\n\n\t\t\t// Redirect back to the edit screen.\n\t\t\t$this->setMessage(JText::sprintf('Redirect_Link_Save_Failed', $model->getError()), 'notice');\n\t\t\t$this->setRedirect(JRoute::_('index.php?option=com_redirect&view=link&layout=edit&hidemainmenu=1', false));\n\t\t\treturn false;\n\t\t}\n\n\t\t// Redirect the user and adjust session state based on the chosen task.\n\t\tswitch ($this->_task)\n\t\t{\n\t\t\tcase 'apply':\n\t\t\t\t// Redirect back to the edit screen.\n\t\t\t\t$this->setMessage(JText::_('Redirect_Link_Save_Success'));\n\t\t\t\t$this->setRedirect(JRoute::_('index.php?option=com_redirect&view=link&layout=edit&hidemainmenu=1', false));\n\t\t\t\tbreak;\n\n\t\t\tcase 'save2new':\n\t\t\t\t// Clear the link id from the session.\n\t\t\t\t$app->setUserState('redirect.edit.link.id', null);\n\n\t\t\t\t// Redirect back to the edit screen.\n\t\t\t\t$this->setMessage(JText::_('Redirect_Link_Save_Success'));\n\t\t\t\t$this->setRedirect(JRoute::_('index.php?option=com_redirect&view=link&layout=edit&hidemainmenu=1', false));\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\t// Clear the link id from the session.\n\t\t\t\t$app->setUserState('redirect.edit.link.id', null);\n\n\t\t\t\t// Redirect to the list screen.\n\t\t\t\t$this->setMessage(JText::_('Redirect_Link_Save_Success'));\n\t\t\t\t$this->setRedirect(JRoute::_('index.php?option=com_redirect&view=links', false));\n\t\t\t\tbreak;\n\t\t}\n\n\t\t// Flush the data from the session.\n\t\t$app->setUserState('redirect.edit.link.data', null);\n\t}", "function owa_post_link($link) {\r\n\r\n\t$owa = owa_getInstance();\r\n\r\n\treturn $owa->add_link_tracking($link);\r\n\t\t\r\n}", "function formLink(){\n\t\t$yuiSuggest = &weSuggest::getInstance();\n\n\t\t$textname = 'we_' . $this->Name . '_txt[LinkPath]';\n\t\t$idname = 'we_' . $this->Name . '_txt[LinkID]';\n\t\t$extname = 'we_' . $this->Name . '_txt[LinkHref]';\n\t\t$linkType = $this->getElement('LinkType') ? : 'no';\n\t\t$linkPath = f('SELECT Path FROM ' . FILE_TABLE . ' WHERE ID = ' . intval($this->getElement('LinkID')), '', $this->DB_WE);\n\n\t\t$RollOverFlagName = 'we_' . $this->Name . '_txt[RollOverFlag]';\n\t\t$RollOverFlag = $this->getElement('RollOverFlag') ? 1 : 0;\n\t\t$RollOverIDName = 'we_' . $this->Name . '_txt[RollOverID]';\n\t\t$RollOverID = $this->getElement('RollOverID') ? : '';\n\t\t$RollOverPathname = 'we_' . $this->Name . '_txt[RollOverPath]';\n\t\t$RollOverPath = f('SELECT Path FROM ' . FILE_TABLE . ' WHERE ID = ' . intval($RollOverID), '', $this->DB_WE);\n\n\t\t$checkFlagName = 'check_' . $this->Name . '_RollOverFlag';\n\t\t$cmd1 = \"document.we_form.elements['\" . $idname . \"'].value\";\n\t\t$but1 = we_html_button::create_button(we_html_button::SELECT, \"javascript:we_cmd('we_selector_document', \" . $cmd1 . \",'\" . FILE_TABLE . \"','\" . we_base_request::encCmd($cmd1) . \"','\" . we_base_request::encCmd(\"document.we_form.elements['\" . $textname . \"'].value\") . \"','\" . we_base_request::encCmd(\"opener._EditorFrame.setEditorIsHot(true);opener.document.we_form.elements['we_\" . $this->Name . \"_txt[LinkType]'][2].checked=true;\") . \"','',0,'',\" . (permissionhandler::hasPerm(\"CAN_SELECT_OTHER_USERS_FILES\") ? 0 : 1) . \");\");\n\n\t\t$cmd1 = \"document.we_form.elements['\" . $RollOverIDName . \"'].value\";\n\t\t$but2 = we_html_button::create_button(we_html_button::SELECT, \"javascript:we_cmd('we_selector_image', \" . $cmd1 . \",'\" . FILE_TABLE . \"','\" . we_base_request::encCmd($cmd1) . \"','\" . we_base_request::encCmd(\"document.we_form.elements['\" . $RollOverPathname . \"'].value\") . \"','\" . we_base_request::encCmd(\"opener._EditorFrame.setEditorIsHot(true);opener.document.we_form.elements['\" . $RollOverFlagName . \"'].value=1;opener.document.we_form.elements['\" . $checkFlagName . \"'].checked=true;\") . \"','',0,'\" . we_base_ContentTypes::IMAGE . \"',\" . (permissionhandler::hasPerm(\"CAN_SELECT_OTHER_USERS_FILES\") ? 0 : 1) . \");\");\n\n\n\t\t$cmd1 = \"document.we_form.elements['\" . $extname . \"'].value\";\n\t\t$butExt = permissionhandler::hasPerm('CAN_SELECT_EXTERNAL_FILES') ?\n\t\t\twe_html_button::create_button(we_html_button::SELECT, \"javascript:we_cmd('browse_server','\" . we_base_request::encCmd($cmd1) . \"','',\" . $cmd1 . \",'\" . we_base_request::encCmd(\"opener._EditorFrame.setEditorIsHot(true);opener.document.we_form.elements['we_\" . $this->Name . \"_txt[LinkType]'][1].checked=true;\") . \"')\") : \"\";\n\n\t\tif(defined('OBJECT_TABLE')){\n\t\t\t$objidname = 'we_' . $this->Name . '_txt[ObjID]';\n\t\t\t$objtextname = 'we_' . $this->Name . '_txt[ObjPath]';\n\t\t\t$objPath = f('SELECT Path FROM ' . OBJECT_FILES_TABLE . ' WHERE ID = ' . intval($this->getElement('ObjID')), '', $this->DB_WE);\n\t\t\t$cmd1 = \"document.we_form.elements['\" . $objidname . \"'].value\";\n\t\t\t$butObj = we_html_button::create_button(we_html_button::SELECT, \"javascript:we_cmd('we_selector_document',\" . $cmd1 . \",'\" . OBJECT_FILES_TABLE . \"','\" . we_base_request::encCmd($cmd1) . \"','\" . we_base_request::encCmd(\"document.we_form.elements['\" . $objtextname . \"'].value\") . \"','\" . we_base_request::encCmd(\"opener._EditorFrame.setEditorIsHot(true);opener.document.we_form.elements['we_\" . $this->Name . \"_txt[LinkType]'][3].checked=true;\") . \"','','','objectFile',\" . (permissionhandler::hasPerm(\"CAN_SELECT_OTHER_USERS_OBJECTS\") ? 0 : 1) . \");\");\n\t\t}\n\n\t\t// Create table\n\t\t$_content = new we_html_table(array('class' => 'default'), (defined('OBJECT_TABLE') ? 11 : 9), 2);\n\t\t$row = 0;\n\t\t// No link\n\t\t$_content->setCol($row, 0, array('style' => 'vertical-align:top;padding-bottom:10px;'), we_html_forms::radiobutton('no', ($linkType === 'no'), 'we_' . $this->Name . '_txt[LinkType]', g_l('weClass', '[nolink]'), true, 'defaultfont', '_EditorFrame.setEditorIsHot(true);'));\n\t\t$_content->setCol($row++, 1, null, '');\n\n\t\t// External link\n\t\t$_ext_link_table = new we_html_table(array('class' => 'default'), 1, 2);\n\n\t\t$_ext_link_table->setCol(0, 0, null, $this->htmlTextInput('we_' . $this->Name . '_txt[LinkHref]', 25, $this->getElement('LinkHref'), '', 'onchange=\"_EditorFrame.setEditorIsHot(true);\"', \"text\", 280));\n\t\t$_ext_link_table->setCol(0, 1, null, $butExt);\n\n\t\t$_ext_link = \"href\" . we_html_element::htmlBr() . $_ext_link_table->getHtml();\n\n\t\t$_content->setCol($row, 0, array('style' => 'vertical-align:top;padding-bottom:10px;'), we_html_forms::radiobutton(we_base_link::TYPE_EXT, ($linkType == we_base_link::TYPE_EXT), 'we_' . $this->Name . '_txt[LinkType]', g_l('weClass', '[extern]'), true, 'defaultfont', '_EditorFrame.setEditorIsHot(true)'));\n\t\t$_content->setCol($row++, 1, array('class' => 'defaultfont', 'style' => 'vertical-align:top'), $_ext_link);\n\n\n\t\t// Internal link\n\t\t$yuiSuggest->setAcId('internalPath');\n\t\t$yuiSuggest->setContentType(implode(',', array(we_base_ContentTypes::FOLDER, we_base_ContentTypes::WEDOCUMENT, we_base_ContentTypes::IMAGE, we_base_ContentTypes::JS, we_base_ContentTypes::CSS, we_base_ContentTypes::HTML, we_base_ContentTypes::APPLICATION, we_base_ContentTypes::QUICKTIME)));\n\t\t$yuiSuggest->setInput($textname, $linkPath);\n\t\t$yuiSuggest->setResult($idname, $this->getElement('LinkID'));\n\t\t$yuiSuggest->setTable(FILE_TABLE);\n\t\t$yuiSuggest->setSelectButton($but1);\n\t\t$yuiSuggest->setMaxResults(10);\n\t\t$yuiSuggest->setMayBeEmpty(0);\n\t\t$yuiSuggest->setWidth(280);\n\t\t$yuiSuggest->setSelector(weSuggest::DocSelector);\n\t\t$yuiSuggest->setLabel('href');\n\t\t$_int_link = $yuiSuggest->getHTML();\n\n\t\t$_content->setCol($row, 0, array('style' => 'vertical-align:top'), we_html_forms::radiobutton(we_base_link::TYPE_INT, ($linkType == we_base_link::TYPE_INT), 'we_' . $this->Name . '_txt[LinkType]', g_l('weClass', '[intern]'), true, 'defaultfont', '_EditorFrame.setEditorIsHot(true);'));\n\t\t$_content->setCol($row++, 1, array('class' => 'defaultfont', 'style' => 'vertical-align:top'), $_int_link);\n\n\t\t// Object link\n\t\tif(defined('OBJECT_TABLE')){\n\n\t\t\t$yuiSuggest->setAcId('objPathLink');\n\t\t\t$yuiSuggest->setContentType(\"folder,\" . we_base_ContentTypes::OBJECT_FILE);\n\t\t\t$yuiSuggest->setInput($objtextname, $objPath);\n\t\t\t$yuiSuggest->setResult($objidname, $this->getElement('ObjID'));\n\t\t\t$yuiSuggest->setTable(OBJECT_FILES_TABLE);\n\t\t\t$yuiSuggest->setSelectButton($butObj);\n\t\t\t$yuiSuggest->setMaxResults(10);\n\t\t\t$yuiSuggest->setMayBeEmpty(0);\n\t\t\t$yuiSuggest->setWidth(280);\n\t\t\t$yuiSuggest->setSelector(weSuggest::DocSelector);\n\t\t\t$yuiSuggest->setLabel('href');\n\t\t\t$_obj_link = $yuiSuggest->getHTML();\n\n\n\t\t\t$_content->setCol($row, 0, array('style' => 'vertical-align:top;padding-top:10px;'), we_html_forms::radiobutton(we_base_link::TYPE_OBJ, ($linkType == we_base_link::TYPE_OBJ), 'we_' . $this->Name . '_txt[LinkType]', g_l('linklistEdit', '[objectFile]'), true, 'defaultfont', '_EditorFrame.setEditorIsHot(true);'));\n\t\t\t$_content->setCol($row++, 1, array('class' => 'defaultfont', 'style' => 'vertical-align:top'), $_obj_link);\n\t\t}\n\n\t\t// Target\n\t\t$_content->setCol($row++, 0, array('colspan' => 2, 'class' => 'defaultfont', 'style' => 'vertical-align:top;padding:20px 0px;'), g_l('weClass', '[target]') . we_html_element::htmlBr() . we_html_tools::targetBox('we_' . $this->Name . '_txt[LinkTarget]', 33, 0, '', $this->getElement('LinkTarget'), '_EditorFrame.setEditorIsHot(true);', 20, 97));\n\n\n\t\t// Rollover image\n\t\t$yuiSuggest->setAcId('rollOverPath');\n\t\t$yuiSuggest->setContentType(implode(',', array(we_base_ContentTypes::FOLDER, we_base_ContentTypes::WEDOCUMENT, we_base_ContentTypes::IMAGE, we_base_ContentTypes::JS, we_base_ContentTypes::CSS, we_base_ContentTypes::HTML, we_base_ContentTypes::APPLICATION, we_base_ContentTypes::QUICKTIME)));\n\t\t$yuiSuggest->setInput($RollOverPathname, $RollOverPath);\n\t\t$yuiSuggest->setResult($RollOverIDName, $RollOverID);\n\t\t$yuiSuggest->setTable(FILE_TABLE);\n\t\t$yuiSuggest->setSelectButton($but2);\n\t\t$yuiSuggest->setMaxResults(10);\n\t\t$yuiSuggest->setMayBeEmpty(0);\n\t\t$yuiSuggest->setWidth(280);\n\t\t$yuiSuggest->setSelector(weSuggest::DocSelector);\n\t\t$yuiSuggest->setLabel('href');\n\t\t$_rollover = $yuiSuggest->getHTML();\n\n\t\t$_content->setCol($row, 0, array('style' => 'vertical-align:top'), we_html_forms::checkbox(1, $RollOverFlag, $checkFlagName, 'Roll Over', false, 'defaultfont', \"_EditorFrame.setEditorIsHot(true); this.form.elements['\" . $RollOverFlagName . \"'].value = (this.checked ? 1 : 0); \") . we_html_element::htmlHidden($RollOverFlagName, $RollOverFlag));\n\t\t$_content->setCol($row, 1, array('class' => 'defaultfont', 'style' => 'vertical-align:top'), $_rollover);\n\n\t\treturn $_content->getHtml();\n\t}", "function store()\n {\n $this->dbInit();\n // Sets the created to the system clock\n $this->Created = date( \"Y-m-d G:i:s\" ); \n $this->Database->query( \"INSERT INTO eZLink_Link SET\n ID='$this->ID',\n Title='$this->Title',\n Description='$this->Description',\n LinkGroup='$this->LinkGroupID',\n KeyWords='$this->KeyWords',\n Created='$this->Created',\n Url='$this->Url',\n ImageID='$this->ImageID',\n Accepted='$this->Accepted'\" );\n }", "public function created(Link $link)\n {\n $link->slug = Generate::slug($link->id);\n $link->name = $link->name ?? $link->slug;\n $link->domain = $link->domain ?? env('DEFAULT_SHORT_DOMAIN', 'ur.bn');\n $link->link_type_id = $link->link_type_id ?? 10;\n $link->save();\n }", "public\n function actionSave()\n {\n $model = new Message();\n if ($model->load(Yii::$app->request->post())) {\n // получаем изображение для последующего сохранения\n $file = UploadedFile::getInstance($model, 'link');\n if ($file && $file->tempName) {\n $fileName = self::_saveFile($model, $file);\n if ($fileName) {\n $model->link = $fileName;\n }\n }\n if ($model->save(false)) {\n return $this->redirect('index');\n }\n }\n return $this->redirect('index');\n }", "public function update()\n {\n $validatedDate = $this->validate([\n 'title' => 'required',\n 'original_url' => 'required',\n 'platform_id' => 'required'\n ]);\n \n $link = Url::find($this->link_id);\n $link->update([\n 'title' => $this->title,\n 'shorten_url' => $this->shorten_url,\n ]);\n \n $this->updateMode = false;\n \n session()->flash('message', 'Shorten URL Updated Successfully.');\n $this->resetInputFields();\n }", "public function save_links($data){\n\t\t$this->db->insert('links', $data);\n\t\treturn $insert_id = $this->db->insert_id();\n\t}", "public function store(StoreLink $request)\n {\n $user = Auth::user();\n\n $link = new Link();\n $link->fill($request->all());\n $link->user_id = $user->id;\n $link->code = $this->generateCode();\n $link->save();\n\n return redirect()->route('home');\n }", "function kp_save_portfolio_link_data( $post_id )\n{\n if ( !isset( $_POST[ 'kp_portfolio_link_meta_box_nonce' ] ) ) {\n return;\n }\n // Check is meta box is generated by WP\n if ( !wp_verify_nonce( $_POST[ 'kp_portfolio_link_meta_box_nonce' ], 'kp_save_portfolio_link_data' ) ) {\n return;\n }\n // Disable auto saving by WP\n if ( defined( 'DOING_AUTO_SAVE' ) && DOING_AUTOSAVE ) {\n return;\n }\n // User permissions\n if ( !current_user_can( 'edit_post', $post_id ) ) {\n return;\n }\n // Check if field is set and have value\n if ( !isset( $_POST[ 'kp_portfolio_link_field' ] ) ) {\n return;\n }\n\n $data = sanitize_text_field( $_POST[ 'kp_portfolio_link_field' ] );\n\n update_post_meta( $post_id, '_link', $data );\n}", "function linkblog_save_post( $post_id ) {\n\tif ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) \n\t\treturn;\n\n\t// verify data came from the linkblog meta box\n\tif ( !wp_verify_nonce( $_POST['linkblog_noncename'], plugin_basename( __FILE__ ) ) )\n\t\treturn; \n\n\t// Check user permissions\n\tif ( 'post' == $_POST['post_type'] ) {\n\t\tif ( !current_user_can( 'edit_page', $post_id ) )\n\t\t\treturn;\n\t} else {\n\t\tif ( !current_user_can( 'edit_post', $post_id ) )\n\t\t\treturn;\n\t}\n\n\t$linkblog_data = $_POST['linkblog_url'];\n\n\tif ($linkblog_data == \"\") {\n\t\treturn;\n\t} else {\n\t\tupdate_post_meta($post_id, 'linkblog_url', $linkblog_data);\n\t}\n\n}", "function setLink($link) {\r\n $this->_link = $link;\r\n }", "function setLink($link) {\r\n $this->_link = $link;\r\n }", "function save(){\n\t\tglobal $sql;\n\t\tsettype($newsid,'int');\n\t\tsettype($linkid,'int');\n\t\tsettype($productid,'int');\t\t\n\t\tif($this->type=='news'){\n\t\t\t$sql = 'INSERT INTO `'.DB_TABLE_PREFIX.'newslink`(`newsid`,`linkid`,`ctrl`) VALUES('.$this->newsid.','.$this->linkid.','.$this->ctrl.')';\t\t\t\n\t\t}else{\n\t\t\t$sql = 'INSERT INTO `'.DB_TABLE_PREFIX.'productnewslink`(`productid`,`newsid`,`ctrl`,`from`) VALUES('.$this->productid.','.$this->newsid.','.$this->ctrl.','.$this->from.')';\n\t\t}\t\t\n\t\t_trace($sql);\t\t\t\n\t\tmysql_query($sql);\n\t}", "function save()\n\t{\n\t\t$this->store() ;\n\t\t$link = 'index.php?option=com_arts_curriculum';\n\t\t$this->setRedirect( $link, $this->msg);\n\t}", "public function save()\n {\n $error = false;\n\n // Save the not language specific part\n $pre_save_object = new self($this->reference_id, $this->clang_id);\n\n if (0 === $this->reference_id || $pre_save_object !== $this) {\n $query = rex::getTablePrefix() .'d2u_references_references SET '\n .\"online_status = '\". $this->online_status .\"', \"\n .\"pictures = '\". implode(',', $this->pictures) .\"', \"\n .\"background_color = '\". $this->background_color .\"', \"\n .'video_id = '. (false !== $this->video ? $this->video->video_id : 0) .', '\n .\"url = '\". $this->external_url .\"', \"\n .\"`date` = '\". $this->date .\"' \";\n\n if (0 === $this->reference_id) {\n $query = 'INSERT INTO '. $query;\n } else {\n $query = 'UPDATE '. $query .' WHERE reference_id = '. $this->reference_id;\n }\n\n $result = rex_sql::factory();\n $result->setQuery($query);\n if (0 === $this->reference_id) {\n $this->reference_id = (int) $result->getLastId();\n $error = $result->hasError();\n }\n\n // Save tag links\n $query_del_tags = 'DELETE FROM '. rex::getTablePrefix() .'d2u_references_tag2refs WHERE reference_id = '. $this->reference_id;\n $result_del_tags = rex_sql::factory();\n $result_del_tags->setQuery($query_del_tags);\n\n foreach ($this->tag_ids as $tag_id) {\n $query_add_tags = 'INSERT INTO '. rex::getTablePrefix() .'d2u_references_tag2refs SET reference_id = '. $this->reference_id .', tag_id = '. $tag_id;\n $result_add_tags = rex_sql::factory();\n $result_add_tags->setQuery($query_add_tags);\n }\n }\n\n $regenerate_urls = false;\n if (!$error) {\n // Save the language specific part\n $pre_save_object = new self($this->reference_id, $this->clang_id);\n if ($pre_save_object !== $this) {\n $query = 'REPLACE INTO '. rex::getTablePrefix() .'d2u_references_references_lang SET '\n .\"reference_id = '\". $this->reference_id .\"', \"\n .\"clang_id = '\". $this->clang_id .\"', \"\n .\"name = '\". addslashes($this->name) .\"', \"\n .\"teaser = '\". addslashes(htmlspecialchars($this->teaser)) .\"', \"\n .\"description = '\". addslashes(htmlspecialchars($this->description)) .\"', \"\n .\"url_lang = '\". $this->external_url_lang .\"', \"\n .\"translation_needs_update = '\". $this->translation_needs_update .\"', \"\n .'updatedate = CURRENT_TIMESTAMP ';\n\n $result = rex_sql::factory();\n $result->setQuery($query);\n $error = $result->hasError();\n\n if (!$error && $pre_save_object->name !== $this->name) {\n $regenerate_urls = true;\n }\n }\n }\n\n // Update URLs\n if ($regenerate_urls) {\n \\d2u_addon_backend_helper::generateUrlCache('reference_id');\n }\n\n return $error;\n }", "public function store(Request $request)\n {\n $this->validate($request, [\n 'expanded_link' => 'required|url|unique:links,expanded_link',\n 'go_link' => 'required|unique:links,go_link',\n ]);\n\n $link = new Link();\n\n $link->expanded_link = $request->input('expanded_link');\n $link->go_link = $request->input('go_link');\n $link->member_id = $request->member->id;\n\n $link->save();\n\n return response()->json($link);\n }", "public function store(LinkRequest $request)\n {\n if(no_permission('createLink')){\n return view(config('program.no_permission_to_view'));\n }\n $link = new Link();\n $link->name = $request->name;\n $link->title = $request->title;\n $link->url = $request->url;\n $link->orders = $request->orders;\n $link->status = $request->status;\n if($link->save()){\n $message = [\n 'code' => 1,\n 'message' => '推荐网址添加成功'\n ];\n }else{\n $message = [\n 'code' => 1,\n 'message' => '推荐网址添加失败,请稍后重试'\n ];\n }\n return response()->json($message);\n }", "public function store(LinkInsertRequest $request)\n {\n // //自动验证\n // $this->validate($request,[\n // 'links_name'=>'required|regex:/[\\W\\w]{2,6}/|unique:links',\n // 'links_url'=>'required|active_url'//active_url验证路径是否有效\n // ],[\n // 'links_name.required' => '站点名称必填',\n // 'links_name.unique' => '站点名称已存在',\n // 'links_name.regex' => '站点名称不正确',\n // 'links_url.required' => 'URL地址必填',\n // 'links_url.active_url' => 'URL地址无效',\n // ]);\n //接受数据 处理数据\n $link = new Link;\n $link -> links_name = $request -> input('links_name','');\n $link -> links_url = $request -> input('links_url','');\n $link -> links_status = $request -> input('links_status','');\n $res = $link -> save();\n //判断是否添加成功\n if($res){\n //成功\n return redirect('/admin/links')->with('success','添加成功');\n }else{\n return back()->with('error','添加失败');\n }\n }", "public function setLink($link){\n\t\t$this->link = $link;\n\t}", "public function save() {\n $db = Db::instance();\n $db_properties = array(\n 'action' => $this->action,\n 'url_mod' => $this->url_mod,\n 'description' => $this->description,\n 'target_id' => $this->target_id,\n 'target_name' => $this->target_name,\n 'creator_id' => $this->creator_id,\n 'creator_username' => $this->creator_username\n );\n $db->store($this, __CLASS__, self::DB_TABLE, $db_properties);\n }", "function add()\n\t{\n\t\t// Initialize variables.\n\t\t$app = & JFactory::getApplication();\n\n\t\t// Clear the link id from the session.\n\t\t$app->setUserState('redirect.edit.link.id', null);\n\n\t\t// Redirect to the edit screen.\n\t\t$this->setRedirect(JRoute::_('index.php?option=com_redirect&view=link&layout=edit&hidemainmenu=1', false));\n\t}", "public function linkArticleAndSave($idArticleToLink = null)\n {\n Dao_Articles::update()->where('id', '=', $this->id)\n ->set('linked_article', $idArticleToLink)\n ->clearcache($this->id)\n ->execute();\n\n $this->linked_article = $idArticleToLink;\n }", "public function store(Request $request)\n {\n $this->validate($request,[\n 'url'=>'required'\n ]);\n\n $material = Material::findOrFail($request->get(\"resource\"));\n $link = new Link($request->only('url'));\n $link->material()->associate($material);\n $link->save();\n return redirect()->route('link')->with('message','Record Created !!!!');\n }", "public function save()\n {\n //call parent implementation\n goService::save();\n\n //get ldap link\n $ldap= $this->config->get_ldap_link();\n\n /* Save data to LDAP */\n $ldap->cd($this->dn);\n $this->cleanup();\n $ldap->modify($this->attrs);\n\n if(!$ldap->success())\n msg_dialog::display(_(\"LDAP error\"), msgPool::ldaperror($ldap->get_error(), $this->dn, LDAP_MOD, get_class()));\n }", "public function store(Request $request)\n {\n \t$this->validate($request, [\n 'link' => 'required|unique:short_links,link|url',\n ],[\n 'link.url'=>'Please Enter Proper URL Like http://www.example.com OR https://www.example.com'\n\n ]);\n\n \n $input['link'] = $request->link;\n $input['code'] = Str::random(5);\n\n\n \n ShortLink::create($input);\n \n return redirect('/')\n ->with('success', 'Shorten Link Generated Successfully!');\n }", "function cd_meta_box_garoe_url_video_save( $post_id )\n{\n if( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) return;\n \n // if our nonce isn't there, or we can't verify it, bail\n if( !isset( $_POST['meta_box_nonce'] ) || !wp_verify_nonce( $_POST['meta_box_nonce'], 'my_meta_box_nonce' ) ) return;\n \n // if our current user can't edit this post, bail\n if( !current_user_can( 'edit_post' ) ) return;\n \n // now we can actually save the data\n $allowed = array( \n 'a' => array( // on allow a tags\n 'href' => array() // and those anchors can only have href attribute\n )\n );\n \n // Make sure your data is set before trying to save it\n if( isset( $_POST['mb_garoe_url_video_text'] ) )\n update_post_meta( $post_id, 'mb_garoe_url_video_text', wp_kses( $_POST['mb_garoe_url_video_text'], $allowed ) );\n}", "function UstawLinkRezygnacji($Link) {\n\t\t$this->LinkRezygnacji = $Link;\n\t}", "function Links_Add(){\n\t\t\n\t\t\n\t\tif(isset($_POST['linkadd'])){\n\t\t\t\n\t\t\n\t\t\n\t\t$values = \"'\".$_POST['fb'].\"','\".$_POST['tw'].\"','\".$_POST['lk'].\"','\".$_POST['insta'].\"','\".$_POST['com'].\"','\".$_POST['doctor'].\"'\";\n\t\t\t\n\t\t\t$this->Add('links',$values,'Social-Links?List&m');\n\t\t\t\n\t\t\t\n\t\t}\n\t}", "protected function linkAdd() { return \"\"; }", "function Link_box_post_save($post_id){\n //CONTROLE ALS DE AANVRAAG KOMT VAN DIT SCHERM - SAVE POST KAN VAN EEN ANDERE PAGINA KOMEN\n if ( !wp_verify_nonce( $_POST['post_link_box_content_nonce'], plugin_basename(__FILE__) )) {\n return $post_id;\n }\n // Verify if this is an auto save routine. If it is our form has not been submitted, so we dont want\n // to do anything\n if ( defined('DOING_AUTOSAVE') && DOING_AUTOSAVE ) \n return $post_id;\n // Check permissions to edit pages and/or post\n if ( 'page' == $_POST['post_type'] || 'post' == $_POST['post_type']) {\n if ( !current_user_can( 'edit_page', $post_id ) || !current_user_can( 'edit_post', $post_id ))\n return $post_id;\n } \n // OK, we're authenticated: we need to find and save the data\n //HAAL DATA UIT HET FORMULIER\n $afk = $_POST['Link'];\n // save data in INVISIBLE custom field (note the \"_\" prefixing the custom fields' name\n update_post_meta($post_id, 'Link', $afk); \n }", "private function updateUrl(){\n $this->url->status_code = $this->response['status_code'];\n $this->url->reason_phrase = $this->response['reason_phrase'];\n $this->url->location = $this->response['location'];\n $this->url->content_type = $this->response['content_type'];\n $this->url->content_length = $this->response['content_length'];\n $this->url->save();\n }", "private function saveLink($gid, $response) \n\t{\n\t\t$db = Db::getLink();\n\t\t$stmt = $db->prepare(\n\t\t\"INSERT INTO `notes` (`gid`, `url`) VALUES (?, ?);\"\n\t\t);\n\t\t$stmt->bind_param('is', $gid, $response['body']['url']);\n\t\t$success = $stmt->execute();\n\t\t$stmt->fetch();\n\t\t$stmt->close();\n\t\t$success = $this->saveNotification($gid, $response);\n\t\treturn $success;\n\t}", "function AddLink($long_url)\n\t{\n\t\t$data['redirect_link'] = $long_url;\n\t\t$this->db->insert('links', $data);\t\t\n\t\treturn dechex(mysql_insert_id());\n\t}", "public function store(LinkStore $request)\n {\n Link::create($request->only('name', 'url'));\n\n return back()->withNotify('Bağlantı Oluşturuldu!');\n }", "function formLink() {\n\t\tglobal $l_we_class;\n\n\t\t$we_button = new we_button();\n\n\t\t$textname = 'we_' . $this->Name . '_txt[LinkPath]';\n\t\t$idname = 'we_' . $this->Name . '_txt[LinkID]';\n\t\t$extname = 'we_' . $this->Name . '_txt[LinkHref]';\n\t\t$linkType = $this->getElement(\"LinkType\") ? $this->getElement(\"LinkType\") : \"no\";\n\t\t$linkPath = f(\"SELECT Path FROM \" . FILE_TABLE . \" WHERE ID = '\" . $this->getElement(\"LinkID\") . \"'\", \"Path\", $this->DB_WE);\n\n\t\t$RollOverFlagName = \"we_\" . $this->Name . \"_txt[RollOverFlag]\";\n\t\t$RollOverFlag = $this->getElement(\"RollOverFlag\") ? 1 : 0;\n\t\t$RollOverIDName = 'we_' . $this->Name . '_txt[RollOverID]';\n\t\t$RollOverID= $this->getElement(\"RollOverID\") ? $this->getElement(\"RollOverID\") : \"\";\n\t\t$RollOverPathname = 'we_' . $this->Name . '_txt[RollOverPath]';\n\t\t$RollOverPath = f(\"SELECT Path FROM \" . FILE_TABLE . \" WHERE ID = '$RollOverID='\", \"Path\", $this->DB_WE);\n\n\t\t$checkFlagName = \"check_\" . $this->Name . \"_RollOverFlag\";\n\n\t\t$but1 = $we_button->create_button(\"select\", \"javascript:we_cmd('openDocselector', document.forms['we_form'].elements['$idname'].value,'\" . FILE_TABLE . \"','document.forms[\\'we_form\\'].elements[\\'$idname\\'].value','document.forms[\\'we_form\\'].elements[\\'$textname\\'].value','opener._EditorFrame.setEditorIsHot(true);opener.document.we_form.elements[\\\\'we_\".$this->Name.\"_txt[LinkType]\\\\'][2].checked=true;','',0,'',\".(we_hasPerm(\"CAN_SELECT_OTHER_USERS_FILES\") ? 0 : 1).\");\");\n\t\t$but2 = $we_button->create_button(\"select\", \"javascript:we_cmd('openDocselector', document.forms['we_form'].elements['$RollOverIDName'].value,'\" . FILE_TABLE . \"','document.forms[\\'we_form\\'].elements[\\'$RollOverIDName\\'].value','document.forms[\\'we_form\\'].elements[\\'$RollOverPathname\\'].value','opener._EditorFrame.setEditorIsHot(true);opener.document.we_form.elements[\\'$RollOverFlagName\\'].value=1;opener.document.we_form.elements[\\'$checkFlagName\\'].checked=true;','',0,'image/*',\".(we_hasPerm(\"CAN_SELECT_OTHER_USERS_FILES\") ? 0 : 1).\");\");\n\n\t\t$butExt = we_hasPerm(\"CAN_SELECT_EXTERNAL_FILES\") ?\n\t\t\t\t\t$we_button->create_button(\"select\", \"javascript:we_cmd('browse_server','document.forms[\\'we_form\\'].elements[\\'$extname\\'].value','',document.forms['we_form'].elements['$extname'].value,'opener._EditorFrame.setEditorIsHot(true);opener.document.we_form.elements[\\\\'we_\".$this->Name.\"_txt[LinkType]\\\\'][1].checked=true;')\")\n\t\t\t\t\t:\t\"\";\n\n\t\tif(defined(\"OBJECT_TABLE\")) {\n\t\t\t$objidname = 'we_' . $this->Name . '_txt[ObjID]';\n\t\t\t$objtextname = 'we_' . $this->Name . '_txt[ObjPath]';\n\t\t\t$objPath = f(\"SELECT Path FROM \" . OBJECT_FILES_TABLE . \" WHERE ID = '\".abs($this->getElement(\"ObjID\")).\"'\", \"Path\", $this->DB_WE);\n\t\t\t$butObj = $we_button->create_button(\"select\", \"javascript:we_cmd('openDocselector',document.forms['we_form'].elements['$objidname'].value,'\" . OBJECT_FILES_TABLE . \"','document.forms[\\'we_form\\'].elements[\\'$objidname\\'].value','document.forms[\\'we_form\\'].elements[\\'$objtextname\\'].value','opener._EditorFrame.setEditorIsHot(true);opener.document.we_form.elements[\\\\'we_\".$this->Name.\"_txt[LinkType]\\\\'][3].checked=true;','','','objectFile',\".(we_hasPerm(\"CAN_SELECT_OTHER_USERS_OBJECTS\") ? 0 : 1).\");\");\n\t\t}\n\n\t\t// Create table\n\t\t$_content = new we_htmlTable(array(\"border\" => 0, \"cellpadding\" => 0, \"cellspacing\" => 0), (defined(\"OBJECT_TABLE\") ? 11 : 9), 2);\n\n\t\t// No link\n\t\t$_content->setCol(0, 0, array(\"valign\" => \"top\"), we_forms::radiobutton(\"no\", ($linkType == \"no\"), \"we_\" . $this->Name . \"_txt[LinkType]\", $l_we_class[\"nolink\"], true, \"defaultfont\", \"_EditorFrame.setEditorIsHot(true);\"));\n\t\t$_content->setCol(0, 1, null, \"\");\n\n\t\t// Space\n\t\t$_content->setCol(1, 0, null, getPixel(100, 10));\n\t\t$_content->setCol(1, 1, null, getPixel(400, 10));\n\n\t\t// External link\n\t\t$_ext_link_table = new we_htmlTable(array(\"border\" => 0, \"cellpadding\" => 0, \"cellspacing\" => 0), 1, 3);\n\n\t\t$_ext_link_table->setCol(0, 0, null, $this->htmlTextInput(\"we_\" . $this->Name . \"_txt[LinkHref]\", 25, $this->getElement(\"LinkHref\"), \"\", 'onchange=\"_EditorFrame.setEditorIsHot(true);\"', \"text\", 280));\n\t\t$_ext_link_table->setCol(0, 1, null, getPixel(20, 1));\n\t\t$_ext_link_table->setCol(0, 2, null, $butExt);\n\n\t\t$_ext_link = \"href\" . we_htmlElement::htmlBr() . $_ext_link_table->getHtmlCode();\n\n\t\t$_content->setCol(2, 0, array(\"valign\" => \"top\"), we_forms::radiobutton(\"ext\", ($linkType == \"ext\"), \"we_\" . $this->Name . \"_txt[LinkType]\", $l_we_class[\"extern\"], true, \"defaultfont\", \"_EditorFrame.setEditorIsHot(true)\"));\n\t\t$_content->setCol(2, 1, array(\"class\" => \"defaultfont\", \"valign\" => \"top\"), $_ext_link);\n\n\t\t// Space\n\t\t$_content->setCol(3, 0, null, getPixel(100, 10));\n\t\t$_content->setCol(3, 1, null, getPixel(400, 10));\n\n\t\t// Internal link\n\t\t$_int_link_table = new we_htmlTable(array(\"border\" => 0, \"cellpadding\" => 0, \"cellspacing\" => 0), 1, 3);\n\n\t\t$_int_link_table->setCol(0, 0, null, $this->htmlTextInput($textname, 25, $linkPath, \"\", 'onkeydown=\"return false\"', \"text\", 280));\n\t\t$_int_link_table->setCol(0, 1, null, getPixel(20, 1));\n\t\t$_int_link_table->setCol(0, 2, null, $this->htmlHidden($idname, $this->getElement(\"LinkID\")) . $but1);\n\n\t\t$_int_link = \"href\" . we_htmlElement::htmlBr() . $_int_link_table->getHtmlCode();\n\n\t\t$_content->setCol(4, 0, array(\"valign\" => \"top\"), we_forms::radiobutton(\"int\", ($linkType == \"int\"), \"we_\" . $this->Name . \"_txt[LinkType]\", $l_we_class[\"intern\"], true, \"defaultfont\", \"_EditorFrame.setEditorIsHot(true);\"));\n\t\t$_content->setCol(4, 1, array(\"class\" => \"defaultfont\", \"valign\" => \"top\"), $_int_link);\n\n\t\t// Object link\n\t\tif (defined(\"OBJECT_TABLE\")) {\n\t\t\t$_content->setCol(5, 0, null, getPixel(100, 10));\n\t\t\t$_content->setCol(5, 1, null, getPixel(400, 10));\n\n\t\t\t$_obj_link_table = new we_htmlTable(array(\"border\" => 0, \"cellpadding\" => 0, \"cellspacing\" => 0), 1, 3);\n\n\t\t\t$_obj_link_table->setCol(0, 0, null, $this->htmlTextInput($objtextname, 25, $objPath, \"\", 'onkeydown=\"return false\"', \"text\", 280));\n\t\t\t$_obj_link_table->setCol(0, 1, null, getPixel(20, 1));\n\t\t\t$_obj_link_table->setCol(0, 2, null, $this->htmlHidden($objidname, $this->getElement(\"ObjID\")) . $butObj);\n\n\t\t\t$_obj_link = \"href\" . we_htmlElement::htmlBr() . $_obj_link_table->getHtmlCode();\n\n\t\t\t$_content->setCol(6, 0, array(\"valign\" => \"top\"), we_forms::radiobutton(\"obj\", ($linkType == \"obj\"), \"we_\" . $this->Name . \"_txt[LinkType]\", $GLOBALS[\"l_linklist_edit\"][\"objectFile\"], true, \"defaultfont\", \"_EditorFrame.setEditorIsHot(true);\"));\n\t\t\t$_content->setCol(6, 1, array(\"class\" => \"defaultfont\", \"valign\" => \"top\"), $_obj_link);\n\t\t}\n\n\t\t// Space\n\t\t$_content->setCol((defined(\"OBJECT_TABLE\") ? 7 : 5), 0, null, getPixel(100, 20));\n\t\t$_content->setCol((defined(\"OBJECT_TABLE\") ? 7 : 5), 1, null, getPixel(400, 20));\n\n\t\t// Target\n\t\t$_content->setCol((defined(\"OBJECT_TABLE\") ? 8 : 6), 0, array(\"colspan\" => 2, \"class\" => \"defaultfont\", \"valign\" => \"top\"), $l_we_class[\"target\"] . we_htmlElement::htmlBr() . targetBox(\"we_\" . $this->Name . \"_txt[LinkTarget]\", 33, 380, \"\", $this->getElement(\"LinkTarget\"), \"_EditorFrame.setEditorIsHot(true);\", 20, 97));\n\n\t\t// Space\n\t\t$_content->setCol((defined(\"OBJECT_TABLE\") ? 9 : 7), 0, null, getPixel(100, 20));\n\t\t$_content->setCol((defined(\"OBJECT_TABLE\") ? 9 : 7), 1, null, getPixel(400, 20));\n\n\t\t// Rollover image\n\t\t$_rollover_table = new we_htmlTable(array(\"border\" => 0, \"cellpadding\" => 0, \"cellspacing\" => 0), 1, 3);\n\n\t\t$_rollover_table->setCol(0, 0, null, $this->htmlTextInput($RollOverPathname, 25, $RollOverPath, \"\", 'onkeydown=\"return false\"', \"text\", 280));\n\t\t$_rollover_table->setCol(0, 1, null, getPixel(20, 1));\n\t\t$_rollover_table->setCol(0, 2, null, $this->htmlHidden($RollOverIDName, $RollOverID) . $but2);\n\n\t\t$_rollover = \"href\" . we_htmlElement::htmlBr() . $_rollover_table->getHtmlCode();\n\n\t\t$_content->setCol((defined(\"OBJECT_TABLE\") ? 10 : 8), 0, array(\"valign\" => \"top\"), we_forms::checkbox(1, $RollOverFlag, $checkFlagName, \"Roll Over\", false, \"defaultfont\", \"_EditorFrame.setEditorIsHot(true); this.form.elements['$RollOverFlagName'].value = (this.checked ? 1 : 0); \") . $this->htmlHidden($RollOverFlagName, $RollOverFlag));\n\t\t$_content->setCol((defined(\"OBJECT_TABLE\") ? 10 : 8), 1, array(\"class\" => \"defaultfont\", \"valign\" => \"top\"), $_rollover);\n\n\t\treturn $_content->getHtmlCode();\n\t}", "public function save_term_link( $term_id, $tt_id ){\n\t\t\tif( isset( $_POST['term_link'] ) && '' !== $_POST['term_link'] ){\n\t\t\t\t$link = $_POST['term_link'];\n\t\t\t\tadd_term_meta( $term_id, 'term_link', $link, true );\n\t\t\t}\n\t\t}", "function save() {\n //save the added fields\n }", "public function postLink(){\r\n if(!$this->hasLoginCheck())\r\n return;\r\n// $path,$desc,$tag\r\n $blogItem = new BlogItemModel();\r\n $path=$_POST['path'];\r\n $desc=$_POST['title'];\r\n $tag=$_POST['tag'];\r\n $blogItem->addLink($path,$desc,$tag);\r\n echo json_encode(array('status'=>'true'));\r\n }", "public function store(Request $request)\n {\n $request->validate([\n 'title' => 'required|max:255',\n ]);\n\n $link = new Link();\n $link->title = $request->input('title');\n\n $link->save();\n\n return redirect()->route('admin_links_edit', ['link' => $link->id]);\n }", "public function saveSocialLink(UpdateRequest $request)\n {\n $profile = auth()->user()->profile;\n $profile[$request->platform] = $request->link;\n try {\n $profile->save();\n\n return response()->json([\n 'link' => $request->link,\n ]);\n } catch (\\Exception $e) {\n abort(500, $e->getMessage());\n }\n }", "function kp_portfolio_link( $post )\n{\n wp_nonce_field( 'kp_save_portfolio_link_data', 'kp_portfolio_link_meta_box_nonce' );\n\n $value = get_post_meta( $post->ID, '_link', true );\n $hint = '<p class=\"howto\">Link to project website</p>';\n echo '<input name=\"kp_portfolio_link_field\" type=\"url\" value=\"' . esc_attr( $value ) . '\" style=\"width:100%\">' . $hint;\n}", "function setLink(&$link)\n {\n $this->_link = $link;\n }", "public function store(Request $request)\n {\n $this->validate($request, [\n 'url' => 'required',\n 'main_filter_selector' => 'required',\n 'website_id' => 'required',\n ]);\n\n $link = new Link();\n $link->url = $request->get('url');\n $link->main_filter_selector = $request->get('main_filter_selector');\n $link->website_id = $request->get('website_id');\n $link->save();\n return redirect()->route('links.index');\n }", "function save() {\n \n\t if ($this->id == NULL) {\n\t \t\n\t\t mysql_query(\"INSERT INTO `videothumbs` ( `videoid`, `url`) VALUES ( '\".$this->videoid.\"', '\".$this->url.\"');\") or die(\"Query failed with error: \".mysql_error());\n\t\t $this->id = mysql_insert_id();\n\t \n\t } else {\n\t\t\t\t\n\t\t mysql_query(\"UPDATE `videothumbs` SET `videoid` = '\".$this->videoid.\"', `url` = '\".$this->url.\"' WHERE `id` = \".$this->id.\";\") or die(\"Query failed with error: \".mysql_error());\n\t }\n\t \n }", "public function approveLink() \n {\n }", "function insertar_link(){\t\n\t\t$this->accion=\"Datos del Nuevo Enlace\";\n\t\tif (isset($_POST['envio']) && $_POST['envio']==\"Guardar\"){\n\t\t\t$this->asignar_valores();\n\t\t\t$sql=\"SELECT * FROM link WHERE nombre_cat='999999'\";\n\t\t\t$consulta=mysql_query($sql) or die(mysql_error());\n\t\t\tif($resultado=mysql_fetch_array($consulta)){\n\t\t\t\t$this->mensaje=1;\n\t\t\t}else{\n\t\t\t\t$sql=\"INSERT INTO link VALUES ('', '$this->tipo', '$this->nombre', '$this->etiqueta', '$this->claves', '$this->descripcion', '$this->prioridad','$this->icono')\";\n\t\t\t\t$consulta=mysql_query($sql) or die(mysql_error());\n\t\t\t\theader(\"location:/admin/link/\");\n\t\t\t\texit();\n\t\t\t}\n\t\t}\t\t\t\n\t}", "public function store(Request $request)\n { \n $request->validate([\n 'url' => 'required|unique:links,url,NULL,id,deleted_at,NULL',\n 'title' => ['required', 'max:255', new MinimalWords(2)],\n 'body' => ['required', new MinimalWords(5)],\n 'tags' => 'required',\n ]);\n\n $user = Auth::user(); \n \n $link = $user->links()->create([\n 'title' => $request->title,\n 'url' => cleanUrl($request->url),\n 'slug' => generateSlug($request->title, new Link),\n 'body' => $request->body,\n 'tags' => $request->tags,\n 'media' => $request->media,\n 'owner' => $request->owner,\n 'thumbnail' => $request->thumbnail,\n 'draft' => Auth::user()->isAdmin() ? false : true, //if admin auto publish\n 'original_published_at' => $request->original_published_at ?? Carbon::now(),\n ]); \n\n //change session token\n $request->session()->regenerateToken();\n return redirect('/link/' . $link->slug)->with('success', 'Link berhasil disubmit. Akan kami review');\n }", "public function store(Request $request) {\n if($request->evenement_id == null) {\n return view('admin.link.create', ['evenementen' => Evenement::pluck('naam', 'id'),\n 'error' => 'No evenement selected']);\n }\n $link = new Link;\n $link->naam = $request->naam;\n $link->evenement_id = $request->evenement_id;\n $link->link = $request->link;\n $link->save();\n return view('admin.link.create', ['evenementen' => Evenement::pluck('naam', 'id'),\n 'message' => 'Link added to the database']);\n }", "function LINK_save($lid, $old_lid, $cid, $categorydd, $url, $description, $title, $hits, $owner_id, $group_id, $perm_owner, $perm_group, $perm_members, $perm_anon, $type)\n{\n global $_CONF, $_GROUPS, $_TABLES, $_USER, $MESSAGE, $LANG_LINKS_ADMIN, $_LI_CONF;\n\n $retval = '';\n\n // Convert array values to numeric permission values\n if (is_array($perm_owner) OR is_array($perm_group) OR is_array($perm_members) OR is_array($perm_anon)) {\n list($perm_owner,$perm_group,$perm_members,$perm_anon) = SEC_getPermissionValues($perm_owner,$perm_group,$perm_members,$perm_anon);\n }\n\n // clean 'em up\n $description = DB_escapeString (COM_checkHTML (COM_checkWords (trim($description))));\n $title = DB_escapeString (COM_checkHTML (COM_checkWords (trim($title))));\n $cid = DB_escapeString (trim($cid));\n $url = DB_escapeString(trim($url));\n\n if (empty ($owner_id)) {\n // this is new link from admin, set default values\n $owner_id = $_USER['uid'];\n if (isset ($_GROUPS['Links Admin'])) {\n $group_id = $_GROUPS['Links Admin'];\n } else {\n $group_id = SEC_getFeatureGroup ('links.edit');\n }\n $perm_owner = 3;\n $perm_group = 2;\n $perm_members = 2;\n $perm_anon = 2;\n }\n\n $lid = COM_sanitizeID($lid);\n $old_lid = COM_sanitizeID($old_lid);\n if (empty($lid)) {\n if (empty($old_lid)) {\n $lid = COM_makeSid();\n } else {\n $lid = $old_lid;\n }\n }\n\n // check for link id change\n if (!empty($old_lid) && ($lid != $old_lid)) {\n // check if new lid is already in use\n if (DB_count($_TABLES['links'], 'lid', $lid) > 0) {\n // TBD: abort, display editor with all content intact again\n $lid = $old_lid; // for now ...\n }\n }\n\n $access = 0;\n $old_lid = DB_escapeString ($old_lid);\n if (DB_count ($_TABLES['links'], 'lid', $old_lid) > 0) {\n $result = DB_query (\"SELECT owner_id,group_id,perm_owner,perm_group,perm_members,perm_anon FROM {$_TABLES['links']} WHERE lid = '{$old_lid}'\");\n $A = DB_fetchArray ($result);\n $access = SEC_hasAccess ($A['owner_id'], $A['group_id'],\n $A['perm_owner'], $A['perm_group'], $A['perm_members'],\n $A['perm_anon']);\n } else {\n $access = SEC_hasAccess ($owner_id, $group_id, $perm_owner, $perm_group,\n $perm_members, $perm_anon);\n }\n if (($access < 3) || !SEC_inGroup ($group_id)) {\n $display .= COM_siteHeader ('menu', $MESSAGE[30]);\n $display .= COM_startBlock ($MESSAGE[30], '',\n COM_getBlockTemplate ('_msg_block', 'header'));\n $display .= $MESSAGE[31];\n $display .= COM_endBlock (COM_getBlockTemplate ('_msg_block', 'footer'));\n $display .= COM_siteFooter ();\n COM_accessLog(\"User {$_USER['username']} tried to illegally submit or edit link $lid.\");\n echo $display;\n exit;\n } elseif (!empty($title) && !empty($description) && !empty($url)) {\n\n if ($categorydd != $LANG_LINKS_ADMIN[7] && !empty($categorydd)) {\n $cid = DB_escapeString ($categorydd);\n } else if ($categorydd != $LANG_LINKS_ADMIN[7]) {\n echo COM_refresh($_CONF['site_admin_url'] . '/plugins/links/index.php');\n }\n\n DB_delete ($_TABLES['linksubmission'], 'lid', $old_lid);\n DB_delete ($_TABLES['links'], 'lid', $old_lid);\n\n DB_save ($_TABLES['links'], 'lid,cid,url,description,title,date,hits,owner_id,group_id,perm_owner,perm_group,perm_members,perm_anon', \"'$lid','$cid','$url','$description','$title','\".$_CONF['_now']->toMySQL(true).\"','$hits',$owner_id,$group_id,$perm_owner,$perm_group,$perm_members,$perm_anon\");\n\n if (empty($old_lid) || ($old_lid == $lid)) {\n PLG_itemSaved($lid, 'links');\n } else {\n PLG_itemSaved($lid, 'links', $old_lid);\n }\n\n // Get category for rdf check\n $category = DB_getItem ($_TABLES['linkcategories'],\"category\",\"cid='{$cid}'\");\n COM_rdfUpToDateCheck ('links', $category, $lid);\n $c = glFusion\\Cache::getInstance()->deleteItemsByTag('whatsnew');\n\n if ($type == 'submission') {\n return COM_refresh($_CONF['site_admin_url'] . '/moderation.php');\n } else {\n return PLG_afterSaveSwitch (\n $_LI_CONF['aftersave'],\n COM_buildURL (\"{$_CONF['site_url']}/links/portal.php?what=link&item=$lid\"),\n 'links',\n 2\n );\n }\n } else { // missing fields\n $retval .= COM_siteHeader('menu', $LANG_LINKS_ADMIN[1]);\n $retval .= COM_errorLog($LANG_LINKS_ADMIN[10],2);\n if (DB_count ($_TABLES['links'], 'lid', $old_lid) > 0) {\n $retval .= LINK_edit('edit', $old_lid);\n } else {\n $retval .= LINK_edit('edit', '');\n }\n $retval .= COM_siteFooter();\n\n return $retval;\n }\n}", "public function store(Request $request)\n {\n $request->validate([\n 'name'=>['required', 'string'],\n 'url'=>['required', 'url']\n ]);\n\n $user = Auth::user();\n\n $link = new Link([\n 'name'=> $request->input('name'),\n 'url'=>$request->input('url'),\n 'user_id'=>$user->id,\n ]);\n\n $link->save();\n\n return redirect()->route('links.index')->with('status', 'Link Added Correctly!');\n }", "public function store()\n {\n $this->user_id = Auth::user()->id;\n\n $validatedDate = $this->validate([\n 'title' => 'required',\n 'original_url' => 'required',\n 'platform_id' => 'required',\n 'user_id' => 'required'\n ]);\n \n Url::create($validatedDate);\n \n session()->flash('message', 'Shorten URL Created Successfully.');\n \n $this->resetInputFields();\n }", "public function saveDownLoadLink($linkModel) {\r\n /** to save download link */\r\n $linkModel->save ();\r\n return true;\r\n }", "protected function save($url)\n {\n $shortLink = Generator::getRandomString();\n\n $item = array(\n 'created' => new \\MongoDate(),\n 'key' => $shortLink,\n 'target' => $url\n );\n\n $this->getCollection(self::MONGO_COLLECTION)->insert($item);\n\n $this->set(\"link\", 'http://' . $_SERVER['SERVER_NAME'] . '/' . $shortLink);\n }", "public function onAfterWrite() {\n if (!$this->URLPath) {\n $this->URLPath = Utils::generateURLPath($this->Title, $this->ID);\n $this->write();\n }\n\n parent::onAfterWrite();\n }", "public function actionSave()\n\t{\n\t\t// Is this an existing entry or a new entry?\n\t\tif ($id = craft()->request->getPost('rerouteId')) {\n\t\t\t$model = craft()->reroute->getById($id);\n\t\t} else {\n\t\t\t$model = craft()->reroute->create();\n\t\t}\n\n\t\t// Get the submitted data\n\t\t$data = craft()->request->getPost('reroute');\n\t\t$model->oldUrl = $data['oldUrl'];\n\t\t$model->newUrl = $data['newUrl'];\n\t\t$model->method = $data['method'];\n\n\t\t// Did we pass validation?\n\t\tif($model->validate()) {\n\t\t\tcraft()->reroute->save($model);\n\n\t\t\tcraft()->userSession->setNotice(Craft::t('Reroute saved.'));\n\n\t\t\treturn $this->redirectToPostedUrl();\n\t\t} else {\n\t\t\tcraft()->userSession->setError(Craft::t('There was a problem with your submission, please check the form and try again!'));\n\t\t\tcraft()->urlManager->setRouteVariables(array('reroute' => $model));\n\t\t}\n\t}", "function link() {\n\t\t$this->Link->recursive = 0;\n\t\t$links = $this->Link->find('all');\n\t\t$this->set('links', $links);\n\t}", "public function store(Request $request)\n {\n $request->validate([\n 'link' => 'required|url'\n ]);\n\n Link::create([\n 'link' => $request->link,\n 'code' => rand(10,99) . str_random(4)\n ]);\n\n return redirect()->route('generate.shorten.link');\n }", "public function setFormLink($link) {\n $this->form_link = $link;\n }", "public function setLink(string $link): void\n {\n $this->link = $link;\n }", "function url_save($post_ID) {\n global $post;\n\n if ( defined('DOING_AUTOSAVE') && DOING_AUTOSAVE ) {\n return $post_id;\n }\n \n if (isset($_POST)) {\n update_post_meta( $post_ID, '_url_name', strip_tags( $_POST['url_name'] ) );\n }\n}", "protected function set_url_this_add($val){ $this->input ['add_url'] = $val ; }", "function update()\n {\n $GLOBALS[\"DEBUG\"] = true;\n $this->dbInit();\n $this->Database->query( \"UPDATE eZLink_Link SET\n Title='$this->Title',\n Description='$this->Description',\n LinkGroup='$this->LinkGroupID',\n KeyWords='$this->KeyWords',\n Url='$this->Url',\n ImageID='$this->ImageID',\n Accepted='$this->Accepted'\n WHERE ID='$this->ID'\" );\n }", "public function insert_page_link($data){\n $this->db->insert($data,'links');\n\n }", "function setLink($url)\n\t{\n\t\t$this->link = $url;\n\t}", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function save();", "public function store(Request $request)\n {\n $domain = Domain::where('status','aktif')->first();\n $shortlink = createshortlink(domain($domain));\n Slink::create([\n 'link_original' => $request->link_original,\n 'link_short' => $shortlink,\n 'view' => 0,\n ]);\n\n \n return redirect('/')->with('link',$shortlink);\n }" ]
[ "0.7156288", "0.70559853", "0.70048344", "0.69929916", "0.69524413", "0.6838236", "0.678465", "0.6705123", "0.6693877", "0.66409034", "0.66297615", "0.659242", "0.65858215", "0.6557727", "0.65347314", "0.64798564", "0.64642113", "0.643759", "0.6402885", "0.6380929", "0.63255274", "0.6290248", "0.626163", "0.6248632", "0.6229985", "0.6229007", "0.6194243", "0.6188324", "0.6188324", "0.61787987", "0.61599517", "0.6140641", "0.613928", "0.60952884", "0.60865754", "0.60817605", "0.6067573", "0.6063742", "0.6063136", "0.60340804", "0.6033336", "0.602885", "0.6018908", "0.6008216", "0.6007862", "0.5987498", "0.598267", "0.59616596", "0.59583247", "0.59545875", "0.594756", "0.5940736", "0.5939856", "0.59362346", "0.59339255", "0.5932892", "0.59185845", "0.59076285", "0.58937263", "0.5891738", "0.58845526", "0.58568347", "0.58551514", "0.58476555", "0.5837105", "0.58292794", "0.5815459", "0.5810397", "0.5806615", "0.58016384", "0.5793127", "0.57911956", "0.57833785", "0.5778271", "0.5775037", "0.5769341", "0.57651484", "0.5755483", "0.57526743", "0.5734385", "0.5728301", "0.5726172", "0.5726172", "0.5726172", "0.5726172", "0.5726172", "0.5726172", "0.5726172", "0.5726172", "0.5726172", "0.5726172", "0.5726172", "0.5726172", "0.5726172", "0.5726172", "0.5726172", "0.5726172", "0.5726172", "0.5726172", "0.5706029" ]
0.58504486
63
Display our new "Link" field
public function get_featured_image_Link( $attachment_id = null ) { $attachment_id = ( empty( $attachment_id ) ) ? get_post_thumbnail_id() : (int) $attachment_id; if ( $attachment_id ) return get_post_meta( $attachment_id, 'space_boxes_img_link', true ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setUrlLink(){\n if( $this->id == 0 ) return;\n $url = $this->aFields[\"url\"]->toString();\n if( $url == \"\" ) return;\n $url = strip_tags( preg_replace( \"/[\\\"']/\", \"\", $url ) );\n if( !$this->aFields[\"url\"]->editable ) $this->aFields[\"url\"]->display = false;\n $this->aFields[\"url_link\"]->display = true;\n $this->aFields[\"url_link\"]->value = \"<a href=\\\"\".$url.\"\\\">\".$url.\"</a>\";\n }", "public function makeLinkButton() {}", "protected function linkAdd() { return \"\"; }", "public function getLink();", "public function getLink();", "public function getLink() {}", "function ShowLink()\n {\n $CompaniesPage = CompanyListPage::get()->first();\n if ($this->Description) {\n return $CompaniesPage->Link() . \"profile/\" . $this->URLSegment;\n } else {\n return $this->URL;\n }\n }", "public static function linkField($text,$url='#',$option=array()) {\n $option['href']=$url;\n \t\treturn self::htmltag('a',$option,$text);\n\t}", "public function getLink(){\n return $this->link;\n }", "function getLink() {return $this->_link;}", "function getLink() {return $this->_link;}", "public function setLink($link);", "public function getLink(): string;", "public function getLink(): string;", "function renderFilterCreationLink() {\n\t\t$content = tslib_CObj::getSubpart($this->fileContent, '###NEWFILTER_LINK###');\n\n\t\tif (!isset($this->conf['newfilter_link.']['form_url.']['parameter'])) {\n\t\t\t$this->conf['newfilter_link.']['form_url.']['parameter'] = $GLOBALS['TSFE']->id;\n\t\t}\n\t\t$this->conf['newfilter_link.']['form_url.']['returnLast'] = 'url';\n\t\t$content = tslib_cObj::substituteMarker($content, '###FORM_URL###', $this->cObj->typolink('', $this->conf['newfilter_link.']['form_url.']));\n\n\t\treturn $content;\n\t}", "function link() {\n $this->title = \"link\";\n }", "public function link(): string\n {\n return $this->link;\n }", "public function link() { return site_url().'/'.$this->post->post_name; }", "public function getLink():string;", "public function asLink()\n {\n $label = $this->title ?: $this->value;\n return '<a href=\"' . $this->href .'\" title=\"' . $label . '\">' . $label . '</a>';\n }", "function getLink(): string;", "function show_metabox_link_externo($post) {\r\n\t\t$link = get_post_meta($post->ID, 'link_externo', true);\r\n\t\twp_nonce_field(__FILE__, 'link_externo_nonce');\r\n\t\techo \"<input type='url' name='link_externo' class='widefat' value='$link'>\";\r\n\t}", "public function links()\n\t{\n\t\techo view('sketchpad::help/output/links');\n\t}", "public function get_link() {\r\n return $this->link;\r\n }", "function dblions_fb_link() {\n\t$fblink = esc_attr( get_option( 'facebook_link' ) );\n\tcreate_input_field( array(\n\t\t\t'facebook_link', 'text', \n\t\t\t$fblink, 'Facebook Link'\n\t\t) );\n}", "public function link();", "function getLink() {\r\n return $this->_link;\r\n }", "function getLink() {\r\n return $this->_link;\r\n }", "function getLink() {\n return new Hyperlink($this->getName(),\"/user/$this->id\",'userlink');\n }", "function formLink(){\n\t\t$yuiSuggest = &weSuggest::getInstance();\n\n\t\t$textname = 'we_' . $this->Name . '_txt[LinkPath]';\n\t\t$idname = 'we_' . $this->Name . '_txt[LinkID]';\n\t\t$extname = 'we_' . $this->Name . '_txt[LinkHref]';\n\t\t$linkType = $this->getElement('LinkType') ? : 'no';\n\t\t$linkPath = f('SELECT Path FROM ' . FILE_TABLE . ' WHERE ID = ' . intval($this->getElement('LinkID')), '', $this->DB_WE);\n\n\t\t$RollOverFlagName = 'we_' . $this->Name . '_txt[RollOverFlag]';\n\t\t$RollOverFlag = $this->getElement('RollOverFlag') ? 1 : 0;\n\t\t$RollOverIDName = 'we_' . $this->Name . '_txt[RollOverID]';\n\t\t$RollOverID = $this->getElement('RollOverID') ? : '';\n\t\t$RollOverPathname = 'we_' . $this->Name . '_txt[RollOverPath]';\n\t\t$RollOverPath = f('SELECT Path FROM ' . FILE_TABLE . ' WHERE ID = ' . intval($RollOverID), '', $this->DB_WE);\n\n\t\t$checkFlagName = 'check_' . $this->Name . '_RollOverFlag';\n\t\t$cmd1 = \"document.we_form.elements['\" . $idname . \"'].value\";\n\t\t$but1 = we_html_button::create_button(we_html_button::SELECT, \"javascript:we_cmd('we_selector_document', \" . $cmd1 . \",'\" . FILE_TABLE . \"','\" . we_base_request::encCmd($cmd1) . \"','\" . we_base_request::encCmd(\"document.we_form.elements['\" . $textname . \"'].value\") . \"','\" . we_base_request::encCmd(\"opener._EditorFrame.setEditorIsHot(true);opener.document.we_form.elements['we_\" . $this->Name . \"_txt[LinkType]'][2].checked=true;\") . \"','',0,'',\" . (permissionhandler::hasPerm(\"CAN_SELECT_OTHER_USERS_FILES\") ? 0 : 1) . \");\");\n\n\t\t$cmd1 = \"document.we_form.elements['\" . $RollOverIDName . \"'].value\";\n\t\t$but2 = we_html_button::create_button(we_html_button::SELECT, \"javascript:we_cmd('we_selector_image', \" . $cmd1 . \",'\" . FILE_TABLE . \"','\" . we_base_request::encCmd($cmd1) . \"','\" . we_base_request::encCmd(\"document.we_form.elements['\" . $RollOverPathname . \"'].value\") . \"','\" . we_base_request::encCmd(\"opener._EditorFrame.setEditorIsHot(true);opener.document.we_form.elements['\" . $RollOverFlagName . \"'].value=1;opener.document.we_form.elements['\" . $checkFlagName . \"'].checked=true;\") . \"','',0,'\" . we_base_ContentTypes::IMAGE . \"',\" . (permissionhandler::hasPerm(\"CAN_SELECT_OTHER_USERS_FILES\") ? 0 : 1) . \");\");\n\n\n\t\t$cmd1 = \"document.we_form.elements['\" . $extname . \"'].value\";\n\t\t$butExt = permissionhandler::hasPerm('CAN_SELECT_EXTERNAL_FILES') ?\n\t\t\twe_html_button::create_button(we_html_button::SELECT, \"javascript:we_cmd('browse_server','\" . we_base_request::encCmd($cmd1) . \"','',\" . $cmd1 . \",'\" . we_base_request::encCmd(\"opener._EditorFrame.setEditorIsHot(true);opener.document.we_form.elements['we_\" . $this->Name . \"_txt[LinkType]'][1].checked=true;\") . \"')\") : \"\";\n\n\t\tif(defined('OBJECT_TABLE')){\n\t\t\t$objidname = 'we_' . $this->Name . '_txt[ObjID]';\n\t\t\t$objtextname = 'we_' . $this->Name . '_txt[ObjPath]';\n\t\t\t$objPath = f('SELECT Path FROM ' . OBJECT_FILES_TABLE . ' WHERE ID = ' . intval($this->getElement('ObjID')), '', $this->DB_WE);\n\t\t\t$cmd1 = \"document.we_form.elements['\" . $objidname . \"'].value\";\n\t\t\t$butObj = we_html_button::create_button(we_html_button::SELECT, \"javascript:we_cmd('we_selector_document',\" . $cmd1 . \",'\" . OBJECT_FILES_TABLE . \"','\" . we_base_request::encCmd($cmd1) . \"','\" . we_base_request::encCmd(\"document.we_form.elements['\" . $objtextname . \"'].value\") . \"','\" . we_base_request::encCmd(\"opener._EditorFrame.setEditorIsHot(true);opener.document.we_form.elements['we_\" . $this->Name . \"_txt[LinkType]'][3].checked=true;\") . \"','','','objectFile',\" . (permissionhandler::hasPerm(\"CAN_SELECT_OTHER_USERS_OBJECTS\") ? 0 : 1) . \");\");\n\t\t}\n\n\t\t// Create table\n\t\t$_content = new we_html_table(array('class' => 'default'), (defined('OBJECT_TABLE') ? 11 : 9), 2);\n\t\t$row = 0;\n\t\t// No link\n\t\t$_content->setCol($row, 0, array('style' => 'vertical-align:top;padding-bottom:10px;'), we_html_forms::radiobutton('no', ($linkType === 'no'), 'we_' . $this->Name . '_txt[LinkType]', g_l('weClass', '[nolink]'), true, 'defaultfont', '_EditorFrame.setEditorIsHot(true);'));\n\t\t$_content->setCol($row++, 1, null, '');\n\n\t\t// External link\n\t\t$_ext_link_table = new we_html_table(array('class' => 'default'), 1, 2);\n\n\t\t$_ext_link_table->setCol(0, 0, null, $this->htmlTextInput('we_' . $this->Name . '_txt[LinkHref]', 25, $this->getElement('LinkHref'), '', 'onchange=\"_EditorFrame.setEditorIsHot(true);\"', \"text\", 280));\n\t\t$_ext_link_table->setCol(0, 1, null, $butExt);\n\n\t\t$_ext_link = \"href\" . we_html_element::htmlBr() . $_ext_link_table->getHtml();\n\n\t\t$_content->setCol($row, 0, array('style' => 'vertical-align:top;padding-bottom:10px;'), we_html_forms::radiobutton(we_base_link::TYPE_EXT, ($linkType == we_base_link::TYPE_EXT), 'we_' . $this->Name . '_txt[LinkType]', g_l('weClass', '[extern]'), true, 'defaultfont', '_EditorFrame.setEditorIsHot(true)'));\n\t\t$_content->setCol($row++, 1, array('class' => 'defaultfont', 'style' => 'vertical-align:top'), $_ext_link);\n\n\n\t\t// Internal link\n\t\t$yuiSuggest->setAcId('internalPath');\n\t\t$yuiSuggest->setContentType(implode(',', array(we_base_ContentTypes::FOLDER, we_base_ContentTypes::WEDOCUMENT, we_base_ContentTypes::IMAGE, we_base_ContentTypes::JS, we_base_ContentTypes::CSS, we_base_ContentTypes::HTML, we_base_ContentTypes::APPLICATION, we_base_ContentTypes::QUICKTIME)));\n\t\t$yuiSuggest->setInput($textname, $linkPath);\n\t\t$yuiSuggest->setResult($idname, $this->getElement('LinkID'));\n\t\t$yuiSuggest->setTable(FILE_TABLE);\n\t\t$yuiSuggest->setSelectButton($but1);\n\t\t$yuiSuggest->setMaxResults(10);\n\t\t$yuiSuggest->setMayBeEmpty(0);\n\t\t$yuiSuggest->setWidth(280);\n\t\t$yuiSuggest->setSelector(weSuggest::DocSelector);\n\t\t$yuiSuggest->setLabel('href');\n\t\t$_int_link = $yuiSuggest->getHTML();\n\n\t\t$_content->setCol($row, 0, array('style' => 'vertical-align:top'), we_html_forms::radiobutton(we_base_link::TYPE_INT, ($linkType == we_base_link::TYPE_INT), 'we_' . $this->Name . '_txt[LinkType]', g_l('weClass', '[intern]'), true, 'defaultfont', '_EditorFrame.setEditorIsHot(true);'));\n\t\t$_content->setCol($row++, 1, array('class' => 'defaultfont', 'style' => 'vertical-align:top'), $_int_link);\n\n\t\t// Object link\n\t\tif(defined('OBJECT_TABLE')){\n\n\t\t\t$yuiSuggest->setAcId('objPathLink');\n\t\t\t$yuiSuggest->setContentType(\"folder,\" . we_base_ContentTypes::OBJECT_FILE);\n\t\t\t$yuiSuggest->setInput($objtextname, $objPath);\n\t\t\t$yuiSuggest->setResult($objidname, $this->getElement('ObjID'));\n\t\t\t$yuiSuggest->setTable(OBJECT_FILES_TABLE);\n\t\t\t$yuiSuggest->setSelectButton($butObj);\n\t\t\t$yuiSuggest->setMaxResults(10);\n\t\t\t$yuiSuggest->setMayBeEmpty(0);\n\t\t\t$yuiSuggest->setWidth(280);\n\t\t\t$yuiSuggest->setSelector(weSuggest::DocSelector);\n\t\t\t$yuiSuggest->setLabel('href');\n\t\t\t$_obj_link = $yuiSuggest->getHTML();\n\n\n\t\t\t$_content->setCol($row, 0, array('style' => 'vertical-align:top;padding-top:10px;'), we_html_forms::radiobutton(we_base_link::TYPE_OBJ, ($linkType == we_base_link::TYPE_OBJ), 'we_' . $this->Name . '_txt[LinkType]', g_l('linklistEdit', '[objectFile]'), true, 'defaultfont', '_EditorFrame.setEditorIsHot(true);'));\n\t\t\t$_content->setCol($row++, 1, array('class' => 'defaultfont', 'style' => 'vertical-align:top'), $_obj_link);\n\t\t}\n\n\t\t// Target\n\t\t$_content->setCol($row++, 0, array('colspan' => 2, 'class' => 'defaultfont', 'style' => 'vertical-align:top;padding:20px 0px;'), g_l('weClass', '[target]') . we_html_element::htmlBr() . we_html_tools::targetBox('we_' . $this->Name . '_txt[LinkTarget]', 33, 0, '', $this->getElement('LinkTarget'), '_EditorFrame.setEditorIsHot(true);', 20, 97));\n\n\n\t\t// Rollover image\n\t\t$yuiSuggest->setAcId('rollOverPath');\n\t\t$yuiSuggest->setContentType(implode(',', array(we_base_ContentTypes::FOLDER, we_base_ContentTypes::WEDOCUMENT, we_base_ContentTypes::IMAGE, we_base_ContentTypes::JS, we_base_ContentTypes::CSS, we_base_ContentTypes::HTML, we_base_ContentTypes::APPLICATION, we_base_ContentTypes::QUICKTIME)));\n\t\t$yuiSuggest->setInput($RollOverPathname, $RollOverPath);\n\t\t$yuiSuggest->setResult($RollOverIDName, $RollOverID);\n\t\t$yuiSuggest->setTable(FILE_TABLE);\n\t\t$yuiSuggest->setSelectButton($but2);\n\t\t$yuiSuggest->setMaxResults(10);\n\t\t$yuiSuggest->setMayBeEmpty(0);\n\t\t$yuiSuggest->setWidth(280);\n\t\t$yuiSuggest->setSelector(weSuggest::DocSelector);\n\t\t$yuiSuggest->setLabel('href');\n\t\t$_rollover = $yuiSuggest->getHTML();\n\n\t\t$_content->setCol($row, 0, array('style' => 'vertical-align:top'), we_html_forms::checkbox(1, $RollOverFlag, $checkFlagName, 'Roll Over', false, 'defaultfont', \"_EditorFrame.setEditorIsHot(true); this.form.elements['\" . $RollOverFlagName . \"'].value = (this.checked ? 1 : 0); \") . we_html_element::htmlHidden($RollOverFlagName, $RollOverFlag));\n\t\t$_content->setCol($row, 1, array('class' => 'defaultfont', 'style' => 'vertical-align:top'), $_rollover);\n\n\t\treturn $_content->getHtml();\n\t}", "public function getDisplayLink()\n {\n return $this->displayLink;\n }", "public function getLink()\n {\n return $this->link;\n }", "public function getLink()\n {\n return $this->link;\n }", "public function getLink()\n {\n return $this->link;\n }", "public function getLink()\n {\n return $this->link;\n }", "public function getLink()\n {\n return $this->link;\n }", "public function getLink()\n {\n return $this->link;\n }", "public function getLink()\n {\n return $this->link;\n }", "public function getLink()\n {\n return $this->link;\n }", "public function getLink()\n {\n return $this->link;\n }", "public function getLink()\n {\n return $this->link;\n }", "public function getLink()\n {\n return $this->link;\n }", "public function getLink()\n {\n return $this->link;\n }", "public function getLink()\n {\n return $this->link;\n }", "public function getLink()\n {\n return $this->link;\n }", "public function Link()\n {\n return Controller::join_links('admin/admin-help/show/help', $this->ID);\n }", "public function get_link()\n\t{\n\t\treturn $this->link;\n\t}", "public static function wp_link_dialog()\n {\n }", "public function link(): string {\n\t\treturn $this->page['link'] ?? '';\n\t}", "function get_link_to_edit($link)\n {\n }", "public function get_link()\n {\n\n return $this->link;\n }", "function post_link_box(){\n add_meta_box( 'post_link_box', 'Link', 'post_link_box_content', 'post', 'normal', 'high');\n }", "function kp_portfolio_link( $post )\n{\n wp_nonce_field( 'kp_save_portfolio_link_data', 'kp_portfolio_link_meta_box_nonce' );\n\n $value = get_post_meta( $post->ID, '_link', true );\n $hint = '<p class=\"howto\">Link to project website</p>';\n echo '<input name=\"kp_portfolio_link_field\" type=\"url\" value=\"' . esc_attr( $value ) . '\" style=\"width:100%\">' . $hint;\n}", "public function getLink()\n {\n return $this->get('Link');\n }", "public function getLink() {\n return $this->link;\n }", "public function viewLink()\n {\n return $this->html->link($this->object->path(), $this->object->getTitle(), ['target' => '_blank']);\n }", "public function create()\n {\n //加载添加友情链接\n \n return view(\"admin.link.create\");\n }", "protected function isLink() {}", "public function getLink()\n\t{\n\t\treturn $this->link;\n\t}", "public function getLink()\n\t{\n\t\treturn $this->link;\n\t}", "public function get_link() {\n\n\t\t$keyword_synonyms_modal_config = array(\n\t\t\t'mountHook' => '.wpseo-button-keyword-synonyms',\n\t\t\t'openButtonIcon' => '',\n\t\t\t'intl' => array(\n\t\t\t\t'open' => __( '+ Add synonyms', 'wordpress-seo' ),\n\t\t\t\t'modalAriaLabel' => sprintf(\n\t\t\t\t\t/* translators: %s expands to 'Yoast SEO Premium'. */\n\t\t\t\t\t__( 'Get %s now!', 'wordpress-seo' ), 'Yoast SEO Premium'\n\t\t\t\t),\n\t\t\t\t'heading' => sprintf(\n\t\t\t\t\t/* translators: %s expands to 'Yoast SEO Premium'. */\n\t\t\t\t\t__( 'Get %s now!', 'wordpress-seo' ), 'Yoast SEO Premium'\n\t\t\t\t),\n\t\t\t),\n\t\t\t'classes' => array(\n\t\t\t\t'openButton' => 'wpseo-keyword-synonyms button-link',\n\t\t\t),\n\t\t\t'content' => 'KeywordSynonyms',\n\t\t);\n\n\t\t$translations = new WPSEO_Keyword_Synonyms_Modal();\n\t\t$translations->enqueue_translations();\n\n\t\t$benefits = new WPSEO_Premium_Benefits_For_Synonyms_List();\n\t\t$benefits->enqueue_translations();\n\n\t\tYoast_Modal::add( $keyword_synonyms_modal_config );\n\n\t\treturn '<div class=\"wpseo-button-keyword-synonyms\"></div>';\n\t}", "public function link()\r\n\t{\r\n\t\t$language_segment = (Config::get('core::languages')) ? $this->language->uri . '/' : '';\r\n\r\n\t\treturn url($language_segment . 'galleries/' . $this->gallery->slug . '/' . $this->id);\r\n\t}", "public function viewLink()\n {\n return \\Html::link($this->entity->path(), $this->entity->getTitle(), ['target' => '_blank']);\n }", "public function getLink() {\n\t\treturn $this->link;\n\t}", "public function add_registration_link_text() {\n\t\t\tprintf(\n\t\t\t\t'<p class=\"ast-woo-form-actions\">\n\t\t\t\t\t%1$s\n\t\t\t\t\t<a href=\"#ast-woo-register\" data-type=\"do-register\" class=\"ast-woo-account-form-link\">\n\t\t\t\t\t\t%2$s\n\t\t\t\t\t</a>\n\t\t\t\t</p>',\n\t\t\t\tapply_filters( 'astra_addon_woo_account_register_heading', __( 'Not a member?', 'astra-addon' ) ), // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped\n\t\t\t\tapply_filters( 'astra_addon_woo_account_register_string', __( 'Register', 'astra-addon' ) ) // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped\n\t\t\t);\n\t\t}", "function get_default_link_to_edit()\n {\n }", "private function viewCommon() {\n $m = $this->getViewModel();\n //$view->assets(['bootstrap','DateTime','SummerNote','links-edit']);\n\n $m->post = '/admin/link/post';\n $m->url = $this->url;\n $m->display = self::display();\n $m->urltypes = self::getUrlTypes();\n $id = $m->link->id ?? 'new';\n $m->title = 'Link#' . $id;\n return $this->render('links', 'edit');\n }", "protected function addLinks()\n {\n }", "public function create()\n {\n //\n return view(\"Admin.link.create\");\n }", "public function Link()\n {\n if ($product = $this->Product()) {\n return $product->Link;\n }\n return '';\n }", "function Link()\n\t{\tif ($this->details[\"hblink\"])\n\t\t{\tif (strstr($this->details[\"hblink\"], \"http://\") || strstr($this->details[\"hblink\"], \"https://\"))\n\t\t\t{\treturn $this->details[\"hblink\"];\n\t\t\t} else\n\t\t\t{\treturn SITE_URL . $this->details[\"hblink\"];\n\t\t\t}\n\t\t}\n\t}", "public function newAction()\n {\n $entity = new Links();\n $form = $this->createForm(new LinksType(), $entity);\n return $this->render('SiteAdminBundle:Links:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "function setLink($link) {\r\n $this->_link = $link;\r\n }", "function setLink($link) {\r\n $this->_link = $link;\r\n }", "public function setLink($link){\n\t\t$this->link = $link;\n\t}", "protected function getInfoLink()\n {\n return Injector::inst()->create(\n GridFieldHtmlFragment::class,\n 'buttons-before-right',\n DBField::create_field('HTMLFragment', ArrayData::create([\n 'Link' => 'https://userhelp.silverstripe.org/en/4/optional_features/modules_report',\n 'Label' => _t(__CLASS__ . '.MORE_INFORMATION', 'More information'),\n ])->renderWith(__CLASS__ . '/MoreInformationLink'))\n );\n }", "function addLinkToField($fieldName,$renderClass=\"\"){\r\n\t\t$this->fieldsToLink[$fieldName]=$renderClass;\r\n\t}", "function wpcom_referral_footer_field_refer_url_render() {\n\t\t$options = get_option( 'wpcom_referral_footer_settings' );\n\t\t?>\n\t\t<input type='text' name='wpcom_referral_footer_settings[wpcom_referral_footer_field_refer_url]' value='<?php echo $options['wpcom_referral_footer_field_refer_url']; ?>' style='width:100%;max-width:760px'>\n\t\t<p class=\"description\"><?php _e( 'For example: https://refer.wordpress.com/r/01/wordpress-com/' ); ?></p>\n\t\t<?php\n\t}", "public function renderLinkAttributeFields() {}", "public function renderLinkAttributeFields() {}", "public function getLinkAttribute()\n\t{\n\t\treturn HTML::link('/team/view/'. $this->id, $this->name);\n\t}", "public function linkAction() : object\n {\n $title = \"Markdown\";\n $text = file_get_contents(__DIR__ . \"/textfiles/clickable.txt\");\n // $filter = new MyTextFilter();\n\n // Deal with the action and return a response.\n $this->app->page->add(\"textfilter/clickable\", [\n \"text\" => $text,\n \"html\" => $this->filter->parse($text, [\"link\"])\n ], \"main\");\n return $this->app->page->render([ \"title\" => $title ]);\n }", "function edit()\n\t{\n\t\t$user\t= & JFactory::getUser();\n\n\t\t// Make sure you are logged in\n\t\tif (!$user->authorise('com_weblink.weblink.edit')) {\n\t\t\tJError::raiseError(403, JText::_('ALERTNOTAUTH'));\n\t\t\treturn;\n\t\t}\n\n\t\tJRequest::setVar('view', 'weblink');\n\t\tJRequest::setVar('layout', 'form');\n\n\t\t$model = &$this->getModel('weblink');\n\t\t$model->checkout();\n\n\t\tparent::display();\n\t}", "public function link_for_activitylink() {\n global $DB;\n $module = $DB->get_record('course_modules', array('id' => $this->properties->activitylink));\n if ($module) {\n $modname = $DB->get_field('modules', 'name', array('id' => $module->module));\n if ($modname) {\n $instancename = $DB->get_field($modname, 'name', array('id' => $module->instance));\n if ($instancename) {\n return html_writer::link(new moodle_url('/mod/'.$modname.'/view.php', array('id'=>$this->properties->activitylink)),\n get_string('activitylinkname', 'languagelesson', $instancename),\n array('class'=>'centerpadded lessonbutton standardbutton'));\n }\n }\n }\n return '';\n }", "public function Link()\n {\n return $this->Url;\n }", "function edit_term_link($link = '', $before = '', $after = '', $term = \\null, $display = \\true)\n {\n }", "public function uploadlink() {\n $defaults = array();\n\n $defaults[\"straat\"] = \"straatnaam of de naam van de buurt\";\n $defaults[\"huisnummer\"] = \"huisnummer\";\n $defaults[\"maker\"] = \"maker\";\n $defaults[\"personen\"] = \"namen\";\n $defaults[\"datum\"] = \"datum of indicatie\";\n $defaults[\"titel\"] = \"titel\";\n $defaults[\"naam\"] = \"Je naam\";\n $defaults[\"email\"] = \"Je e-mailadres\";\n $defaults[\"tags\"] = \"\";\n\n $this->set('defaults', $defaults);\n }", "public function getOfficialLink();", "function l($text,$url='#',$htmlOptions=array())\n{\n\treturn CHtml::link($text, $url, $htmlOptions);\n}", "public function setLink($value)\n {\n return $this->set('Link', $value);\n }", "public function setLink($value)\n {\n return $this->set('Link', $value);\n }", "public function setLink($value)\n {\n return $this->set('Link', $value);\n }", "public function setLink($value)\n {\n return $this->set('Link', $value);\n }", "public function setLink($value)\n {\n return $this->set('Link', $value);\n }", "function genLink () {\n\t\t\t$db_host=\"127.0.0.1\";\n\t\t\t$db_nombre=\"gallery\";\n\t\t\t$db_user=\"gallery\";\n\t\t\t$db_pass=\"gallery\";\n\t\t\t$link=mysql_connect($db_host, $db_user, $db_pass) or die (\"Error conectando a la base de datos.\");\n\t\t\tmysql_select_db($db_nombre ,$link) or die(\"Error seleccionando la base de datos.\");\n\t\t\t$this->link = $link;\n\t\t}", "function l($text, $url = '#', $htmlOptions = array()) \n{\n return CHtml::link($text, $url, $htmlOptions);\n}", "public function link() : Link;", "function getLinkTarget() {return $this->_linktarget;}", "function link_meta_box() {\n add_meta_box(\n 'global-notice',\n __( 'Link', 'sitepoint' ),\n 'link_meta_box_callback',\n 'projects',\n 'side',\n 'low'\n );\n}", "function link_souce($text){\n\n if(post::isValidURL($text)){\n $text = '<a href=\"'.$text.'\">'.$text.'</a>';\n } \n return $text;\n }", "function referrer_link( $format = '%link', $title = '%title', $sep = '&raquo;', $sepdirection = 'left' ) {\n\techo Smarter_Navigation::referrer_link( $format, $title, $sep, $sepdirection );\n}" ]
[ "0.7839913", "0.7298149", "0.7192067", "0.7085275", "0.7085275", "0.70407057", "0.7024334", "0.6961928", "0.69077086", "0.6898475", "0.6898475", "0.6864658", "0.6851063", "0.6851063", "0.6849446", "0.6818", "0.679943", "0.6796082", "0.6747562", "0.6739338", "0.67283183", "0.6711115", "0.6659986", "0.66523814", "0.6631527", "0.6613868", "0.6562372", "0.6562372", "0.6552106", "0.6542229", "0.6538563", "0.6515104", "0.6515104", "0.6515104", "0.6515104", "0.6515104", "0.6515104", "0.6515104", "0.6515104", "0.6515104", "0.6515104", "0.6515104", "0.6515104", "0.6515104", "0.6515104", "0.6504704", "0.650257", "0.6488024", "0.6486953", "0.64868826", "0.64841104", "0.6473411", "0.6465683", "0.6459454", "0.64512587", "0.64418554", "0.643393", "0.6422379", "0.6405521", "0.6405521", "0.639501", "0.63930476", "0.6382369", "0.6380719", "0.6370549", "0.6365402", "0.6363512", "0.63532954", "0.63511926", "0.63497454", "0.63496405", "0.6330299", "0.6320759", "0.6320759", "0.6312658", "0.63068515", "0.63037723", "0.629983", "0.62916523", "0.62916523", "0.62832695", "0.62776816", "0.62666196", "0.6240043", "0.62236786", "0.62182736", "0.6213607", "0.620151", "0.6199906", "0.61790025", "0.6177679", "0.61772275", "0.61761576", "0.61761576", "0.6167277", "0.61599046", "0.6153757", "0.6151741", "0.61472636", "0.61446714", "0.6135898" ]
0.0
-1
/ Get the instance of pinEZInclude
public static function i(){ if(self::$instance==null){ self::$instance=new pinEZInclude(); } return self::$instance; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getInclude() {return $this->readInclude();}", "public function getInclude()\n {\n return $this->include;\n }", "function readInclude() {return $this->_include;}", "public static function getInstance()\n {\n static $instance = null;\n if (null === $instance) {\n $instance = new IncludesConfig();\n }\n return $instance;\n }", "public static function init() {\n\t\tif ( is_null( self::$instance ) ) {\n\t\t\tself::$instance = new self();\n\n\t\t\tadd_filter( 'template_include', array( self::$instance, 'template_include' ) );\n\t\t}\n\n\t\treturn self::$instance;\n\t}", "protected function getIncludeCode()\n {\n $pre_string = $this->xml->asXML();\n\n $post_string = '';\n $done = false;\n\n while ($done === false) {\n\n $post_string = $this->getIncludeCodeLoop($pre_string);\n\n if ($post_string === $pre_string) {\n $done = true;\n } else {\n $pre_string = $post_string;\n }\n }\n\n $this->xml = simplexml_load_string($post_string);\n\n if (isset($this->xml->model)) {\n $this->xml = $this->xml->model;\n }\n\n return $this;\n }", "protected function readIncludeID() { return $this->_inclid; }", "public function getIncludeMeta()\n {\n return $this->include_meta;\n }", "protected function getFragment_Renderer_HincludeService()\n {\n $this->services['fragment.renderer.hinclude'] = $instance = new \\Symfony\\Component\\HttpKernel\\Fragment\\HIncludeFragmentRenderer($this->get('twig'), $this->get('uri_signer'), NULL);\n\n $instance->setFragmentPath('/_fragment');\n\n return $instance;\n }", "function __construct() {\n $this->includes();\n }", "protected function initIncludePath()\n\t{\n\t\t$includePath = array();\n\t\t$autoloadPath = explode(\",\", AUTOLOAD_PATH);\n\t\tforeach($autoloadPath as $namespace)\n\t\t{\n\t\t\t$includePath[] = AD.$namespace.\"/\";\n\t\t}\n\t\tset_include_path(implode(PATH_SEPARATOR, $includePath));\n\t\treturn $this;\n\t}", "public function includes() {\n\n\t\t// template functions\n\t\trequire_once( $this->get_plugin_path() . '/includes/wc-pip-template-functions.php' );\n\n\t\t// abstract class\n\t\trequire_once( $this->get_plugin_path() . '/includes/abstract-wc-pip-document.php' );\n\n\t\t// invoices\n\t\trequire_once( $this->get_plugin_path() . '/includes/class-wc-pip-document-invoice.php' );\n\n\t\t// packing lists\n\t\trequire_once( $this->get_plugin_path() . '/includes/class-wc-pip-document-packing-list.php' );\n\t\trequire_once( $this->get_plugin_path() . '/includes/class-wc-pip-document-pick-list.php' );\n\n\t\t// handler\n\t\t$this->handler = $this->load_class( '/includes/class-wc-pip-handler.php', 'WC_PIP_Handler' );\n\n\t\t// print documents\n\t\t$this->print = $this->load_class( '/includes/class-wc-pip-print.php', 'WC_PIP_Print' );\n\n\t\t// document emails\n\t\t$this->emails = $this->load_class( '/includes/class-wc-pip-emails.php', 'WC_PIP_Emails' );\n\n\t\tif ( is_admin() ) {\n\t\t\t// admin side\n\t\t\t$this->admin_includes();\n\t\t} else {\n\t\t\t// frontend side\n\t\t\t$this->frontend = $this->load_class( '/includes/frontend/class-wc-pip-frontend.php', 'WC_PIP_Frontend' );\n\t\t}\n\n\t\t// ajax\n\t\tif ( is_ajax() ) {\n\t\t\t$this->ajax = $this->load_class( '/includes/class-wc-pip-ajax.php', 'WC_PIP_Ajax' );\n\t\t}\n\n\t\t// template customizer\n\t\t$this->customizer = $this->load_class( '/includes/admin/class-wc-pip-customizer.php', 'WC_PIP_Customizer' );\n\n\t\t// integrations\n\t\t$this->integrations = $this->load_class( '/includes/integrations/class-wc-pip-integrations.php', 'WC_PIP_Integrations' );\n\t}", "public function getContainedPluginInstance();", "public function getIncludePath()\n {\n return $this->includePath;\n }", "public function __construct()\n {\n parent::__construct();\n $this->fractal->parseIncludes($this->getTransformer()->getAvailableIncludes());\n }", "public function getIncludes() {\n return $this->includes;\n }", "function EDD_Taxamo_EDD_Integration_load() {\n if ( ! class_exists( 'Easy_Digital_Downloads' ) ) {\n if ( ! class_exists( 'EDD_Extension_Activation' ) ) {\n require_once 'includes/class.extension-activation.php';\n }\n\n $activation = new EDD_Extension_Activation( plugin_dir_path( __FILE__ ), basename( __FILE__ ) );\n $activation = $activation->run();\n return EDD_Taxamo_EDD_Integration::instance();\n } else {\n return EDD_Taxamo_EDD_Integration::instance();\n }\n }", "public function getInclusion()\n {\n return $this->inclusion;\n }", "public function getInstitucion(): Institucion\n {\n return $this->institucion;\n }", "public function loader_get_include_path () {\r\n\t\treturn $this->_include_path;\r\n\t}", "static function get_instance() {\n\t\t\tif (null == VG_Page_Template_Hide_Elements::$instance) {\n\t\t\t\tVG_Page_Template_Hide_Elements::$instance = new VG_Page_Template_Hide_Elements();\n\t\t\t\tVG_Page_Template_Hide_Elements::$instance->init();\n\t\t\t}\n\t\t\treturn VG_Page_Template_Hide_Elements::$instance;\n\t\t}", "public static function get_instance() {\n\t\tif ( self::$_instance == null ) {\n\t\t\tself::$_instance = new GF_TEC_AddOn();\n\t\t}\n\n\t\treturn self::$_instance;\n\t}", "public function instance();", "function __construct()\n {\n parent::__construct();\n $this->load->library('sap_invoice');\n }", "public function includes() {\n new Updater($this->license_base, $this->product_version, $this->license_type);\n }", "static public function getInstance() {\n $instance = Enlight_Class::Instance('Shopware_Plugins_Backend_sKUZOOffer_Components_OfferHelper');\n return $instance;\n }", "public static function inst()\n {\n return static::get_one(__CLASS__);\n }", "public function getIncludes()\r\n {\r\n return $this->includes;\r\n }", "public function loadTheInstance();", "protected function getExtension()\n {\n return new PackerExtension();\n }", "protected function readIncludeStandard() { return $this->_inclstandard; }", "abstract public function get_instance();", "protected function include_configuration() {\n $config = new tool_forcedcache_cache_config();\n return $config->include_configuration_wrapper();\n }", "function get_instance()\r\n{\r\n\t\r\n}", "public static function get_instance()\n {\n }", "public static function get_instance()\n {\n }", "public function setInclude ($include)\n {\n $this->_include = (string) $include;\n return $this;\n }", "public static function get_instance()\n {\n }", "public static function get_instance()\n {\n }", "public static function get_instance()\n {\n }", "public static function get_instance()\n {\n }", "private function protectedInclude()\n {\n $_tpl = $this;\n\n // View Helpers:\n // * Include another view into the current view:\n $_view = function ($tplName, $params = [], $preventCache = false) use ($_tpl) {\n $tplCopy = clone $_tpl; // Don't want to mess with the calling template's settings.\n echo($tplCopy->render($tplName, $params, $preventCache));\n unset($tplCopy);\n };\n // * Encode html for a 'Safe String'.\n $_ss = function ($str) {\n return htmlspecialchars($str, ENT_QUOTES);\n };\n\n // Extract template parameters into this local namespace.\n $allParams = (object) array_merge((array)self::$staticParams, (array)$this->params);\n extract(get_object_vars($allParams));\n unset($allParams);\n\n // Included template has access to variables local to this function.\n include($this->templateFile);\n }", "function __construct() {\n\t\treturn $this->Content_Elements_ft();\n\t}", "public function getObject()\n\t{\n\t\t// Create the OPF instance.\n\t\treturn new Opf_Class($this->_serviceLocator->get('template.Opt'));\n\t}", "public function __construct() {\n parent::__construct();\n $this->load->library('zip');\n }", "protected function _init()\n {\n return $this;\n }", "function humcore_deposit_component_include() {\n\n\trequire( dirname( __FILE__ ) . '/component-loader.php' );\n\n}", "protected function _includes() {\r\n\t\t\tinclude_once LP_ADDON_PAYIR_PAYMENT_INC . 'class-lp-gateway-payir.php';\r\n\t\t}", "public function includeAvailableIncludes()\n {\n return (new Primitive())->setData($this->getAvailableIncludes());\n }", "function __construct() {\n // require_once(str_replace(\"\\\\\", \"/\", APPPATH).'libraries/NuSOAP/lib/nusoap'.EXT);\n require_once(str_replace(\"\\\\\", \"/\", APPPATH).'libraries/nusoap/nusoap'.EXT);\n }", "public function getInclude()\n {\n return new Horde_Pear_Package_Contents_Include_Patterns(\n array('themes/' . basename($this->_root) . '/*'),\n $this->getRepositoryRoot()\n );\n }", "public static function loader()\r\n {\r\n if(is_null(self::$instance))\r\n self::$instance = new self();\r\n return self::$instance;\r\n }", "public function instance() {\n\t\t\n\t}", "function __construct() {\r\n\t\t$this->ini = eZINI::instance(\"bfeztag_metadata.ini\");\r\n\t}", "public function getConfigInclude()\n {\n return $this->configParams['sections_include'];\n }", "public function includes() {\n\t\trequire_once( plugin_dir_path( __FILE__ ) . 'class-productflow-admin.php' );\n\t\trequire_once( plugin_dir_path( __FILE__ ) . 'class-productflow-filters.php' );\n\t}", "function getInstance(){\n\t\tstatic $__instance = null;\n\t\tif( !$__instance ){\n\t\t\t$__instance = new modJaContentslideHelper();\n\t\t}\n\t\treturn $__instance;\n\t}", "public function getInstance()\n\t{\n\t\tif($this->classname === null) {\n\t\t\tthrow new BuildException('The classname attribute must be specified');\n\t\t}\n\t\t\n\t\tif($this->instance === null) {\n\t\t\ttry {\n\t\t\t\tPhing::import($this->classname, $this->classpath);\n\t\t\t}\n\t\t\tcatch (BuildException $be) {\n\t\t\t\t/* Cannot import the file. */\n\t\t\t\tthrow new BuildException(sprintf('Object from class %s cannot be instantiated', $this->classname), $be);\n\t\t\t}\n\t\t\t\n\t\t\t$class = $this->classname;\n\t\t\t$this->instance = new $class();\n\t\t}\n\t\treturn $this->instance;\n\t}", "public function include_import_export(){\n\t\tglobal $import;\n\n\t\t// Load the Import class\n\t\trequire_once( trailingslashit( plugin_dir_path( __FILE__ ) ) . 'includes/class-import.php' );\n\t\t$import = new VisualFormBuilder_Pro_Import();\n\t}", "public function includes() {\n\n include_once( 'includes/mapti-core-functions.php' );\n include_once( 'includes/mapti-conditional-functions.php' );\n\n if ( is_admin() ) {\n include_once( 'includes/admin/class-mapti-admin.php' );\n }\n\n // Load template loader\n if ( ! is_admin() || defined( 'DOING_AJAX' ) ) {\n include_once( 'includes/myarcade_api.php' );\n include_once( 'includes/class-mapti-template-loader.php' );\n include_once( 'includes/class-mapti-frontend-scripts.php' );\n }\n\n // Query class\n $this->query = include( 'includes/class-mapti-query.php' );\n\n include_once( 'includes/class-mapti-post-types.php' );\n include_once( 'includes/mapti-template-functions.php' );\n }", "public static function getInstance(){\n\t\treturn parent::_getInstance(get_class());\n\t}", "public function __construct()\n {\n //\n // dd(Partial::where('template', 'footer')->first());\n }", "public function template_include() {\n\n\t\treturn locate_template( array( 'page.php', 'single.php', 'index.php' ) );\n\t}", "public function init(){\n\t\treturn $this;\n\t}", "public static function get_instance ();", "private static function getClient()\n\t{\n\t\tif (!self::$ipClient instanceof IpClient){\n\t\t\tself::$ipClient = new IpClient();\n\t\t};\n\t\treturn self::$ipClient;\n\t}", "public static function getInstance() : Loader{\n return self::$instance;\n }", "public static function getInstance()\n {\n if (!isset(self::$instance))\n {\n self::$instance = new ZtonepageAssets();\n }\n if (isset(self::$instance))\n {\n return self::$instance;\n }\n }", "public function __construct()\n {\n $this->fractal = new Manager();\n if (isset($_GET['include'])) {\n $this->fractal->parseIncludes($_GET['include']);\n }\n }", "function newsroom_elated_get_header() {\n $id = newsroom_elated_get_page_id();\n\n //will be read from options\n $header_type = 'header-type3';\n $header_behavior = newsroom_elated_options()->getOptionValue('header_behaviour');\n\n if(HeaderFactory::getInstance()->validHeaderObject()) {\n $parameters = array(\n 'hide_logo' => newsroom_elated_options()->getOptionValue('hide_logo') == 'yes' ? true : false,\n 'header_in_grid' => newsroom_elated_options()->getOptionValue('header_in_grid') == 'yes' ? true : false,\n 'logo_position' => newsroom_elated_get_meta_field_intersect('logo_position',$id),\n 'show_sticky' => in_array($header_behavior, array(\n 'sticky-header-on-scroll-up',\n 'sticky-header-on-scroll-down-up'\n )) ? true : false,\n );\n\n $parameters = apply_filters('newsroom_elated_header_type_parameters', $parameters, $header_type);\n\n HeaderFactory::getInstance()->getHeaderObject()->loadTemplate($parameters);\n }\n }", "public function __construct()\n {\n\n // $configuration = $this->get('configuration');\n\n\n }", "public function __construct()\n {\n if (!class_exists('XMLSecurityDSig')) {\n include __DIR__ . self::XMLSECLIBS_PATH;\n }\n }", "function __construct() {\n\n\t\tadd_filter( WpSolrFilters::WPSOLR_FILTER_INCLUDE_FILE, [ $this, 'wpsolr_filter_include_file' ], 10, 1 );\n\t}", "public function init()\n {\n return $this;\n }", "public function __construct()\n {\n set_include_path(get_include_path() . PATH_SEPARATOR . dirname(__FILE__));\n }", "public function _loadRealInstance() {}", "public static function init(){\n if( self::$loader == null ){\n self::$loader = new self();\n }\n return self::$loader;\n }", "public static function init() {\n\t\treturn Factory::get_instance( self::class );\n\t}", "public function _construct()\n {\n $this->_init('inwardproduct/inwardproduct', 'inwardproduct_id');\n }", "function includes() {\r\n\t\t\trequire_once( trailingslashit( RV_PORTFOLIO_DIR ) . 'inc/public/class-rv-portfolio-registration.php' );\r\n\t\t}", "public function get_settings_instance() {\n\n\t\tif ( ! $this->settings instanceof \\WC_PIP_Settings ) {\n\n\t\t\t// Include settings so we can install defaults\n\t\t\trequire_once( WC()->plugin_path() . '/includes/admin/settings/class-wc-settings-page.php' );\n\n\t\t\t$this->settings = $this->load_class( '/includes/admin/class-wc-pip-settings.php', 'WC_PIP_Settings' );\n\t\t}\n\n\t\treturn $this->settings;\n\t}", "public static function init()\n {\n ini_set('xdebug.default_enable', defined('WS_XDEBUG_ENABLED'));\n\n return self::autoload();\n }", "private function includes()\n\t\t{\n\t\t\trequire_once dirname( __FILE__ ) . '/sf-class-sanitize.php';\n\t\t\trequire_once dirname( __FILE__ ) . '/sf-class-format-options.php';\n\t\t\tnew SF_Sanitize;\n\t\t}", "public function getPlugin();", "public function getPlugin();", "static\tpublic \tfunction\tinit() {\n\t\t\t/**\n\t\t\t * Implement any processes that need to happen before the plugin is instantiated. \n\t\t\t */\n\t\t\t\n\t\t\t//Instantiate the plugin and return it. \n\t\t\treturn new self();\n\t\t}", "protected function get_object($filename)\n\t{\n\n\n\n\t\t$filename = trim($filename);\n\n\t\t# Get gateway path location\n\t\t$path_to_feature = $this->dir_path . '/' . $filename;\n\n\t\n\n\t\t# check\n\t\tif (is_file($path_to_feature))\n\t\t{\n\n\t\t\t#include the full path to file\n\t\t\tinclude_once $path_to_feature;\n\n\n\t\t\t$class_Name = ucfirst(str_replace('.php', '', $filename));\n\n\n\t\t\t//echo $LibraryObjectClass;die;\n\t\t\tif (class_exists($class_Name))\n\t\t\t{\n\t\t\t\t$lib_object = new $class_Name;\n\n\t\t\t\tif($lib_object->system_type == 'feature')\n\t\t\t\t\treturn $lib_object;\n\t\t\t}\n\n\t\t}\n\n\t\t#oops\n\t\treturn NULL;\n\t}", "public static function &getInstance(){\n\t\tstatic $instance;\n\n\t\tif( is_null($instance) ){\n\t\t\t$instance = new tsExtras();\n \t}\n\t\treturn $instance;\n\t}", "public function unsetIncludeDisabled(): self\n {\n $this->instance->unsetIncludeDisabled();\n return $this;\n }", "public static function instance();", "public function instance() {\n\t\n\t\treturn $this;\n\t\n\t}", "public function __construct()\r\n\t\t{\r\n\r\n\t\t\t$this->plugin = VIRAQUIZ_PLUGIN;\r\n\r\n\t\t}", "function DvInclude($payload, $templateName)\n{\n $serviceName = $payload['service_name'];\n $viewPath = config('devless')['views_directory'];\n\n include $viewPath.$serviceName.'/'.$templateName;\n}", "public function create() {\n\t\t$implementationClassName = 'Imagine\\\\' . $this->settings['driver'] . '\\Imagine';\n\t\treturn new $implementationClassName();\n\t}", "function get_network()\n{\n return new \\Podlove\\Modules\\Networks\\Template\\Network();\n}", "public static function i() {\n\t\treturn self::_getSingleton(__CLASS__);\n\t}", "public function load(){\n\t\treturn parent::load();\n\t}", "public function Setup(){\r\n return $this->setup;\r\n }", "public function __construct()\n {\n include_once(__DIR__.\"/Define.php\");\n }", "private function getExtractSections()\n {\n return array(\n '$extract = new Extract(__FILE__, Extract::findStubLength(__FILE__));',\n '$dir = $extract->go();',\n 'set_include_path($dir . PATH_SEPARATOR . get_include_path());',\n );\n }" ]
[ "0.65955436", "0.62430155", "0.61693245", "0.61099213", "0.5986096", "0.59068185", "0.5789555", "0.5756627", "0.56001437", "0.5599031", "0.54184437", "0.5359012", "0.53565735", "0.5231398", "0.51951313", "0.51926035", "0.5188672", "0.5166391", "0.5115129", "0.511217", "0.51055765", "0.50900877", "0.5075784", "0.50736576", "0.5071562", "0.5065421", "0.5058201", "0.50538594", "0.5050641", "0.501145", "0.5002042", "0.49825275", "0.49441218", "0.49401313", "0.4917487", "0.4917127", "0.49169603", "0.49162707", "0.49162707", "0.49162707", "0.49162707", "0.4908477", "0.49029654", "0.48955062", "0.48919022", "0.48859656", "0.48831525", "0.48801664", "0.48756993", "0.48598182", "0.4852052", "0.4841709", "0.4828484", "0.48260957", "0.48244753", "0.4821084", "0.48198006", "0.48173222", "0.4810929", "0.48106006", "0.48040527", "0.48016378", "0.4798578", "0.4797974", "0.47967768", "0.47958314", "0.4779444", "0.47729176", "0.47710013", "0.47653627", "0.47564045", "0.47470582", "0.4743205", "0.47431156", "0.47415245", "0.4741508", "0.47409713", "0.47408083", "0.47402823", "0.47402078", "0.4739592", "0.47372827", "0.47191864", "0.47076106", "0.47076106", "0.4707449", "0.47073933", "0.47056803", "0.47040096", "0.47007826", "0.46991932", "0.46970755", "0.46880612", "0.4687594", "0.46853334", "0.4680431", "0.46798635", "0.46780232", "0.467747", "0.46746063" ]
0.81075376
0
must be public 'cos parent construct is as well
public function __construct(){ parent::__construct(); $this->cfg_jsincdir=$this->getFileName($this->cfg_jsincdir); $this->cfg_jquerylink=$this->getFileName($this->cfg_jquerylink); $this->cfg_jquerylinkmin=$this->getFileName($this->cfg_jquerylinkmin); $this->cfg_jqueryuilink=$this->getFileName($this->cfg_jqueryuilink); $this->cfg_jqueryuicsslink=$this->getFileName($this->cfg_jqueryuicsslink); $this->cfg_dojolink=$this->getFileName($this->cfg_dojolink); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected abstract function __construct();", "function __construct(){parent::__construct();}", "private function __construct()\t{}", "public function __construct()\n\t{\n\t\tparent::__construct();\n\t\t// ben duoi nay se la cac logic cua __construct lop con ma chung ta can dinh nghia - xu ly\n\t}", "abstract protected function __construct();", "final private function __construct() {}", "final private function __construct() {}", "function _construct() {\n\t\tparent::_construct();\n\t}", "public function __construct(){\n\t\t/* calling parent construct */\n\t\tparent::__construct();\n\t}", "public function __construct(){\n\t\t/* calling parent construct */\n\t\tparent::__construct();\n\t}", "protected final function __construct() {}", "public function _construct()\n {\n parent::_construct();\n }", "public function __construct()\n {\n // Hide the parent arguments from the public signature\n parent::__construct();\n }", "protected function construct(){\n\n }", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "function __construct() {\r\n parent ::__construct();\r\n }", "private final function __construct() {}", "final private function __construct(){\r\r\n\t}", "function _construct() {\n \t\n\t\t\n\t}", "public function _construct(){\n parent::_construct();\n }", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "public function construct()\n\t\t{\n\t\t}", "public function __construct()\n {\n //to be extended by children\n }", "private function __construct () {}", "private function __construct()\r\n\t{\r\n\t\r\n\t}", "private function __construct() {\r\n\t\r\n\t}", "function __construct(){\n\t\t// nowt much...\n\t}" ]
[ "0.8011062", "0.79933345", "0.79668313", "0.7959566", "0.7958589", "0.7942583", "0.7942583", "0.793778", "0.7931646", "0.7931646", "0.7916451", "0.7904215", "0.78931427", "0.78901833", "0.78864115", "0.78864115", "0.78864115", "0.78864115", "0.78864115", "0.78864115", "0.78864115", "0.78864115", "0.78864115", "0.78864115", "0.78864115", "0.78864115", "0.78864115", "0.78864115", "0.78864115", "0.78864115", "0.78864115", "0.78837854", "0.78830254", "0.7858727", "0.7852702", "0.7846527", "0.78109926", "0.78109926", "0.78109926", "0.78109926", "0.78109926", "0.78109926", "0.78109926", "0.78109926", "0.78109926", "0.78109926", "0.78109926", "0.78109926", "0.78109926", "0.78109926", "0.78109926", "0.78109926", "0.78109926", "0.78109926", "0.78109926", "0.78109926", "0.78109926", "0.78109926", "0.78109926", "0.78109926", "0.78109926", "0.78109926", "0.78109926", "0.78109926", "0.78109926", "0.78109926", "0.78109926", "0.78109926", "0.78109926", "0.78109926", "0.78109926", "0.78109926", "0.78109926", "0.78109926", "0.78109926", "0.78109926", "0.78109926", "0.78109926", "0.78109926", "0.78109926", "0.78109926", "0.78109926", "0.78109926", "0.78109926", "0.78109926", "0.78109926", "0.78109926", "0.78109926", "0.78109926", "0.78109926", "0.78109926", "0.78109926", "0.7809738", "0.7809132", "0.7809132", "0.7807902", "0.7807702", "0.7804234", "0.78002334", "0.77994335", "0.7784538" ]
0.0
-1
Add a CSS link to the includer Shortcut for pinCSSLinkInclusion::make($file)>file($file) and adding result to pinIncluder Csslinkinclusions become always type 'csslink'
public function CSS($file,$hook=''){ $file=$this->getFileName($file); $incl=pinCSSLinkInclusion::make($file,$hook)->file($file); pinIncluder::i()->add($incl); return $incl; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function addCssInclude($file) {\n $this->cssIncludes[] = $file;\n }", "protected function addCSS() {\n foreach ($this->css_files as $css_file) {\n $this->header.=\"<link rel='stylesheet' href='\" . __ASSETS_PATH . \"/\" . $css_file . \"'/> \\n\";\n }\n }", "public function css_includes()\n {\n }", "function incluirCSS($arquivo){ ?>\n\t\t<link href=\"css/<?=$arquivo?>.css\" rel=\"stylesheet\" type=\"text/css\"/>\n\t<?php }", "public function enableConcatenateCss() {}", "function do_add_css(){\n\t\tglobal $jcf_included_assets;\n\t\t\n\t\tif( !empty($jcf_included_assets['styles'][get_class($this)]) )\n\t\t\treturn false;\n\t\t\n\t\tif( method_exists($this, 'add_css') ){\n\t\t\tadd_action( 'jcf_admin_edit_post_styles', array($this, 'add_css'), 10 );\n\t\t}\n\n\t\t$jcf_included_assets['styles'][get_class($this)] = 1;\n\t}", "public function insert_inline_css() {\n }", "public function insert_inline_css() {\n }", "public function insert_inline_css() {\n }", "public function insert_inline_css() {\n }", "public function insert_inline_css() {\n }", "function add_external_css($css_files, $path = NULL)\n {\n // make sure that $this->includes has array value\n if ( ! is_array( $this->includes ) )\n $this->includes = array();\n\n // if $css_files is string, then convert into array\n $css_files = is_array( $css_files ) ? $css_files : explode( \",\", $css_files );\n\n foreach( $css_files as $css )\n {\n // remove white space if any\n $css = trim( $css );\n\n // go to next when passing empty space\n if ( empty( $css ) ) continue;\n\n // using sha1( $css ) as a key to prevent duplicate css to be included\n $this->includes[ 'css_files' ][ sha1( $css ) ] = is_null( $path ) ? $css : $path . $css;\n }\n\n return $this;\n }", "function src_inc_css(string $file) : string {\n return \"<link rel='stylesheet' href='\".$file.\"'>\";\n}", "function queue_css_url($url, $media = 'all', $conditional = false)\n{\n get_view()->headLink()->appendStylesheet($url, $media, $conditional);\n}", "function add_css() \n {\n if( $this->options['use-css-file'] ) {\n wp_register_style( 'bbquotations-style' , $this->plugin_url . 'bbquotations-style.css');\n wp_enqueue_style( 'bbquotations-style' );\n } \n }", "function includeCss($fileName) {\n $data = '<link type=\"text/css\" rel=\"Stylesheet\" href=\"'.BASE_PATH.'/public/css/'.$fileName.'.css\" />';\n return $data;\n }", "private function _include_css($file) {\n\t\treturn $this->EE->elements->_include_css($file);\n\t}", "function min_css($files, $link = '') {\n $CI = & get_instance(); //get instance, access the CI superobject\n $CI->load->driver('minify');\n $result = '';\n if (isset($files) && count($files) > 0) {\n if ($CI->config->item('COMPRESS_OVERRIDE')) {\n if ($CI->config->item('COMPRESS_CSS')) {\n $jss = $CI->minify->combine_files($files, \"css\", TRUE);\n $CI->minify->save_file($jss, $link);\n $result = '<link type=\"text/css\" rel=\"stylesheet\" href=\"' . base_url() . $link . '?v=' . uniqid() . '\" async defer />';\n } else {\n $result = link_tag_html($files);\n }\n } else {\n $result = '<link type=\"text/css\" rel=\"stylesheet\" href=\"' . base_url() . $link . '?v=' . uniqid() . '\" async defer />';\n }\n }\n return $result;\n }", "protected function doConcatenateCss() {}", "public function css() {\r\n\t\tif ($this->cssLink != false) {\r\n\t\t\tif($this->scriptTo) {\r\n\t\t\t\t$elem = pzk_element($this->scriptTo);\r\n\t\t\t\t$elem->append(pzk_parse('<html.css src=\"'.BASE_REQUEST.'/default/skin/'.pzk_app()->name.'/css/'.$this->cssLink.'.css\" />'));\r\n\t\t\t} else {\r\n\t\t\t\tif($page = pzk_page())\r\n\t\t\t\t\t$page->addObjCss($this->cssLink);\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t\tif ($this->cssExternalLink != false) {\r\n\t\t\tif($this->scriptTo) {\r\n\t\t\t\t$elem = pzk_element($this->scriptTo);\r\n\t\t\t\t$elem->append(pzk_parse('<html.css src=\"'.$this->cssExternalLink.'\" />'));\r\n\t\t\t} else {\r\n\t\t\t\tif($page = pzk_page()) {\r\n\t\t\t\t\t$page->addExternalCss($this->cssExternalLink);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t}", "public function INCLUDE_CSS(array $conf) {\n if($conf && count($conf)) {\n foreach ($conf as $key => $CSSfile) {\n $cssFileConfig = &$conf[$key . '.'];\n if (isset($cssFileConfig['if.']) && !$GLOBALS['TSFE']->cObj->checkIf($cssFileConfig['if.'])) {\n continue;\n }\n $ss = $cssFileConfig['external'] ? $CSSfile : $GLOBALS['TSFE']->tmpl->getFileName($CSSfile);\n if ($ss) {\n if ($cssFileConfig['import']) {\n if (!$cssFileConfig['external'] && $ss[0] !== '/') {\n // To fix MSIE 6 that cannot handle these as relative paths (according to Ben v Ende)\n $ss = TYPO3\\CMS\\Core\\Utility\\GeneralUtility::dirname(GeneralUtility::getIndpEnv('SCRIPT_NAME')) . '/' . $ss;\n }\n $this->pageRenderer->addCssInlineBlock('import_' . $key, '@import url(\"' . htmlspecialchars($ss) . '\") ' . htmlspecialchars($cssFileConfig['media']) . ';', empty($cssFileConfig['disableCompression']), $cssFileConfig['forceOnTop'] ? TRUE : FALSE, '');\n } else {\n $this->pageRenderer->addCssFile(\n $ss,\n $cssFileConfig['alternate'] ? 'alternate stylesheet' : 'stylesheet',\n $cssFileConfig['media'] ?: 'all',\n $cssFileConfig['title'] ?: '',\n empty($cssFileConfig['disableCompression']),\n $cssFileConfig['forceOnTop'] ? TRUE : FALSE,\n $cssFileConfig['allWrap'],\n $cssFileConfig['excludeFromConcatenation'] ? TRUE : FALSE,\n $cssFileConfig['allWrap.']['splitChar']\n );\n unset($cssFileConfig);\n }\n }\n }\n }\n }", "function include_css( $strfilename, $params=NULL ){ \n\treturn CIncludeFiles :: includefiles( \"CIncludeCSSFiles\", $strfilename, $params );\t\n}", "private function addCSS()\n {\n Filters::add('head', array($this, 'renderRevisionsCSS'));\n }", "private function decideIncludeCSS(){\n //if user don´t want to use our css\n $noCSS = $GLOBALS['TSFE']->tmpl->setup['plugin.']['tx_libconnect.']['settings.']['ezbNoCSS'];\n\n if($noCSS == 1){\n return;\n }\n\n //get UID of PlugIn\n $this->contentObj = $this->configurationManager->getContentObject();\n $uid = $this->contentObj->data['uid'];\n unset($this->contentObj);\n\n //only the first PlugIn needs to include the css\n if(IsfirstPlugInUserFunction('ezb', $uid)){\n $this->response->addAdditionalHeaderData('<link rel=\"stylesheet\" href=\"' . t3lib_extMgm::siteRelPath('libconnect') . 'Resources/Public/Styles/ezb.css\" />'); \n }\n }", "public function addCssInclude($cssfiles)\n\t{\n\t\tif(!is_array($cssfiles))\n\t\t\t$cssfiles = array($cssfiles);\n\n\t\tforeach($cssfiles as $file)\n\t\t{\n\t\t\tif(!in_array($file, $this->cssIncludes))\n\t\t\t\t$this->cssIncludes[] = '<link href=\"' . $file . '\" rel=\"stylesheet\" type=\"text/css\"/>';\n \t\t}\n\t}", "private function _replace_inline_css()\n\t{\n\t\t// preg_match_all( '/url\\s*\\(\\s*(?![\"\\']?data:)(?![\\'|\\\"]?[\\#|\\%|])([^)]+)\\s*\\)([^;},\\s]*)/i', $this->content, $matches ) ;\n\n\t\t/**\n\t\t * Excludes `\\` from URL matching\n\t\t * @see #959152 - Wordpress LSCache CDN Mapping causing malformed URLS\n\t\t * @see #685485\n\t\t * @since 3.0\n\t\t */\n\t\tpreg_match_all( '#url\\((?![\\'\"]?data)[\\'\"]?([^\\)\\'\"\\\\\\]+)[\\'\"]?\\)#i', $this->content, $matches ) ;\n\t\tforeach ( $matches[ 1 ] as $k => $url ) {\n\t\t\t$url = str_replace( array( ' ', '\\t', '\\n', '\\r', '\\0', '\\x0B', '\"', \"'\", '&quot;', '&#039;' ), '', $url ) ;\n\n\t\t\tif ( ! $url2 = $this->rewrite( $url, LiteSpeed_Cache_Config::ITEM_CDN_MAPPING_INC_IMG ) ) {\n\t\t\t\tcontinue ;\n\t\t\t}\n\t\t\t$attr = str_replace( $matches[ 1 ][ $k ], $url2, $matches[ 0 ][ $k ] ) ;\n\t\t\t$this->content = str_replace( $matches[ 0 ][ $k ], $attr, $this->content ) ;\n\t\t}\n\t}", "public function appendCssUrl($url) {\n $this->appendToHead(<<<HTML\n <link rel=\"stylesheet\" type=\"text/css\" href=\"{$url}\">\nHTML\n) ;\n }", "function ju_link_inline(...$a) {return ju_call_a(function(string $res):string {return ju_resource_inline(\n\t$res, function(string $url):string {return ju_tag(\n\t\t'link', ['href' => $url, 'rel' => 'stylesheet', 'type' => 'text/css'], '', false\n\t);}\n\t# 2023-01-06 $a is always an array here: https://3v4l.org/K6FVO\n);}, $a);}", "public function addCSSFiles($css /* array */);", "public function testIncludingFilesRemovesFromQueue() {\n\t\t$this->Helper->addCss('libraries', 'default');\n\t\t$result = $this->Helper->includeCss('default');\n\t\t$expected = array(\n\t\t\t'link' => array(\n\t\t\t\t'type' => 'text/css',\n\t\t\t\t'rel' => 'stylesheet',\n\t\t\t\t'href' => '/cache_css/default.css?file%5B0%5D=libraries'\n\t\t\t)\n\t\t);\n\t\t$this->assertTags($result, $expected);\n\n\t\t$result = $this->Helper->includeCss('default');\n\t\t$this->assertEquals('', $result);\n\t}", "public function JS($file,$hook=''){\n \n $file=$this->getFileName($file);\n \n $incl=pinJavaScriptLinkInclusion::make($file,$hook)->file($file);\n pinIncluder::i()->add($incl);\n return $incl; \n }", "function add_style($name, $file)\n{\n\tglobal $styles_included;\n\t$styles_included[$name] = \"<link rel=\\\"stylesheet\\\" type=\\\"text/css\\\" href=\\\"\".site_url.$file.\"\\\"/>\\n\";\n}", "public function addStyleSheet($link)\r\n {\r\n $this->stylesheets = array_merge($this->stylesheets, array_filter((array) $link));\r\n\r\n return $this;\r\n }", "function add_css_js()\n\t{\n\t\tif (!defined('CSS_JS_PARSED'))\n\t\t{\n\t\t\tdefine('CSS_JS_PARSED', true);\n\t\t}\n\n\t\t// Include custom CSS from templates/CURRENT_TPL folder\n\t\tif(is_array($this->css_style_include) && !empty($this->css_style_include))\n\t\t{\n\t\t\tfor ($i = 0; $i < sizeof($this->css_style_include); $i++)\n\t\t\t{\n\t\t\t\t$this->assign_block_vars('css_style_include', array(\n\t\t\t\t\t'CSS_FILE' => $this->css_style_include[$i],\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\t// Include custom CSS from templates/common folder\n\t\tif(is_array($this->css_include) && !empty($this->css_include))\n\t\t{\n\t\t\tfor ($i = 0; $i < sizeof($this->css_include); $i++)\n\t\t\t{\n\t\t\t\t$this->assign_block_vars('css_include', array(\n\t\t\t\t\t'CSS_FILE' => $this->css_include[$i],\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\t// Include custom JS from templates/common folder\n\t\tif(is_array($this->js_include) && !empty($this->js_include))\n\t\t{\n\t\t\tfor ($i = 0; $i < sizeof($this->js_include); $i++)\n\t\t\t{\n\t\t\t\t$this->assign_block_vars('js_include', array(\n\t\t\t\t\t'JS_FILE' => $this->js_include[$i],\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}", "public function add_css($file)\n {\n $this->add(\"css\", $file);\n }", "function App_CSS_Add()\n {\n array_push($this->MyApp_Interface_Head_CSS_OnLine,\"CSS/sivent2.css\");\n }", "public function testCssLinkBC() {\n\t\tConfigure::write('Asset.filter.css', false);\n\n\t\tCakePlugin::load('TestPlugin');\n\t\t$result = $this->Html->css('TestPlugin.style', null, array('plugin' => false));\n\t\t$expected = array(\n\t\t\t'link' => array(\n\t\t\t\t'rel' => 'stylesheet',\n\t\t\t\t'type' => 'text/css',\n\t\t\t\t'href' => 'preg:/.*css\\/TestPlugin\\.style\\.css/'\n\t\t\t)\n\t\t);\n\t\t$this->assertTags($result, $expected);\n\t\tCakePlugin::unload('TestPlugin');\n\n\t\t$result = $this->Html->css('screen', 'import');\n\t\t$expected = array(\n\t\t\t'style' => array('type' => 'text/css'),\n\t\t\t'preg:/@import url\\(.*css\\/screen\\.css\\);/',\n\t\t\t'/style'\n\t\t);\n\t\t$this->assertTags($result, $expected);\n\n\t\t$result = $this->Html->css('css_in_head', null, array('inline' => false));\n\t\t$this->assertNull($result);\n\n\t\t$result = $this->Html->css('more_css_in_head', null, array('inline' => false));\n\t\t$this->assertNull($result);\n\t}", "public function addCSS($href)\n {\n $this->css .= \"<link href=$href rel='stylesheet' />\";\n }", "function add_css($acss=array()) {\n\t\tforeach ($acss as $css) {\n\t\t\tif (isset($css[\"path\"]) && $css[\"path\"]!=\"\") {\n\t\t\t\t$priority = 0;\n\t\t\t\tif (isset($css[\"priority\"])) {\n\t\t\t\t\t$priority = $css[\"priority\"];\n\t\t\t\t}\n\t\t\t\t$condition = \"\";\n\t\t\t\tif (isset($css[\"condition\"])) {\n\t\t\t\t\t$condition = $css[\"condition\"];\n\t\t\t\t}\n\t\t\t\t$is_local = true;\n\t\t\t\tif (isset($css[\"is_local\"])) {\n\t\t\t\t\t$is_local = $css[\"is_local\"];\n\t\t\t\t}\n\t\t\t\t$this->custom_css[] = array(\"css\" => $css[\"path\"], \"priority\" => $priority, \"condition\" => $condition, \"is_local\" => $is_local);\n\t\t\t}\n\t\t}\n\t}", "public function testInlineCssMultiple() {\n\t\t$config = $this->Helper->config();\n\t\t$config->paths('css', null, array(\n\t\t\t$this->_testFiles . 'css' . DS\n\t\t));\n\n\t\t$config->addTarget('nav.css', array(\n\t\t\t'files' => array('nav.css', 'has_import.css')\n\t\t));\n\n\t\tConfigure::write('debug', 0);\n\n\t\t$expected = <<<EOF\n<style type=\"text/css\">@import url(\"reset/reset.css\");\n#nav {\n\twidth:100%;\n}\n\n@import \"nav.css\";\n@import \"theme:theme.css\";\nbody {\n\tcolor:#f00;\n\tbackground:#000;\n}</style>\nEOF;\n\n\t\t$result = $this->Helper->inlineCss('nav.css');\n\t\t$this->assertEquals($expected, $result);\n\t}", "public function kiwip_stylesheet_add_file(){\n\t\t//register\n\t\tforeach($this->stylesheet as $key){\n\t\t\twp_register_style('kiwip_shortcode-css-'.$key['stylesheetId'], $key['stylesheetURL']);\n\t\t}\n\t\t\n\t\t//load\n\t\tforeach($this->stylesheet as $eky){\n\t\t\twp_enqueue_style('kiwip_shortcode-css-'.$key['stylesheetId']);\n\t\t}\t\t\n\n\t\t// $this->debug($this->stylesheet); die();\n\t}", "public function registerCSSFile( $file )\n {\n $this->headCSSFiles[] = $file;\n \n # Return object to preserve method-chaining:\n return $this;\n }", "function add_css($css, $append_path = TRUE)\r\n\t{\r\n\t $css = $this->append_ext($css, 'css', $append_path);\r\n\t \r\n\t if ( ! is_array($css)) \r\n\t {\r\n\t /* Assume its a string */\r\n\t $this->css_includes[] = $css;\r\n\t }\r\n\t else \r\n\t {\r\n\t $this->css_includes += $css;\r\n\t }\r\n\t \r\n\t return $this;\r\n\t}", "function addCSSFiles()\n\t{\n\t\t$this->getContainer()->AddCSSFile(\"include/zoombox/zoombox.css\");\n\t}", "public function testIncludeCssMultipleDestination() {\n\t\t$this->Helper->addCss('libraries', 'default');\n\t\t$this->Helper->addCss('thing', 'second');\n\t\t$this->Helper->addCss('other', 'third');\n\n\t\t$result = $this->Helper->includeCss('second', 'default');\n\t\t$expected = array(\n\t\t\tarray('link' => array(\n\t\t\t\t'type' => 'text/css',\n\t\t\t\t'rel' => 'stylesheet',\n\t\t\t\t'href' => '/cache_css/second.css?file%5B0%5D=thing'\n\t\t\t)),\n\t\t\tarray('link' => array(\n\t\t\t\t'type' => 'text/css',\n\t\t\t\t'rel' => 'stylesheet',\n\t\t\t\t'href' => '/cache_css/default.css?file%5B0%5D=libraries'\n\t\t\t)),\n\t\t);\n\t\t$this->assertTags($result, $expected);\n\t}", "public function addCssFile($name)\n {\n $this->fileStyles[] = $name;\n }", "public function css ($file, $remove = false) {\n if ($remove) {\n if (is_array($file)) {\n foreach ($file as $k=>$v) {\n unset($this->css_files[$v]);\n }\n } else {\n unset($this->css_files[$file]);\n }\n } else {\n if (is_array($file)) {\n foreach ($file as $k=>$v) {\n $this->css_files = array_merge($this->css_files, array($v => $v));\n }\n } else {\n $this->css_files = array_merge($this->css_files, array($file => $file));\n }\n }\n return $this;\n }", "public function enqueue_additional_css_file() {\n\t\tif (is_page() || is_single()) {\n\t\t\twhile (have_posts()) {\n\t\t\t\tthe_post();\n\t\t\t\t$additional_css_file = get_post_meta(get_the_ID(), 'im8_additional_css_file', true);\n\t\t\t\t$path = get_stylesheet_directory().'/css/'.$additional_css_file;\n\t\t\t\t$url = get_stylesheet_directory_uri().'/css/'.$additional_css_file;\n\t\t\t\tif ($additional_css_file && file_exists($path))\n\t\t\t\t\twp_enqueue_style('im8_additional_css_file', $url, array(), filemtime($path), 'screen, projection');\n\t\t\t}\n\t\t\trewind_posts();\n\t\t}\n\t}", "public function addCSS($strFile, $strMedia = \"all\") {\n\t\t\t$strFile = fixPath($strFile); \n\t\t\tif (!isset($this->arCSS[$strFile])) $this->arCSS[$strFile] = array(\n\t\t\t\t\"media\" => $strMedia, \n\t\t\t); \n\t\t}", "public function getConcatenateCss() {}", "public function disableConcatenateCss() {}", "function queue_css_file($file, $media = 'all', $conditional = false, $dir = 'css', $version = OMEKA_VERSION)\n{\n if (is_array($file)) {\n foreach ($file as $singleFile) {\n queue_css_file($singleFile, $media, $conditional, $dir, $version);\n }\n return;\n }\n queue_css_url(css_src($file, $dir, $version), $media, $conditional);\n}", "public function ajouterCSS($fichierCSS) {\r\n $chemin = 'styles/';\r\n $suffixe = '.css';\r\n $cssfile=$chemin . $fichierCSS . $suffixe;\r\n if(!is_readable($cssfile)) die(\"ERROR $cssfile inexistant\");\r\n \r\n array_push($this->css, $cssfile);\r\n }", "static function emAddCssFile($cssPath, $media=\"all\", $levelStr=\"\") {\n\t$timestamp = filemtime( __DIR__ . \"/\" . $cssPath );\n self::$emHeader_line[] = \"<link rel='stylesheet' type='text/css' media='{$media}' href='{$levelStr}{$cssPath}?v={$timestamp}'>\";\n}", "public function addCSS($uri)\n {\n array_push($this->css, \\URL::to($uri));\n }", "public function addCss($file)\n\t{\n\t\t$this->_themeExtras['css'][] = array('file' => $file);\n\t}", "public function addCSS($css) {\r\n\t\t\t$this->css.= \"<link rel='stylesheet' type='text/css' href='$css.css' >\";\r\n\t\t}", "function css_add(){\n\t\t\tif($_GET['csv']==true) : \t\t\t\n\t\t\t\t$url = dirname(__FILE__) ;\n\t\t\t\tpreg_match('/\\/wp-content.+$/',$url,$c);\n\t\t\t\t$link = get_option('home').$c[0].'/css/style.css';\t\t\t\t\t\n\t\t\t\techo \"<link rel='stylesheet' href='$link' media='all' type='text/css' />\" ;\n\t\t\tendif;\n\t\t\t\n\t\t}", "public function testInlineCss() {\n\t\t$config = $this->Helper->config();\n\t\t$config->paths('css', null, array(\n\t\t\t$this->_testFiles . 'css' . DS\n\t\t));\n\n\t\t$config->addTarget('nav.css', array(\n\t\t\t'files' => array('nav.css')\n\t\t));\n\n\t\tConfigure::write('debug', 0);\n\n\t\t$expected = <<<EOF\n<style type=\"text/css\">@import url(\"reset/reset.css\");\n#nav {\n\twidth:100%;\n}</style>\nEOF;\n\n\t\t$result = $this->Helper->inlineCss('nav.css');\n\t\t$this->assertEquals($expected, $result);\n\t}", "public function addCss($fileAsset)\n {\n if (!$fileAsset instanceof FileAssetInterface) {\n $fileAsset = $this->setupAsset(new Stylesheet(), $fileAsset, func_get_args());\n }\n $fileAsset->setFileName($this->getAssetPath($fileAsset->getFileName()));\n $this->getApp()['asset.queue.file']->add($fileAsset);\n }", "private function _addCss() {\r\n JHtml::styleSheet( Sh404sefHelperGeneral::getComponentUrl() . '/assets/css/list.css');\r\n }", "function df_link_inline(...$a) {return df_call_a(function(string $res):string {return df_resource_inline(\n\t$res, function(string $url):string {return df_tag(\n\t\t'link', ['href' => $url, 'rel' => 'stylesheet', 'type' => 'text/css'], '', false\n\t);}\n\t# 2023-01-06 $a is always an array here: https://3v4l.org/K6FVO\n);}, $a);}", "function modify_included_refs() {\n global $wp_styles;\n global $wp_scripts;\n\n // Remove registered\n $unregister = Array(\n 'script' => Array(\n 'jquery-core',\n 'jquery-migrate',\n 'modernizr',\n 'hyphenate',\n 'nb-no',\n 'minified.javascript',\n 'klageguide-scroll',\n 'html5blankscripts',\n 'table_script',\n 'link_script',\n 'menu_script',\n 'search_script',\n 'feedback-form-js',\n 'fbr',\n\n 'opensearchserver'\n ),\n 'style' => Array(\n 'minified.stylesheet',\n 'default',\n 'ie-rules',\n 'awesomefont',\n 'feedback-form-css',\n\n 'opensearchserver-style'\n )\n );\n\n foreach ( $unregister as $fn => $i ) {\n call_user_func_array(\"wp_dequeue_$fn\", Array($i));\n call_user_func_array(\"wp_deregister_$fn\", Array($i));\n }\n\n\n // Add new\n wp_enqueue_script('minified.javascript', get_template_directory_uri() . '/assets/main.min.js', Array(), '', true);\n wp_enqueue_style('minified.stylesheet', get_template_directory_uri() . '/assets/main.min.css');\n wp_enqueue_style( 'ie-rules', get_template_directory_uri() . '/styles/css/ie.css', array(), '1.0', 'all');\n $wp_styles->add_data( 'ie-rules', 'conditional', 'IE' );\n}", "public function compile() {\n try {\n $dest = $this->paths->get('css.out');\n $compile = $this->frequency;\n\n $changed = (bool)$this->isCssUpdated();\n\n JLog::add('CSS cache changed: '.((bool)$changed ? 'true' : 'false'), JLog::DEBUG, self::LOGGER);\n\n $changed = (bool)(($compile == 2) || ($compile == 1 && $changed));\n\n $doCompile = (!JFile::exists($dest) || $changed);\n\n JLog::add('Force CSS compilation: '.($compile == 2 ? 'true' : 'false'), JLog::DEBUG, self::LOGGER);\n JLog::add('CSS file exists: '.((bool)JFile::exists($dest) ? 'true' : 'false'), JLog::DEBUG, self::LOGGER);\n JLog::add('Compiling CSS: '.((bool)$doCompile ? 'true' : 'false'), JLog::DEBUG, self::LOGGER);\n\n if ($doCompile) {\n if ($this->compiler == 'less') {\n $generateSourceMap = $this->params->get('generate_css_sourcemap', false);\n\n JLog::add('Generate CSS sourcemap: '.((bool)$generateSourceMap ? 'true' : 'false'), JLog::DEBUG, self::LOGGER);\n\n $options = array('compress'=>true);\n\n $cssSourceMapUri = str_replace(JPATH_ROOT, JURI::base(), $this->paths->get('css.sourcemap'));\n\n // Build source map with minified code.\n if ($this->params->get('generate_css_sourcemap', false)) {\n $options['sourceMap'] = true;\n $options['sourceMapWriteTo'] = $this->paths->get('css.sourcemap');\n $options['sourceMapURL'] = $cssSourceMapUri;\n $options['sourceMapBasepath'] = JPATH_ROOT;\n $options['sourceMapRootpath'] = JUri::base();\n } else {\n JFile::delete($this->paths->get('css.sourcemap'));\n }\n\n $less = new Less_Parser($options);\n $less->parseFile($this->paths->get('css.in'), JUri::base());\n $css = $less->getCss();\n $files = $less->allParsedFiles();\n } else {\n $formatter = \"Leafo\\ScssPhp\\Formatter\\\\\".$this->formatting;\n $this->cache->store($this->formatting, self::CACHEKEY.'.scss.formatter');\n\n $scss = new Compiler();\n $scss->setFormatter($formatter);\n $css = $scss->compile('@import \"'.$this->paths->get('css.in').'\";');\n\n $files = array_keys($scss->getParsedFiles());\n }\n\n JLog::add('Writing CSS to: '.$dest, JLog::DEBUG, self::LOGGER);\n JFile::write($dest, $css);\n\n // update cache.\n $this->updateCache(self::CACHEKEY.'.files.css', $files);\n $this->cache->store($this->compiler, self::CACHEKEY.'.compiler');\n }\n } catch (Exception $e) {\n JLog::add($e->getMessage(), JLog::ERROR, self::LOGGER);\n return false;\n }\n }", "public function control_panel__add_to_head()\n\t{\n\t\tif ( URL::getCurrent(false) == '/publish' ) {\n\t\t\treturn $this->css->link('fileclerk.css');\n\t\t}\n\t}", "protected function getSubCssFile(): void\n {\n preg_match_all(self::REGEX_CSS_IMPORT_FORMAT, $this->sContents, $aHit, PREG_PATTERN_ORDER);\n\n for ($i = 0, $iCountHit = count($aHit[0]); $i < $iCountHit; $i++) {\n $this->sContents = str_replace($aHit[0][$i], '', $this->sContents);\n $this->sContents .= File::EOL . $this->oFile->getUrlContents($aHit[1][$i] . $aHit[2][$i]);\n }\n }", "public function showCss()\n {\n $addon_css = $this->css->url('pagelinks.css');\n $output = '<link rel=\"stylesheet\" href=\"' . $addon_css . '\">';\n $output .= '<link rel=\"stylesheet\" href=\"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.6.3/css/font-awesome.min.css\">';\n\n return $output;\n\n }", "public function beforeOutput() {\n if (!($this->response instanceof jResponseHtml))\n return;\n global $gJConfig;\n\n $compileFlag = STYLUS_ASSETIC_COMPILE_ONCHANGE;\n if( isset($gJConfig->jResponseHtml['stylusAssetic_compile']) ) {\n switch($gJConfig->jResponseHtml['stylusAssetic_compile']) {\n case 'always':\n $compileFlag = STYLUS_ASSETIC_COMPILE_ALWAYS;\n break;\n case 'onchange':\n $compileFlag = STYLUS_ASSETIC_COMPILE_ONCHANGE;\n break;\n case 'once':\n $compileFlag = STYLUS_ASSETIC_COMPILE_ONCE;\n break;\n }\n }\n\n $nodeBinPath = '/usr/bin/node';\n if(isset($gJConfig->jResponseHtml['stylusAssectic_node_bin_path']) && $gJConfig->jResponseHtml['stylusAssectic_node_bin_path'] != '') {\n $nodeBinPath = $gJConfig->jResponseHtml['stylusAssectic_node_bin_path'];\n }\n\n $nodePaths = array();\n if(isset($gJConfig->jResponseHtml['stylusAssectic_node_paths']) && $gJConfig->jResponseHtml['stylus_node_paths'] != '') {\n $nodePaths = explode(',', $gJConfig->jResponseHtml['stylus_node_paths']);\n }\n\n $inputCSSLinks = $this->response->getCSSLinks();\n $outputCSSLinks = array();\n\n foreach( $inputCSSLinks as $inputCSSLinkUrl=>$CSSLinkParams ) {\n $CSSLinkUrl = $inputCSSLinkUrl;\n if( isset($CSSLinkParams['stylus']) ) {\n if( $CSSLinkParams['stylus'] ) {\n //we suppose url starts with basepath. Other cases should not have a \"'stylus' => true\" param ...\n if( substr($CSSLinkUrl, 0, strlen($gJConfig->urlengine['basePath'])) != $gJConfig->urlengine['basePath'] ) {\n throw new Exception(\"File $CSSLinkUrl seems not to be located in your basePath : it can not be processed with Assetic's StylusFilter\");\n } else {\n $filePath = jApp::wwwPath() . substr($CSSLinkUrl, strlen($gJConfig->urlengine['basePath']));\n\n $outputSuffix = '';\n if( substr($filePath, -5) != '.styl' ) {\n //append .styl at the end of filename if it is not already the case ...\n $outputSuffix .= '.styl';\n }\n $outputSuffix .= '.css';\n $outputPath = $filePath.$outputSuffix;\n\n $compile = true;\n if( is_file($outputPath) ) {\n if( ($compileFlag == STYLUS_ASSETIC_COMPILE_ALWAYS) ) {\n unlink($outputPath);\n } elseif( ($compileFlag == STYLUS_ASSETIC_COMPILE_ONCE) ) {\n $compile = false;\n } elseif( ($compileFlag == STYLUS_ASSETIC_COMPILE_ONCHANGE) && filemtime($filePath) <= filemtime($outputPath) ) {\n $compile = false;\n }\n }\n if( $compile ) {\n $css = new AssetCollection(array(\n new FileAsset($filePath, array(new StylusFilter($nodeBinPath, $nodePaths)))\n ));\n\n file_put_contents( $outputPath, $css->dump() );\n }\n $CSSLinkUrl = $CSSLinkUrl . $outputSuffix;\n }\n }\n unset($CSSLinkParams['stylus']);\n }\n\n $outputCSSLinks[$CSSLinkUrl] = $CSSLinkParams;\n }\n\n $this->response->setCSSLinks( $outputCSSLinks );\n }", "function ft_hook_add_css() {}", "function addHeaderCode() {\r\n echo '<link type=\"text/css\" rel=\"stylesheet\" href=\"' . plugins_url('css/bn-auto-join-group.css', __FILE__).'\" />' . \"\\n\";\r\n}", "public static function enteteCSS() {\r\n foreach (Page::getInstance()->css as $link) {\r\n ?>\r\n <link type=\"text/css\" rel=\"stylesheet\" href=\"<?php echo $link; ?>\" />\r\n <?php\r\n }\r\n }", "function cdn_html_alter_css_urls(&$html) {\n $url_prefix_regex = _cdn_generate_url_prefix_regex();\n $pattern = \"#href=\\\"(($url_prefix_regex)(.*?\\.css)(\\?.*)?)\\\"#\";\n _cdn_html_alter_file_url($html, $pattern, 0, 3, 4, 'href=\"', '\"'); \n}", "public function includeCSS($strUri) {\n\n\t\t$this->response->includeCSS($strUri);\n\t}", "public function addIncludes($param)\n\t{\n\t\tif(is_array($param))\n\t\t{\n\t\t\tforeach($param as $p)\n\t\t\t{\n\t\t\t\tarray_push($this->needed_css_include, $p);\n\t\t\t}\n\n\t\t} else {\n\t\t\tarray_push($this->needed_css_include, $param); \n\t\t}\n\t}", "public function css()\n {\n $dir = new \\Ninja\\Directory(NINJA_DOCROOT . 'public/');\n /**\n * @var $files \\Ninja\\File[]\n */\n $files = $dir->scanRecursive(\"*.css\");\n\n echo \"\\nMinifying Css Files...\\n\";\n foreach($files as $sourceFile)\n {\n // Skip all foo.#.js (e.g foo.52.js) which are files from a previous build\n if (is_numeric(substr($sourceFile->getName(true), strrpos($sourceFile->getName(true), '.') + 1)))\n continue;\n\n /**\n * @var $destFile \\Ninja\\File\n */\n $destFile = $sourceFile->getParent()->ensureFile($sourceFile->getName(true) . '.' . self::REVISION . '.' . $sourceFile->getExtension());\n\n $destFile->write(\\Minify_Css::process($sourceFile->read()));\n echo ' ' . $sourceFile->getPath() . \"\\n\";\n\n unset($sourceFile);\n }\n }", "protected function compileCss() {\r\n\t\tif(count($this->source_files) == 0) {\r\n\t\t\tfile_put_contents($this->result_file, \"\", FILE_APPEND);\r\n\t\t} else {\r\n\t\t\tforeach($this->source_files as $src_file) {\r\n\t\t\t\tfile_put_contents($this->result_file, file_get_contents($src_file) . PHP_EOL, FILE_APPEND);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "static function css($href) {\n\t\tif (is_array($href)) {\n\t\t\t$return = '';\n\t\t\tforeach ($href as $h) $return .= self::css($h);\n\t\t\treturn $return;\n\t\t} else {\n\t\t\t//see if shortcut exists\n\t\t\t$shortcuts = config::get('css.shortcuts');\n\t\t\tif (array_key_exists($href, $shortcuts)) $href = $shortcuts[$href];\n\t\t\treturn self::tag('link', array('rel'=>'stylesheet', 'href'=>$href));\n\t\t}\n\t}", "public function add_css($css) {\n $current = $this->dwoo_data->css_files;\n $current[] = $css;\n $this->dwoo_data->css_files = $current;\n }", "private function includeCss( $css ) {\n if( Director::fileExists($file = project() . '/themes/' . SSViewer::current_theme() . '/css/' . $css) ) {\n Requirements::css($file);\n\n }\n elseif( Director::fileExists($file = project() . '/css/' . $css) ) {\n Requirements::css($file);\n }\n else {\n Requirements::css(ssdropdownmenu . '/css/' . $css);\n }\n }", "public function addCustomStyle($file){\n array_push($this->_customStyles,$file);\n }", "public static function combine_css($files,$outputdir = 'static/generated/')\n {\n if(\\HMC\\Config::SITE_ENVIRONMENT() == 'development') {\n Assets::css($files);\n return;\n }\n $ofiles = (is_array($files) ? $files : array($files));\n $hashFileName = md5(join($ofiles));\n $dirty = false;\n\n if(file_exists($outputdir.$hashFileName.'.css')) {\n $hfntime = filemtime($outputdir.$hashFileName.'.css');\n foreach($ofiles as $vfile) {\n $file = str_replace(\\HMC\\Config::SITE_URL(),\\HMC\\Config::SITE_PATH(),$vfile);\n if(!$dirty){\n $fmtime = filemtime($file);\n if($fmtime > $hfntime) {\n $dirty = true;\n }\n }\n }\n } else {\n $dirty = true;\n }\n if($dirty) {\n $buffer = \"\";\n foreach ($ofiles as $vfile) {\n $cssFile = str_replace(\\HMC\\Config::SITE_URL(),\\HMC\\Config::SITE_PATH(),$vfile);\n $buffer .= \"\\n\".file_get_contents($cssFile);\n }\n\n // Remove comments\n $buffer = preg_replace('!/\\*[^*]*\\*+([^/][^*]*\\*+)*/!', '', $buffer);\n\n // Remove space after colons\n $buffer = str_replace(': ', ':', $buffer);\n\n // Remove whitespace\n $buffer = str_replace(array(\"\\r\\n\", \"\\r\", \"\\n\", \"\\t\", ' ', ' ', ' '), '', $buffer);\n\n ob_start();\n\n // Write everything out\n echo($buffer);\n\n $fc = ob_get_clean();\n\n file_put_contents(\\HMC\\Config::SITE_PATH().$outputdir.$hashFileName.'.css',$fc);\n\n }\n static::resource(str_replace(':||','://',str_replace('//','/',str_replace('://',':||',\\HMC\\Config::SITE_URL().$outputdir.$hashFileName.'.css'))),'css');\n }", "public function add_css ( $filename )\n {\n\n \n if(substr($filename,0,1) != \"/\"){\n $path = basedir . $this->templatePath . 'css' . DS . $filename;\n $fileLoc = DS . $this->templatePath . 'css' . DS . $filename;\n } else {\n $path = basedir . $filename;\n $fileLoc = $filename;\n }\n if( in_array( $fileLoc, $this->css_files ) == true )\n {\n return null;\n }\n \n if( file_exists($path) == false )\n {\n /*------------ERROR------------*/\n // $this->reg->debug->error('Error','Function add_css()', 'Css file not found. File: '.$path, DateTime, $this);\n \n //log::write(\"Css file not found. File: `$path`\", $this, 'add_css()');\n return false;\n }\n $this->css_files[] = str_replace(\"\\\\\",\"/\", $fileLoc);\n $this->includeLibs();\n }", "public function addCssFile(string $cssFile): void\n {\n $this->cssFiles[] = $cssFile;\n }", "public function css($type = 'cdn', array $attributes = array());", "public function addScript($link)\r\n {\r\n $this->scripts = array_merge($this->scripts, array_filter((array) $link));\r\n\r\n return $this;\r\n }", "public function enableCompressCss() {}", "private function _compile_css(){\n\t\t$compiled_css = \"\";\n\t\tforeach($this->css as $css_file){\n\t\t\t$compiled_css .= \"\\t<link rel=\\\"stylesheet\\\" href=\\\"\".$this->assets_url('css').\"/{$css_file}.css\\\" />\\n\";\n\t\t}\n\t\t\n\t\tif ($compiled_css == \"\") return \"\";\n\n\t\treturn \"<!-- START Compiled CSS -->\\n\".$compiled_css.\"\\t<!-- END Compiled CSS -->\\n\";\n\t}", "function AbbcCss()\r\n{\r\n\tglobal $UNB;\r\n\treturn '@import url(' . $UNB['LibraryURL'] . 'abbc.css.php);';\r\n}", "public function load_package_css($file)\n\t{\n\t\t$current_top_path = ee()->load->first_package_path();\n\t\t$package = trim(str_replace(array(PATH_THIRD, 'views'), '', $current_top_path), '/');\n\n\t\tif (REQ == 'CP')\n\t\t{\n\t\t\t$url = BASE.AMP.'C=css'.AMP.'M=third_party'.AMP.'package='.$package.AMP.'file='.$file;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$url = ee()->functions->fetch_site_index().QUERY_MARKER.'ACT='.ee()->functions->fetch_action_id('Channel', 'combo_loader').AMP.'type=css'.AMP.'package='.$package.AMP.'file='.$file;\n\t\t}\n\n\t\t$this->add_to_head('<link type=\"text/css\" rel=\"stylesheet\" href=\"'.$url.'\" />');\n\t}", "public function includeStylesheet($fileName)\n {\n $names = explode(',', $fileName);\n foreach($names as $name)\n {\n $_SESSION['include_stylesheet'][] = $name;\n } \n\n return true;\n }", "function add_stylesheet() {\n echo '<link rel=\"stylesheet\" type=\"text/css\" href=\"' . \n plugins_url('dc-admin.css', __FILE__) . '\">';\n}", "function attach_custom_css_filter() {\n\tif ( ! is_admin() && ! is_feed() && ! is_robots() && ! is_trackback() ) {\n\t\tglobal $publishthis;\n\n\t\tif( is_singular() ) echo $publishthis->utils->display_css();\n\t}\n}", "private function _include_css()\n {\n if ( !$this->cache['css'] )\n {\n $this->EE->cp->add_to_head('<style type=\"text/css\">\n .vz_range { padding-bottom:0.5em; }\n .vz_range input { width:97%; padding:4px; }\n .vz_range_min { float:left; width:46%; }\n .vz_range_max { float:right; width:46%; }\n .vz_range_sep { float:left; width:8%; text-align:center; line-height:2; }\n</style>');\n\n $this->cache['css'] = TRUE;\n }\n }", "function add_css_theme( $css_files )\n {\n // make sure that $this->includes has array value\n if ( ! is_array( $this->includes ) )\n $this->includes = array();\n\n // if $css_files is string, then convert into array\n $css_files = is_array( $css_files ) ? $css_files : explode( \",\", $css_files );\n\n foreach( $css_files as $css )\n {\n // remove white space if any\n $css = trim( $css );\n\n // go to next when passing empty space\n if ( empty( $css ) ) continue;\n\n // using sha1( $css ) as a key to prevent duplicate css to be included\n $this->includes[ 'css_files' ][ sha1( $css ) ] = base_url( \"/themes/{$this->settings->theme}/css\" ) . \"/{$css}\";\n }\n\n return $this;\n }", "private function _getCSSIncludes () {\n $ret = array();\n foreach ($this->_styles as $stylesheet => $included) {\n if (!$included) {\n $this->_styles[$stylesheet] = true;\n array_push($ret, self::CSS_PATH . $stylesheet);\n }\n }\n\n return $ret;\n }", "function thememount_hook_dynamic_css(){\n\tob_start(); // begin collecting output\n\tinclude get_template_directory().'/css/dynamic-style.php';\n\t$css = ob_get_clean(); // retrieve output from myfile.php, stop buffering\n\t\n\t/* Now add the dynamic-style.php style in header */\n\t$output = \"<style> $css </style>\";\n\techo $output;\n}", "public function add_inline_styles() {\n\n\t\t// echo '<div class=\"revsliderstyles\">';\n\t\techo '<style scoped>';\n\n\t\t$db = new UniteDBRev();\n\n\t\t$styles = $db->fetch( GlobalsRevSlider::$table_css );\n\t\tforeach ( $styles as $key => $style ) {\n\t\t\t$handle = str_replace( '.tp-caption', '', $style['handle'] );\n\t\t\tif ( ! isset( $this->class_include[ $handle ] ) ) { unset( $styles[ $key ] ); }\n\t\t}\n\n\t\t$styles = UniteCssParserRev::parseDbArrayToCss( $styles, \"\\n\" );\n\t\t$styles = UniteCssParserRev::compress_css( $styles );\n\t\techo $styles;\n\n\t\techo '</style>' . \"\\n\";\n\t\t// echo '</div>';\n\t}", "public function addStyle($file) {\n $this->styles[$file] = $file;\n }", "public function attachCssFiles(&$args)\n {\n if ($this->isAppropriatePage($args['request'])) {\n $args['css'][] = str_replace(DIRECTORY_SEPARATOR, '/', $this->getFilesPath()) . '/css/styles.css';\n }\n }", "function cd_ab_add_css() {\n if (is_admin())\n return false;\n \n $cd_ab = get_blog_option(bp_get_root_blog_id(), 'cd_ab');\n\n if ( $cd_ab['access'] == 'admin' && !is_super_admin() )\n return false;\n\n $url = plugin_dir_url( __FILE__ ) . '_inc/css/';\n $path = plugin_dir_path( __FILE__ ). '_inc/css/';\n\n switch($cd_ab['color']){\n case 'red':\n $bubbleUrl = $url .$cd_ab['borders'].'/bubble-red.css';\n $bubbleFile = $path.$cd_ab['borders'].'/bubble-red.css';\n break;\n case 'black':\n $bubbleUrl = $url .$cd_ab['borders'].'/bubble-black.css';\n $bubbleFile = $path.$cd_ab['borders'].'/bubble-black.css';\n break;\n case 'grey':\n $bubbleUrl = $url .$cd_ab['borders'].'/bubble-grey.css';\n $bubbleFile = $path.$cd_ab['borders'].'/bubble-grey.css';\n break;\n case 'green':\n $bubbleUrl = $url .$cd_ab['borders'].'/bubble-green.css';\n $bubbleFile = $path.$cd_ab['borders'].'/bubble-green.css';\n break;\n case 'blue':\n default:\n $bubbleUrl = $url .$cd_ab['borders'].'/bubble-blue.css';\n $bubbleFile = $path.$cd_ab['borders'].'/bubble-blue.css';\n break;\n }\n\n if ( file_exists($bubbleFile) ) {\n wp_register_style('bubbleSheets', $bubbleUrl);\n wp_enqueue_style('bubbleSheets');\n }\n}" ]
[ "0.61390555", "0.5865892", "0.5863129", "0.58305824", "0.5820713", "0.57427907", "0.5724702", "0.5724702", "0.5724702", "0.5724702", "0.5724702", "0.5693323", "0.56876814", "0.568317", "0.5632057", "0.5620998", "0.56185776", "0.5617727", "0.56126076", "0.55897474", "0.5558211", "0.55567044", "0.5551647", "0.55100507", "0.5501682", "0.5468442", "0.54348904", "0.54232633", "0.54207754", "0.54163074", "0.54005224", "0.5397782", "0.53919935", "0.5371561", "0.53640807", "0.53594726", "0.5354514", "0.53392553", "0.53240466", "0.5317406", "0.53054726", "0.53028864", "0.5290743", "0.5282649", "0.5280966", "0.52437574", "0.5225751", "0.520482", "0.5190615", "0.518346", "0.51697236", "0.51506084", "0.5145725", "0.5144784", "0.51351637", "0.51221764", "0.51076263", "0.5106636", "0.5105361", "0.5095348", "0.50942194", "0.5094162", "0.5090178", "0.5084781", "0.507264", "0.50684714", "0.506096", "0.5059714", "0.5056376", "0.50308543", "0.50284535", "0.50216377", "0.5018546", "0.5006097", "0.50051796", "0.5001871", "0.49974427", "0.49903533", "0.4987361", "0.498668", "0.49797586", "0.4962932", "0.49535483", "0.49466342", "0.4944203", "0.49393272", "0.49359667", "0.49340037", "0.49321046", "0.49274126", "0.49086756", "0.49069488", "0.49045253", "0.489736", "0.4892768", "0.48885465", "0.48872417", "0.4881553", "0.48761648", "0.48727518" ]
0.7415916
0
Add a javascript link to the includer shortcut for pinJavaScriptLinkInclusion::make($file)>file($file) and adding result to pinIncluder jslinkinclusion become always type 'jslink' Inclusion is added to pinIncluder
public function JS($file,$hook=''){ $file=$this->getFileName($file); $incl=pinJavaScriptLinkInclusion::make($file,$hook)->file($file); pinIncluder::i()->add($incl); return $incl; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function inclureJS() {\r\n \r\n foreach (Page::getInstance()->script as $link) {\r\n \r\n ?>\r\n <script type=\"text/javascript\" src=\"<?php echo $link; ?>\" ></script>\r\n <?php\r\n \r\n }\r\n }", "function incluirJS($arquivo){ ?>\n\t\t<script src=\"js/<?=$arquivo?>.js\" type=\"text/javascript\"></script>\n\t<?php }", "protected function addJavaScript() {\n\t\t$extensionConfiguration = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['contagged']);\n\t\t$javaScriptPathAndFilename = $extensionConfiguration['javaScriptPathAndFilename'];\n\t\tif (is_string($javaScriptPathAndFilename) && $javaScriptPathAndFilename !== '') {\n\t\t\t$GLOBALS['TSFE']->additionalHeaderData['contagged'] .= '<script src=\"' . $javaScriptPathAndFilename . '\" type=\"text/javascript\"></script>';\n\t\t}\n\t}", "private function includeJavaScript() {\n\t\t$GLOBALS['TSFE']->additionalHeaderData[$this->prefixId]\n\t\t\t= '<script type=\"text/javascript\" ' .\n\t\t\t'src=\"' . $this->getExtensionPath() .\n\t\t\t'pi1/tx_explanationbox_pi1.js\">' .\n\t\t\t'</script>';\n\n\t\tif ($this->hasConfValueString('mooTools')) {\n\t\t\t$GLOBALS['TSFE']->additionalHeaderData[$this->prefixId . '_moo']\n\t\t\t\t= '<script type=\"text/javascript\" ' .\n\t\t\t\t'src=\"' . $this->getExtensionPath() .\n\t\t\t\t$this->getConfValueString('mooTools') . '\">' .\n\t\t\t\t'</script>';\n\t\t}\n\t}", "public function sharethis_include_js();", "protected function addJS() {\n foreach ($this->js_files as $js_file) {\n $this->header.=\"<script type='text/javascript' src='\" . __ASSETS_PATH . \"/\" . $js_file . \"'></script> \\n\";\n }\n }", "public function js_includes()\n {\n }", "public function getJavascriptIncludes() {}", "private function addJsInclude($file) {\n $this->jsIncludes[] = $file;\n }", "public function enableConcatenateJavascript() {}", "public static function addJavascript($file)\n\t{\n\t\t$html = '<script type=\"text/javascript\" src=\"' . Config::get('site_url') . '/javascript/' . $file . '\"></script>';\n\t\t\n\t\tTemplate::instance()->smarty->tpl_vars['js_files']->value .= \"\\n\" . $html;\n\t}", "public function javascript() {\r\n\t\tif ($this->scriptable === true || $this->scriptable === 'true') {\r\n\t\t\t\r\n\t\t\tif(@$this->scriptTo) {\r\n\t\t\t\t$element = pzk_element($this->scriptTo);\r\n\t\t\t\tif($element) {\r\n\t\t\t\t\t$element->append(pzk_parse('<html.js src=\"'.BASE_URL.'/js/'.implode('/', $this->fullNames).'.js\" />'));\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\t$page =pzk_page();\r\n\t\t\t\tif ($page) {\r\n\t\t\t\t\t$page->addObjJs($this->tagName);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif ($this->jsLink != false) {\r\n\t\t\tif($this->scriptTo) {\r\n\t\t\t\t$elem = pzk_element($this->scriptTo);\r\n\t\t\t\t$elem->append(pzk_parse('<html.js src=\"'.BASE_REQUEST.'/default/skin/'.pzk_app()->name.'/js/'.$this->jsLink.'.js\" />'));\r\n\t\t\t} else {\r\n\t\t\t\tif($page = pzk_page())\r\n\t\t\t\t\t$page->addObjCss($this->cssLink);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\tif ($this->jsExternalLink != false) {\r\n\t\t\tif($this->scriptTo) {\r\n\t\t\t\t$elem = pzk_element($this->scriptTo);\r\n\t\t\t\t$elem->append(pzk_parse('<html.js src=\"'.$this->jsExternalLink.'\" />'));\r\n\t\t\t} else {\r\n\t\t\t\tif($page = pzk_page()) {\r\n\t\t\t\t\t$page->addExternalCss($this->jsExternalLink);\r\n\t\t\t\t}\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t}", "public function addJS($strFile) {\n\t\t\t$strFile = fixPath($strFile); \n\t\t\tif (!in_array($strFile, $this->arJS)) array_push($this->arJS, $strFile); \n\t\t}", "public function includeJS()\r\n\t\t{\r\n\t\t\techo $this->js;\r\n\t\t}", "private function addJS()\n {\n Filters::add('scripts', array($this, 'renderRevisionsJS'));\n }", "function export_add_js()\n {\n }", "function do_add_js(){\n\t\tglobal $jcf_included_assets;\n\t\t\n\t\tif( !empty($jcf_included_assets['scripts'][get_class($this)]) )\n\t\t\treturn false;\n\t\t\n\t\tif( method_exists($this, 'add_js') ){\n\t\t\tadd_action( 'jcf_admin_edit_post_scripts', array($this, 'add_js'), 10 );\n\t\t}\n\n\t\t$jcf_included_assets['scripts'][get_class($this)] = 1;\n\t}", "function queue_js_url($url, $options = array())\n{\n get_view()->headScript()->appendFile($url, null, $options);\n}", "function link($javaScriptFiles = array(), $scriptBlock = array(), $options = array()) {\r\n\t\t\r\n\t\t$this->__files = $javaScriptFiles;\r\n $scriptBlock = array_filter($scriptBlock);\r\n $this->__scriptBlock = implode(\";\", $scriptBlock);\r\n\t\t\r\n $this->__options( $options );\r\n\r\n if (isset($this->params->query['rewrite'])) {\r\n $this->clearCache();\r\n $this->__rewrite = true;\r\n\t\t}\r\n \r\n\t\t$hashedFile = $this->__hashFiles($javaScriptFiles);\r\n\r\n\t\t$isCacheExist = $this->_checkExistingJsCache($hashedFile);\r\n\t\tif (!$isCacheExist || $this->__rewrite == true) {\r\n\t\t\tforeach ($this->__files as $file) {\r\n\t\t\t\t$pathAndFile = JS . $file . $this->__ext;\r\n\t\t\t\t$content[] = $this->readFileContent($pathAndFile);\r\n\t\t\t}\r\n\t\t\t$contents = implode(\"\", $content);\r\n $this->__writeToCacheFile($hashedFile . $this->__ext, $contents);\r\n return $this->_linkToJsCache($hashedFile);\r\n\t\t}\r\n\t\treturn $isCacheExist;\r\n\t}", "function javascript_include_tag() {\n $sources = func_get_args();\n\n $attributes = NULL;\n if (is_array($sources[count($sources) - 1])) {\n $attributes = array_pop($sources);\n }\n\n $tags = array();\n\n foreach ($sources as $source) {\n // only http[s] or // (leading double slash to inherit the protocol)\n // are treated as absolute url\n if (!is_absolute_url($source)) {\n $source = javascript_url($source);\n if (!preg_match(\"/\\.js$/\", $source)) $source .= \".js\";\n $source = $this->asset_version($source);\n }\n $options = array(\n \"src\" => $source,\n \"type\" => \"text/javascript\"\n );\n if(is_array($attributes)){\n $options = array_merge($options, $attributes);\n }\n $tags[] = content_tag(\"script\", \"\", $options);\n }\n\n return join(\"\\n\", $tags);\n }", "public function addJavascript($file) {\n $this->scripts[$file] = $file;\n }", "protected function doConcatenateJavaScript() {}", "function add_css_js()\n\t{\n\t\tif (!defined('CSS_JS_PARSED'))\n\t\t{\n\t\t\tdefine('CSS_JS_PARSED', true);\n\t\t}\n\n\t\t// Include custom CSS from templates/CURRENT_TPL folder\n\t\tif(is_array($this->css_style_include) && !empty($this->css_style_include))\n\t\t{\n\t\t\tfor ($i = 0; $i < sizeof($this->css_style_include); $i++)\n\t\t\t{\n\t\t\t\t$this->assign_block_vars('css_style_include', array(\n\t\t\t\t\t'CSS_FILE' => $this->css_style_include[$i],\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\t// Include custom CSS from templates/common folder\n\t\tif(is_array($this->css_include) && !empty($this->css_include))\n\t\t{\n\t\t\tfor ($i = 0; $i < sizeof($this->css_include); $i++)\n\t\t\t{\n\t\t\t\t$this->assign_block_vars('css_include', array(\n\t\t\t\t\t'CSS_FILE' => $this->css_include[$i],\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\t// Include custom JS from templates/common folder\n\t\tif(is_array($this->js_include) && !empty($this->js_include))\n\t\t{\n\t\t\tfor ($i = 0; $i < sizeof($this->js_include); $i++)\n\t\t\t{\n\t\t\t\t$this->assign_block_vars('js_include', array(\n\t\t\t\t\t'JS_FILE' => $this->js_include[$i],\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}", "public function jsSource($file,$hook,$vars=array()){\n \n $file=$this->getFileName($filename);\n \n $content=@file_get_contents($this->cfg_jsincdir.$file.'js');\n if($content){\n $content=str_replace(array_keys($vars),array_values($vars),$content);\n }\n $in=pinJavaScriptInclusion::make($file,$hook)->setContent($content);\n pinIncluder::i()->add($in);\n return $in;\n }", "function options_permalink_add_js()\n {\n }", "function ft_hook_add_js_file() {}", "function src_inc_js(string $file) : string{\n return \"<script type='text/javascript' src='\".$file.\"'></script>\";\n}", "function _inject_js_file($file) {\n\t\t$this->_add_method_to_finalize($this,\"inject_js_file_finalize\");\n\t\tif(!is_array($this->_js_files_to_inject)) $this->_js_files_to_inject = array();\n\t\tif(!isset($this->_js_files_to_inject[$file])) $this->_js_files_to_inject[$file] = $file;\n\t}", "public function addScript($link)\r\n {\r\n $this->scripts = array_merge($this->scripts, array_filter((array) $link));\r\n\r\n return $this;\r\n }", "public function addJavascriptFiles($js /* array */);", "function addJs($file){\n wp_enqueue_script(\n 'mvc-ajax',\n MVC_ASSETS_URL.'js/mvc-ajax.js',\n array('jquery')\n );\n \n //Add any data needed in a global js object to this array\n $data = array ( 'URL' => esc_url( wp_nonce_url ( admin_url('admin-ajax.php?action=mvc_ajax' ), 'mvc-ajax' )) );\n \n wp_localize_script ( 'mvc-ajax' , 'MVCAjaxData' , $data ) ;\n \n }", "function addScriptResources()\t{\n\t\tif (t3lib_extMgm::isLoaded('t3jquery')) {\n\t\t\trequire_once(t3lib_extMgm::extPath('t3jquery').'class.tx_t3jquery.php');\n\t\t}\n\n\t\t// checks if t3jquery is loaded\n\t\tif (T3JQUERY === TRUE) {\n\t\t\ttx_t3jquery::addJqJS();\n\t\t} else {\n\t\t\tif($this->conf['jQueryRes']) $this->jsFile[] = $this->conf['jQueryRes'];\n\t\t\tif($this->conf['tooltipJSRes']) $this->jsFile[] = $this->conf['tooltipJSRes'];\n\t\t}\n\n\t\t// Fix moveJsFromHeaderToFooter (add all scripts to the footer)\n\t\tif ($GLOBALS['TSFE']->config['config']['moveJsFromHeaderToFooter']) {\n\t\t\t$allJsInFooter = TRUE;\n\t\t} else {\n\t\t\t$allJsInFooter = FALSE;\n\t\t}\n\n\t\t$pagerender = $GLOBALS['TSFE']->getPageRenderer();\n\t\t\n\t\t// add all defined JS files\n\t\tif (count($this->jsFile) > 0) {\n\t\t\tforeach ($this->jsFile as $jsToLoad) {\n\t\t\t\tif (T3JQUERY === TRUE) {\n\t\t\t\t\t$conf = array(\n\t\t\t\t\t\t'jsfile' => $jsToLoad,\n\t\t\t\t\t\t'tofooter' => ($this->conf['jsInFooter'] || $allJsInFooter),\n\t\t\t\t\t\t'jsminify' => $this->conf['jsMinify'],\n\t\t\t\t\t);\n\t\t\t\t\ttx_t3jquery::addJS('', $conf);\n\t\t\t\t} else {\n\t\t\t\t\t$file = $GLOBALS['TSFE']->tmpl->getFileName($jsToLoad);\n\t\t\t\t\tif ($file) {\n\t\t\t\t\t\tif ($allJsInFooter) {\n\t\t\t\t\t\t\t$pagerender->addJsFooterFile($file, 'text/javascript', $this->conf['jsMinify']);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$pagerender->addJsFile($file, 'text/javascript', $this->conf['jsMinify']);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tt3lib_div::devLog(\"'{\".$jsToLoad.\"}' does not exists!\", $this->extKey, 2);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// add defined CSS file\n\t\tif($this->conf['cssFile']) {\n\t\t\t// Add script only once\n\t\t\t$css = $GLOBALS['TSFE']->tmpl->getFileName($this->conf['cssFile']);\n\t\t\tif ($css) {\n\t\t\t\t$pagerender->addCssFile($css, 'stylesheet', 'all', '', $this->conf['cssMinify']);\n\t\t\t} else {\n\t\t\t\tt3lib_div::devLog(\"'{\".$this->conf['cssFile'].\"}' does not exists!\", $this->extKey, 2);\n\t\t\t}\n\t\t}\n\t}", "public function appendJsUrl($url) {\n $this->appendToHead(<<<HTML\n <script type='text/javascript' src='$url'></script>\nHTML\n) ;\n }", "function add_external_js( $js_files, $path = NULL, $is_i18n = FALSE )\n {\n if ( $is_i18n )\n return $this->add_jsi18n_theme( $js_files, TRUE );\n\n // make sure that $this->includes has array value\n if ( ! is_array( $this->includes ) )\n $this->includes = array();\n\n // if $js_files is string, then convert into array\n $js_files = is_array( $js_files ) ? $js_files : explode( \",\", $js_files );\n\n foreach( $js_files as $js )\n {\n // remove white space if any\n $js = trim( $js );\n\n // go to next when passing empty space\n if ( empty( $js ) ) continue;\n\n // using sha1( $css ) as a key to prevent duplicate css to be included\n $this->includes[ 'js_files' ][ sha1( $js ) ] = is_null( $path ) ? $js : $path . $js;\n }\n\n return $this;\n }", "protected function addJavascriptToBackend() {\n\t\t$this->backendReference->addJavascriptFile(t3lib_extMgm::extRelPath($this->extkey) . 'mod_role/newspaper_role.js');\n\t}", "function add_script($name, $file)\n{\n\tglobal $scripts_included;\n\t$scripts_included[$name] = \"<script type='text/javascript' src='\".site_url.$file.\"'></script>\\n\";\n}", "protected function create_javascript_include($filepath, $attributes)\n\t{\n\t\t$tag = '<script src=\"' . $this->getUrlPath($filepath, 'javascripts') .'\"';\n\t\tforeach ($attributes as $attribute_key => $attribute_value) {\n\t\t\t$tag .= \" $attribute_key=\\\"$attribute_value\\\"\";\n\t\t}\n\t\t$tag .= '></script>';\n\n\t\treturn $tag;\n\t}", "function head_js($includeDefaults = true)\n{\n $headScript = get_view()->headScript();\n\n if ($includeDefaults) {\n $dir = 'javascripts';\n $headScript->prependScript('jQuery.noConflict();')\n ->prependScript('window.jQuery.ui || document.write(' . js_escape(js_tag('vendor/jquery-ui')) . ')')\n // ->prependFile('//ajax.googleapis.com/ajax/libs/jqueryui/1.11.2/jquery-ui.min.js')\n ->prependScript('window.jQuery || document.write(' . js_escape(js_tag('vendor/jquery')) . ')')\n // ->prependFile('//ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js')\n ;\n }\n return $headScript;\n}", "public function addJavascript($fileAsset)\n {\n if (!$fileAsset instanceof FileAssetInterface) {\n $fileAsset = $this->setupAsset(new JavaScript(), $fileAsset, func_get_args());\n }\n $fileAsset->setFileName($this->getAssetPath($fileAsset->getFileName()));\n $this->getApp()['asset.queue.file']->add($fileAsset);\n }", "function min_js($files, $link = '') {\n $CI = & get_instance(); //get instance, access the CI superobject\n $CI->load->driver('minify');\n $result = '';\n if (isset($files) && count($files) > 0) {\n if ($CI->config->item('COMPRESS_OVERRIDE')) {\n if ($CI->config->item('COMPRESS_JS')) {\n $jss = $CI->minify->combine_files($files, \"js\", TRUE);\n\n $CI->minify->save_file($jss, $link);\n $result = '<script src=\"' . base_url() . $link . '?v=' . uniqid() . '\" ></script>';\n } else {\n $result = script_tag_default_html($files);\n }\n } else {\n $result = '<script src=\"' . base_url() . $link . '?v=' . uniqid() . '\" ></script>';\n }\n }\n return $result;\n }", "protected function includeJs($path) {\n echo '<script src=\"' . $this->getUrl($path) . '\"></script>';\n }", "protected function includeJs($path) {\n echo '<script src=\"' . $this->getUrl($path) . '\"></script>';\n }", "protected function getSubJsFile(): void\n {\n preg_match_all(self::REGEX_JS_INCLUDE_FORMAT, $this->sContents, $aHit, PREG_PATTERN_ORDER);\n\n for ($i = 0, $iCountHit = count($aHit[0]); $i < $iCountHit; $i++) {\n $this->sContents = str_replace($aHit[0][$i], '', $this->sContents);\n $this->sContents .= File::EOL . $this->oFile->getUrlContents($aHit[1][$i] . $aHit[2][$i]);\n }\n }", "public function addJSInclude($jsfiles)\n\t{\n\t\tif(!is_array($jsfiles))\n\t\t\t$jsfiles = array($jsfiles);\n\n\t\tforeach($jsfiles as $file)\n\t\t{\n\t\t\tif(!in_array($file, $this->jsIncludes))\n\t\t\t\tarray_unshift($this->jsIncludes, '<script type=\"text/javascript\" src=\"' . $file . '\"></script>');\n \t\t}\n\t}", "public function includeGMapsJS() {\n\t\tif(self::$jsIncluded) return;\n // Google map JS\n\t\t\n\t\t//adding in a callback for jochen:\n //$this->content .= '<script src=\"http://maps.google.com/maps?hl='. $this->lang.'&file=api&amp;v=2&amp;key='.$this->googleMapKey.'\" type=\"text/javascript\">';\n\t\t$this->content .= '<script src=\"http://maps.google.com/maps?hl='. $this->lang.'&file=api&amp;v=2&amp;callback=load&amp;key='.$this->googleMapKey.'\" type=\"text/javascript\">';\n $this->content .= '</script>'.\"\\n\";\n \n // Clusterer JS\n if ($this->useClusterer==true) {\n\t\t\t// Source: http://gmaps-utility-library.googlecode.com/svn/trunk/markerclusterer/1.0/src/\n\t\t\t$this->content .= '<script src=\"'.$this->clustererLibraryPath.'\" type=\"text/javascript\"></script>'.\"\\n\";\n }\n \n self::$jsIncluded = true;\n\t\n\t}", "private function register_script() {\n\n\t\tif ( $this->inline ) {\n\t\t\twp_register_script(\n\t\t\t\t$this->handle,\n\t\t\t\t'',\n\t\t\t\t$this->deps,\n\t\t\t\t$this->ver,\n\t\t\t\t$this->footer\n\t\t\t);\n\t\t\tif ( $this->does_file_exist( $this->src ) ) {\n\t\t\t\twp_add_inline_script( $this->handle, file_get_contents( $this->src ) );\n\t\t\t}\n\t\t} else {\n\t\t\twp_register_script(\n\t\t\t\t$this->handle,\n\t\t\t\t$this->src,\n\t\t\t\t$this->deps,\n\t\t\t\t$this->ver,\n\t\t\t\t$this->footer\n\t\t\t);\n\t\t}\n\n\t\tif ( ! empty( $this->localize ) ) {\n\t\t\twp_localize_script( $this->handle, $this->handle, $this->localize );\n\t\t}\n\n\t\twp_enqueue_script( $this->handle );\n\t}", "private function _inline_js() \n\t{\t\n\t\t// Are there any scripts to include? \n\t\tif (count($this->inline_scripts) == 0)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t// Create our shell opening\n\t\techo '<script type=\"text/javascript\">' . \"\\n\";\n\t\techo $this->ci->config->item('inline_js_opener') .\"\\n\\n\";\n\t\t\n\t\t// Loop through all available scripts\n\t\t// inserting them inside the shell.\n\t\tforeach($this->inline_scripts as $script)\n\t\t{\n\t\t\techo $script . \"\\n\";\n\t\t}\n\t\t\n\t\t// Close the shell.\n\t\techo \"\\n\" . $this->ci->config->item('inline_js_closer') . \"\\n\";\n\t\techo '</script>' . \"\\n\";\n\t\t\n\t}", "public function add_js($file)\n {\n $this->add(\"js\", $file);\n }", "public function testIncludeJsMultipleDestination() {\n\t\t$this->Helper->addScript('libraries', 'default');\n\t\t$this->Helper->addScript('thing', 'second');\n\t\t$this->Helper->addScript('other', 'third');\n\n\t\t$result = $this->Helper->includeJs('default');\n\t\t$expected = array(\n\t\t\tarray('script' => array(\n\t\t\t\t'type' => 'text/javascript',\n\t\t\t\t'src' => '/cache_js/default.js?file%5B0%5D=libraries'\n\t\t\t)),\n\t\t);\n\t\t$this->assertTags($result, $expected);\n\n\t\t$result = $this->Helper->includeJs('second', 'third');\n\t\t$expected = array(\n\t\t\tarray('script' => array(\n\t\t\t\t'type' => 'text/javascript',\n\t\t\t\t'src' => '/cache_js/second.js?file%5B0%5D=thing'\n\t\t\t)),\n\t\t\t'/script',\n\t\t\tarray('script' => array(\n\t\t\t\t'type' => 'text/javascript',\n\t\t\t\t'src' => '/cache_js/third.js?file%5B0%5D=other'\n\t\t\t)),\n\t\t\t'/script'\n\t\t);\n\t\t$this->assertTags($result, $expected);\n\t}", "public function injectJavascriptInView(): void\n {\n share([\n 'libraryMedia' => [\n 'clipboardCopy' => [\n 'route' => route('libraryMedia.file.clipboardContent', ['__ID__', '__TYPE__', '__LOCALE__']),\n ],\n ],\n ]);\n }", "public function insert_inline_scripts() {\n }", "public function insert_inline_scripts() {\n }", "public function insert_inline_scripts() {\n }", "protected function addCustomJS()\n\t{\n\t\t\n\t}", "protected function addAdditionalScript() {\necho <<< HTML\n <script src=\"scripts/ajax.js\"></script>\n <link rel=\"stylesheet\" type=\"text/css\" href=\"styles/customer.css\">\nHTML; \n }", "public function write_includes()\n \t{\n\t\t$result=\"\";\n\t\t\n\t\tforeach($this->includes as $key => $include)\n\t\t{\n\t\t\tif (strpos($include,'http://')!==0)\n\t\t\t\t$include='/js/'.$include.'.js';\n\t\t\t\t\n\t\t\t$result.=\"\\t\\t<script src=\\\"$include\\\" type=\\\"text/javascript\\\"></script>\\n\";\n\t\t}\n\t\t\t\n\t\treturn $result;\n \t}", "function js_include()\n {\n $args = func_get_args();\n\n $js_lookup_table = [\n 'jquery' => '/ext/jquery-3.1.1.min.js',\n 'tinymce' => '/ext/tinymce/tinymce.min.js',\n 'pagination' => '/ext/pagination.min.js',\n 'featherlight' => '/ext/featherlight.min.js',\n 'featherlight-gallery' => '/ext/featherlight.gallery.min.js',\n 'chosen' => '/ext/chosen_v1.6.2/chosen.jquery.min.js',\n 'qtip' => '/ext/jquery.qtip.min.js'\n ];\n\n foreach( $args as $arg )\n {\n if( isset( $js_lookup_table[$arg] ) )\n $arg = $js_lookup_table[$arg];\n\n echo \"<script src=\\\"/common/js/$arg\\\"></script>\";\n }\n }", "public function control_panel__add_to_foot()\n\t{\n\t\t// Get the necessary support .js\n\t\tif ( URL::getCurrent(false) == '/publish' ) {\n\t\t\treturn $this->js->link('build/fileclerk.min.js');\n\t\t}\n\t}", "public function getConcatenateJavascript() {}", "function enqueue_javascript($script, $is_absolute_path = false, $is_footer = true, $position = null) {\n global $DE100_GLOBALS;\n \n if (!$is_absolute_path)\n $script = DIR_TO_JS . $script;\n \n // Check if script is already added or not... \n foreach ($DE100_GLOBALS['javascripts'] as $item) {\n if ($item['src'] == $script)\n return;\n }\n \n if ($position === null || $position >= count($DE100_GLOBALS['javascripts'])) {\n array_push($DE100_GLOBALS['javascripts'], ['src' => $script, 'is_footer' => $is_footer]);\n } else {\n $js = [];\n for ($i = 0; $i < count($DE100_GLOBALS['javascripts']); $i++) {\n if ($i == $position) {\n $js[] = ['src' => $script, 'is_footer' => $is_footer];\n }\n $js[] = $DE100_GLOBALS['javascripts'][$i];\n }\n $DE100_GLOBALS['javascripts'] = $js;\n }\n}", "function wp_add_inline_script($handle, $data, $position = 'after')\n {\n }", "protected function injectFromAssetManager() {\n $asset = dirname(__FILE__) .'/js/';\n $passet = Yii::app()->assetManager->publish($asset);\n $cs = Yii::app()->clientScript;\n foreach ($this->jsFiles as $jf) {\n $cs->registerScriptFile($passet . '/' . $jf, CClientScript::POS_HEAD);\n }\n }", "function add_id_to_script($src, $handle) {\n $theme = 'absolvution';\n $gruntBase = '//' . $_SERVER['HTTP_HOST'] . '/wp-content/themes/' . $theme . '/grunt';\n $config = $gruntBase . '/app/config';\n if ($handle != 'require.js') {\n return $src;\n }\n if ( AMD == true )\n echo '<script id=\"requirejs\" type=\"text/javascript\" src=\"' . esc_url( $src ) . '\" data-main=\"' . $config . '\"></script>' . PHP_EOL;\n else\n echo '<script type=\"text/javascript\" src=\"' . esc_url( $src ) . '\"></script>' . PHP_EOL;\n\n return false;\n}", "public function inline_js(){\n\n $this->render_js_vars();\n $js = file_get_contents(Helper::asset('client.js'));\n echo view('@AgreablePollPlugin/scripts.twig', [\n 'js_path' => Helper::asset('client.js'),\n 'js' => $js,\n ])->getBody();\n\n }", "function pushScript ($script) {\n\t\t$this->_roof[\"cuerpo\"][] = \"<script type=\\\"text/javascript\\\" src=\\\"\".$script.\"\\\"></script>\";\n\t}", "public function addJS ($js) {\r\n\t\t\t$this->js .= \"<script src='js/$js.js' ></script>\";\r\n\t\t}", "static function include_scripts(){\n\t\t//self::include_css();\n\t\tself::include_js();\n\t}", "public function addInlineJavascript($script) {\n $this->inlineScripts[] = $script;\n }", "public function addJSFile($filePath) {\n $this->addToHead(\"<script src=\\\"\" . $filePath . \"\\\"></script>\", Page::BOTTOM);\n }", "function includeJs($fileName) {\n $data = '<script src=\"'.BASE_PATH.'/js/'.$fileName.'.js\"></script>';\n return $data;\n }", "public function disableConcatenateJavascript() {}", "public function js()\n {\n $dir = new \\Ninja\\Directory(NINJA_DOCROOT . 'public/');\n /**\n * @var $files \\Ninja\\File[]\n */\n $files = $dir->scanRecursive(\"*.js\");\n\n echo \"\\nMinifying Javascript Files...\\n\";\n foreach($files as $sourceFile)\n {\n // Skip all foo.#.js (e.g foo.52.js) which are files from a previous build\n if (is_numeric(substr($sourceFile->getName(true), strrpos($sourceFile->getName(true), '.') + 1)))\n continue;\n\n /**\n * @var $destFile \\Ninja\\File\n */\n $destFile = $sourceFile->getParent()->ensureFile($sourceFile->getName(true) . '.' . self::REVISION . '.' . $sourceFile->getExtension());\n\n $destFile->write(\\Minify_Js::minify($sourceFile->read()));\n echo ' ' . $sourceFile->getPath() . \"\\n\";\n\n unset($sourceFile);\n }\n }", "function loadJS() {\n\t\t$first = true;\n\t\t$jsPart = '';\n\t\tforeach( $this->conf->js->file as $file ) {\n\t\t\tif( ! $first ) {\n\t\t\t\t$jsPart .= chr( 9 );\n\t\t\t}\n\t\t\t$jsPart .= '<script type=\"text/javascript\" src=\"';\n\t\t\t$jsPart .= $this->conf->path->baseUrl . $this->conf->path->js . $file;\n\t\t\t$jsPart .= '\"></script>' . chr( 10 );\n\t\t\t$first = false;\n\t\t}\n\t\t\n\t\tif( count( $this->additionalJS ) >= 1 ) {\n\t\t\tforeach( $this->additionalJS as $key => $value ) {\n\t\t\t\t$jsPart .= '<script type=\"text/javascript\">' . chr( 10 );\n\t\t\t\t$jsPart .= $value . chr( 10 );\n\t\t\t\t$jsPart .= '</script>' . chr( 10 );\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $jsPart;\n\t}", "public function add_js()\n\t{\n $args = func_get_args();\n foreach ( $args as $a ){\n if ( is_array($a) ){\n $data = $a;\n }\n else if ( is_string($a) ){\n $path = $a;\n }\n }\n if ( $r = $this->get_view(isset($path) ? $path : '', 'js') ){\n $this->add_script($this->render($r, isset($data) ? $data : $this->data));\n }\n\t\treturn $this;\n }", "public function AddJS($javascript){\n\t\t$headHTML = \"\";\n\t\tif(!is_array($javascript)){\n\t\t\t$javascript = [$javascript];\n\t\t}\n\t\tforeach($javascript as $js){\n\t\t\t$strExt = strtolower(substr($js,-3)) != \".js\" ? \".js\" : \"\";\n\t\t\t$js = $js.$strExt;\n\t\t\t$routeInApplication = APP_PATH.$js;\n\t\t\tif(is_file($routeInApplication)){\n\t\t\t\t$headHTML .= '<script type=\"text/javascript\" src=\"'.URL_APP.$routeInApplication.'\" ></script>';\n\t\t\t}else{\n\t\t\t\tthrow new \\Exception(\"The JS file \".$js.\" is not found in the application\");\n\t\t\t}\n\t\t}\n\t\t\n\t\techo $headHTML;\n\t}", "public function includeJavascript($fileName)\n {\n $names = explode(',', $fileName);\n foreach($names as $name)\n {\n $_SESSION['include_javascript'][] = $name;\n } \n\n return true;\n }", "public function addJS($javascript)\r\n\t\t{\r\n\t\t\t$this->js = $this->js . '<script type=\"text/javascript\" src=\"'. $GLOBALS['PAGE']['root_dir'] . $javascript . '\"></script>';\r\n\t\t}", "public function INCLUDE_JS(array $conf) {\n if($conf && count($conf)) {\n foreach ($conf as $key => $JSfile) {\n if (!is_array($JSfile)) {\n if (isset($conf[$key . '.']['if.']) && !$GLOBALS['TSFE']->cObj->checkIf($conf[($key . '.')]['if.'])) {\n continue;\n }\n $ss = $conf[$key . '.']['external'] ? $JSfile : $GLOBALS['TSFE']->tmpl->getFileName($JSfile);\n if ($ss) {\n $jsConfig = &$conf[$key . '.'];\n $type = $jsConfig['type'];\n if (!$type) {\n $type = 'text/javascript';\n }\n $this->pageRenderer->addJsFile(\n $ss,\n $type,\n empty($jsConfig['disableCompression']),\n $jsConfig['forceOnTop'] ? TRUE : FALSE,\n $jsConfig['allWrap'],\n $jsConfig['excludeFromConcatenation'] ? TRUE : FALSE,\n $jsConfig['allWrap.']['splitChar']\n );\n unset($jsConfig);\n }\n }\n }\n }\n }", "public function jquery($hook='',$addJqUi=false,$addUiTheme=false){\n \n $html=pinHtml::make('script')->type('text/javascript')->src($this->cfg_jquerylink);\n\n $in=pinInclusion::make('jq',$hook);\n $in->setContent($html->render());\n pinIncluder::i()->add($in);\n \n if($addJqUi){\n \n $html=pinHtml::make('script')->type('text/javascript')->src($this->cfg_jqueryuilink);\n\n $in=pinInclusion::make('jqui',$hook);\n $in->setContent($html->render());\n pinIncluder::i()->add($in);\n \n if($addUiTheme){\n \n $link=$this->cfg_jqueryuicsslink;\n $link=str_replace('{theme}',$this->cfg_jqueryuitheme,$link);\n \n $html=pinHtml::make('link')->rel('stylesheet')->href($link);\n \n $in=pinInclusion::make('jquicss',$hook)->overrideType('css');\n $in->setContent($html->render());\n \n pinIncluder::i()->add($in);\n \n }\n \n } \n \n return $in;\n \n }", "public function includeAssets(): void\n {\n $this->Html->script('CkTools.vendor/tinymce/jquery.tinymce.min.js', ['block' => true]);\n }", "function fresh_text_add_js()\n\t{\n\t\techo '<script>';\n\t\techo require_once 'replacement.php';\n\t\techo '</script>';\n\t}", "final public function addInlineScript($script) {\n //We must separate scripts with newlines, so that line comments from the previous script don't affect this script\n $this->internalScripts .= $script;\n\tif(!preg_match(\"/\\n$/\", $this->internalScripts)){\n\t\t$this->internalScripts .= \"\\n\";\n\t}\n return $this;\n }", "public function addJsFile(string $jsFile): void\n {\n $this->jsFiles[] = $jsFile;\n }", "public function CSS($file,$hook=''){\n \n $file=$this->getFileName($file);\n $incl=pinCSSLinkInclusion::make($file,$hook)->file($file);\n pinIncluder::i()->add($incl);\n return $incl; \n }", "private function \t\t\t\tbuild_script_tags() {\n\t\t$load=array(\n\t\t\t\"assets/js/jquery/jquery-3.3.1.min.js\",\n\t\t\t\"assets/js/bootstrap/bootstrap.min.js\",\n\t\t\t// \"assets/js/fontawesome/all.min.js\",\n\t\t\t\"assets/js/app/fetch.js\",\n\t\t\t\"assets/js/app/modal.js\",\n\t\t\t\"assets/js/app/common.js\"\n\t\t);\n\n\t\treturn array_reduce(array_unique(array_merge($load, $this->section_js)), function($_acum, $_item) {\n\t\t\t$_acum.=<<<R\n\n\t\t<script type=\"text/javascript\" src=\"{$_item}\"></script>\nR;\n\t\t\treturn $_acum;\n\t\t}, '');\n\t}", "protected function block_javascript_file() {\n\t\tadd_action( 'dynamic_sidebar', array( $this, 'display_div_message_to_go_to_consent_settings' ), 10, 1 );\n\t}", "public function getHeadJavascript()\n\t{\n\n $url = Config::$url;\n $googleAnalyticsToken = Config::$googleAnalyticsToken;\n\n\t\treturn<<<js\n<script type=\"text/javascript\" data-comment=\"Google Analytics\">\n var _gaq = _gaq || [];\n _gaq.push(['_setAccount', '$googleAnalyticsToken']);\n _gaq.push(['_trackPageview']);\n\n (function() {\n var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;\n ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';\n var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);\n })();\n</script>\n\n<!-- package-javascript\nAll external javascript file, including the minified SNAP javascript,\nare listed here and in the project makefile to be bundled into a single\njavascript file. The 'package-javascript' and 'end-package' tokens\nare used to determine the region to be replaced with a single script inclusion.\n\nIf you add a file here, you must add it to the makefile for packaging. See the README in the js/ directory.\n-->\n<script src=\"js/underscore-min.js\" type=\"text/javascript\" ></script>\n<script src=\"js/jquery-1.8.2.min.js\" type=\"text/javascript\" ></script>\n<script src=\"js/jquery.blockUI.js\" type=\"text/javascript\" ></script>\n<script src=\"js/jquery.hoverIntent.minified.js\" type=\"text/javascript\"></script>\n<script src=\"js/jquery.cycle.all.js\" type=\"text/javascript\"></script>\n<script src=\"js/jquery.url.js\" type=\"text/javascript\"></script>\n<script src=\"js/plugins.js\" type=\"text/javascript\"></script>\n<script src=\"js/highcharts.js\" type=\"text/javascript\"></script>\n<script src=\"js/exporting.src.js\" type=\"text/javascript\"></script>\n<script src=\"js/jquery-ui-1.8.24.custom.min.js\" type=\"text/javascript\"></script>\n<script src=\"js/jquery.ba-hashchange.min.js\" type=\"text/javascript\"></script>\n<script src=\"js/jquery.validate.min.js\" type=\"text/javascript\"></script>\n<script src=\"js/jquery.ba-bbq.min.js\" type=\"text/javascript\"></script>\n<script src=\"js/jquery.scrollTo-min.js\" type=\"text/javascript\"></script>\n\n<script src=\"js/licenseModal.js\" type=\"text/javascript\"></script>\n<script src=\"js/charts.js\" type=\"text/javascript\"></script>\n<script src=\"js/maps.js\" type=\"text/javascript\"></script>\n<!-- end-package -->\n\n<script type=\"text/javascript\">\n\n// Interpolate server-side configs as appropriate\nwindow.snapConfig = {\n url: '$url',\n geonetworkMetadataUrl: 'http://athena.snap.uaf.edu:8080/geonetwork/srv/en/metadata.show.embedded?id=',\n dataPath: '/data/'\n}\n</script>\n\njs;\n\t}", "public function addScript($js, $cacheable = true) {\n // Check if JS is local or url\n if(strpos($js, \"http\") === false) {\n // File is local. Check if file exists\n if(!file_exists($js)) {\n //App::error(\"Archivo [$js] inexistente.\", 0x0011);\n return;\n }\n }\n\n if(is_null($this->Scripts))\n $this->Scripts = array();\n\n $this->Scripts[] = array('file'=>$js, 'cache'=>$cacheable);\n }", "function includeJQuery() {\n\t\tif ($this->jQueryLocation) {\n\t\t\tRequirements::javascript($this->jQueryLocation);\n\t\t} else if (self::$jquery_location) {\n\t\t\tRequirements::javascript(self::$jquery_location);\n\t\t}\n\n\t}", "public function ajouterScript($fichierJS) {\r\n $chemin = 'javascript/';\r\n $suffixe = '.js';\r\n $jsfile=$chemin . $fichierJS . $suffixe;\r\n if(!is_readable($jsfile)) die(\"ERROR $jsfile inexistant\");\r\n \r\n array_push($this->script, \"$jsfile\");\r\n \r\n \r\n }", "protected function renderJavascript(){\n \n return sprintf(\n '<script type=\"text/javascript\" src=\"%s\"></script>',\n $this->getField('url')\n );\n \n }", "protected function addScript($scriptFile = false){\n\t\tif($scriptFile){\n\t\t\t$modulePath = BASE_PATH . DS . 'resource' . DS . 'js' . DS . $scriptFile . '.js';\n\t\t\t$scriptFile = Safan::app()->resourceUrl . DS . 'js' . DS . $scriptFile . '.js';\n\t\t\tif(file_exists($modulePath))\n\t\t\t\t$this->scripts[] = $scriptFile;\n\t\t}\n\t\telse{\n\t\t\t$modulePath = BASE_PATH . DS . 'resource' . DS . 'js' . DS . 'application' . DS . 'w.' . strtolower(self::$widgetName) . '.script.js';\n\t\t\t$moduleScript = Safan::app()->resourceUrl . DS . 'js' . DS . 'application' . DS . 'w.' . strtolower(self::$widgetName) . '.script.js';\n\t\t\tif(file_exists($modulePath))\n\t\t\t\t$this->scripts[] = $moduleScript;\n\t\t}\n\t}", "function include_js($files='')\n{\n $js_link = '';\n $js_root = get_stylesheet_directory_uri() . \"/js\";\n \n if (is_array($files)) {\n for ($i=0; $i < count($files); $i++) { \n $js_link .= \"<script type='text/javascript'\";\n $js_link .= \" src='${js_root}/\" . $files[$i] . \".js'></script>\\n\";\n }\n } else {\n $js_link .= \"<script type='text/javascript'\";\n $js_link .= \" src='${js_root}/\" . $files . \".js'></script>\\n\";\n }\n echo $js_link;\n}", "protected function registerClientScript()\n {\n $view = $this->getView();\n $options = Json::encode($this->jsOptions);\n Asset::register($view);\n $view->registerJs('jQuery.address(' . $options . ');');\n }", "public function addJsScriptBottom($file){\n array_push($this->_jsScriptsBottom,$file);\n }", "abstract public function addScript($file = '', $options = array(), $attribs = array());", "public function addScriptWrapper() {\n if ($this->doAddScript) {\n $this->addScript();\n }\n }", "public function add_jquerey($extra=array()){\n\t\tif(is_string($extra)){\n\t\t\t$extra=array($extra);\n\t\t}\n\t\tif(!self::is_included(\"jquerey\")){\n\t\t\t$this->add_script(\"https://ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js\",\"./js/jq.js\");\n\t\t}\n\t\tself::$included[\"jquerey\"]=true;\n\t\t$libs=array(\n\t\t\t\t\"cookie\"=>\"https://cdn.jsdelivr.net/jquery.cookie/1.4.1/jquery.cookie.min.js\",\n\t\t\t\t\"lazy_load\"=>\"https://cdnjs.cloudflare.com/ajax/libs/jquery.lazyload/1.9.1/jquery.lazyload.min.js\"\n\t\t);\n\t\tforeach ($extra as $item){\n\t\t\tif (isset($libs[$item])){\n\t\t\t\tif(!self::is_included($item)){\n\t\t\t\t\t$this->add_script($libs[$item]);\n\t\t\t\t\tself::$included[$item]=true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "function add_javascript() {\n echo '<script type=\"text/javascript\" src=' .\n plugins_url('dc-admin.js', __FILE__) . '></script>';\n}", "public function addJS($source) {\n\t\t\n\t\t\t$this->_js[] = '<script type=\"text/javascript\" src=\"' . $source . '\"></script>';\n\t\t\t\n\t\t}" ]
[ "0.69634444", "0.6444571", "0.63580424", "0.6326295", "0.6233088", "0.6230668", "0.6229203", "0.62213826", "0.6124667", "0.6103292", "0.6095245", "0.6092139", "0.6021721", "0.59888655", "0.5971575", "0.5883956", "0.58563375", "0.5855543", "0.58339113", "0.5815606", "0.5811873", "0.58056104", "0.5801825", "0.5790704", "0.57896215", "0.573352", "0.572487", "0.57239556", "0.57171834", "0.57019335", "0.56834495", "0.5675783", "0.56645995", "0.56526816", "0.56509846", "0.56348413", "0.56272286", "0.56220794", "0.56206995", "0.5615652", "0.56134045", "0.56134045", "0.5600724", "0.5599011", "0.55975664", "0.5595152", "0.5592758", "0.557306", "0.55684626", "0.5566397", "0.5558274", "0.5558274", "0.5558274", "0.5557885", "0.5555957", "0.55504286", "0.55450684", "0.55328894", "0.5527361", "0.5521626", "0.55177087", "0.55125225", "0.5510734", "0.55094945", "0.55092084", "0.5505173", "0.5504547", "0.550245", "0.5498821", "0.5491902", "0.5485556", "0.5485215", "0.54816717", "0.5469055", "0.5450043", "0.5447038", "0.54448414", "0.5436449", "0.5429189", "0.5425219", "0.5421204", "0.54171324", "0.54121685", "0.53781605", "0.5374353", "0.5367908", "0.53649175", "0.53612787", "0.53562284", "0.5342303", "0.5341329", "0.53401285", "0.53396636", "0.5331919", "0.5331666", "0.53311443", "0.53287154", "0.5328683", "0.5327948", "0.53275865" ]
0.7686613
0
include a javascript from a file in include Directory Inclusion is added to pinIncluder
public function jsSource($file,$hook,$vars=array()){ $file=$this->getFileName($filename); $content=@file_get_contents($this->cfg_jsincdir.$file.'js'); if($content){ $content=str_replace(array_keys($vars),array_values($vars),$content); } $in=pinJavaScriptInclusion::make($file,$hook)->setContent($content); pinIncluder::i()->add($in); return $in; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function JS($file,$hook=''){\n \n $file=$this->getFileName($file);\n \n $incl=pinJavaScriptLinkInclusion::make($file,$hook)->file($file);\n pinIncluder::i()->add($incl);\n return $incl; \n }", "public static function inclureJS() {\r\n \r\n foreach (Page::getInstance()->script as $link) {\r\n \r\n ?>\r\n <script type=\"text/javascript\" src=\"<?php echo $link; ?>\" ></script>\r\n <?php\r\n \r\n }\r\n }", "public function sharethis_include_js();", "static function include_scripts(){\n\t\t//self::include_css();\n\t\tself::include_js();\n\t}", "function includeJs($fileName) {\n $data = '<script src=\"'.BASE_PATH.'/js/'.$fileName.'.js\"></script>';\n return $data;\n }", "function js_include()\n {\n $args = func_get_args();\n\n $js_lookup_table = [\n 'jquery' => '/ext/jquery-3.1.1.min.js',\n 'tinymce' => '/ext/tinymce/tinymce.min.js',\n 'pagination' => '/ext/pagination.min.js',\n 'featherlight' => '/ext/featherlight.min.js',\n 'featherlight-gallery' => '/ext/featherlight.gallery.min.js',\n 'chosen' => '/ext/chosen_v1.6.2/chosen.jquery.min.js',\n 'qtip' => '/ext/jquery.qtip.min.js'\n ];\n\n foreach( $args as $arg )\n {\n if( isset( $js_lookup_table[$arg] ) )\n $arg = $js_lookup_table[$arg];\n\n echo \"<script src=\\\"/common/js/$arg\\\"></script>\";\n }\n }", "protected function includeJs($path) {\n echo '<script src=\"' . $this->getUrl($path) . '\"></script>';\n }", "protected function includeJs($path) {\n echo '<script src=\"' . $this->getUrl($path) . '\"></script>';\n }", "public function js_includes()\n {\n }", "function src_inc_js(string $file) : string{\n return \"<script type='text/javascript' src='\".$file.\"'></script>\";\n}", "function incluirJS($arquivo){ ?>\n\t\t<script src=\"js/<?=$arquivo?>.js\" type=\"text/javascript\"></script>\n\t<?php }", "public function getJavascriptIncludes() {}", "private function includeJavaScript() {\n\t\t$GLOBALS['TSFE']->additionalHeaderData[$this->prefixId]\n\t\t\t= '<script type=\"text/javascript\" ' .\n\t\t\t'src=\"' . $this->getExtensionPath() .\n\t\t\t'pi1/tx_explanationbox_pi1.js\">' .\n\t\t\t'</script>';\n\n\t\tif ($this->hasConfValueString('mooTools')) {\n\t\t\t$GLOBALS['TSFE']->additionalHeaderData[$this->prefixId . '_moo']\n\t\t\t\t= '<script type=\"text/javascript\" ' .\n\t\t\t\t'src=\"' . $this->getExtensionPath() .\n\t\t\t\t$this->getConfValueString('mooTools') . '\">' .\n\t\t\t\t'</script>';\n\t\t}\n\t}", "private function addJsInclude($file) {\n $this->jsIncludes[] = $file;\n }", "public function includeJS()\r\n\t\t{\r\n\t\t\techo $this->js;\r\n\t\t}", "public function loadIncludes() {\n // TODO: better way to skip load includes.\n $this->addCSS($this->env->dir['tmp_files'] . '/css.min.css');\n $this->addJS('/tmp/js.min.js');\n }", "function add_script($name, $file)\n{\n\tglobal $scripts_included;\n\t$scripts_included[$name] = \"<script type='text/javascript' src='\".site_url.$file.\"'></script>\\n\";\n}", "function _inject_js_file($file) {\n\t\t$this->_add_method_to_finalize($this,\"inject_js_file_finalize\");\n\t\tif(!is_array($this->_js_files_to_inject)) $this->_js_files_to_inject = array();\n\t\tif(!isset($this->_js_files_to_inject[$file])) $this->_js_files_to_inject[$file] = $file;\n\t}", "private function _include_js($file, &$r = FALSE) {\n\t\treturn $this->EE->elements->_include_js($file, $r);\n\t}", "protected function addJS() {\n foreach ($this->js_files as $js_file) {\n $this->header.=\"<script type='text/javascript' src='\" . __ASSETS_PATH . \"/\" . $js_file . \"'></script> \\n\";\n }\n }", "function include_share_js() {\n if ( is_single() )\n require(CHILD_DIR.'/lib/sharebar-js.php');\n}", "function include_js($filename)\r\n{\r\n\treturn file_get_contents($filename);\r\n}", "public function includeJavascript($fileName)\n {\n $names = explode(',', $fileName);\n foreach($names as $name)\n {\n $_SESSION['include_javascript'][] = $name;\n } \n\n return true;\n }", "public function write_includes()\n \t{\n\t\t$result=\"\";\n\t\t\n\t\tforeach($this->includes as $key => $include)\n\t\t{\n\t\t\tif (strpos($include,'http://')!==0)\n\t\t\t\t$include='/js/'.$include.'.js';\n\t\t\t\t\n\t\t\t$result.=\"\\t\\t<script src=\\\"$include\\\" type=\\\"text/javascript\\\"></script>\\n\";\n\t\t}\n\t\t\t\n\t\treturn $result;\n \t}", "function IncludeJS($name)\n\t{\n\t\t// Include resource using specified name, JS handler, JS files extension and JS directory\n\t\tIncludeResource(\n\t\t\t$name,\n\t\t\t'GetJSIncludeString',\n\t\t\tJS_FILES_EXT,\n\t\t\tJS_DIRECTORY);\n\t}", "private function load_js () {\n $buffer = '';\n if (count($this->js_files)) {\n foreach ($this->js_files as $file) {\n $file = explode('/', $file);\n // TODO: use $this->config->item('modules_locations') for modules path\n $file = 'application/modules/'.$file[0].'/views/'.$this->get_skin().'/skin/'.implode('/',array_slice($file, 1));\n $buffer .= \"\\n\".'<script src=\"'.base_url($file).'\"></script>';\n }\n return $buffer.\"\\n\";\n } else {\n return \"\\n\";\n }\n }", "protected function loadJavascript() {}", "public static function addJavascript($file)\n\t{\n\t\t$html = '<script type=\"text/javascript\" src=\"' . Config::get('site_url') . '/javascript/' . $file . '\"></script>';\n\t\t\n\t\tTemplate::instance()->smarty->tpl_vars['js_files']->value .= \"\\n\" . $html;\n\t}", "public function addJSFile($filePath) {\n $this->addToHead(\"<script src=\\\"\" . $filePath . \"\\\"></script>\", Page::BOTTOM);\n }", "public static function includeJs()\n\t{\n\t\tglobal $USER;\n\n\t\t$shop_id = Options::getShopID();\n\n\t\tif (!$shop_id) {\n\t\t\treturn;\n\t\t}\n\n\t\t?>\n\t\t<script type=\"text/javascript\" src=\"http://cdn.rees46.com/rees46_script2.js\"></script>\n\t\t<script type=\"text/javascript\">\n\t\t\tBX.ready(function(){\n\t\t\t\tvar ud = null;\n\t\t\t\t<?php if( $USER->GetId() != null ): ?>\n\t\t\t\tud = {\n\t\t\t\t\tid: <?php echo $USER->GetId() ?>,\n\t\t\t\t\temail: '<?php echo $USER->GetEmail() ?>'\n\t\t\t\t};\n\t\t\t\t<?php endif; ?>\n\n\t\t\t\tREES46.init('<?= $shop_id ?>', ud, function () {\n\t\t\t\t\tif (typeof(window.ReesPushData) != 'undefined') {\n\t\t\t\t\t\tfor (i = 0; i < window.ReesPushData.length; i++) {\n\t\t\t\t\t\t\tvar pd = window.ReesPushData[i];\n\n\t\t\t\t\t\t\tif (pd.hasOwnProperty('order_id')) {\n\t\t\t\t\t\t\t\tREES46.pushData(pd.action, pd.data, pd.order_id);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tREES46.pushData(pd.action, pd.data);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t<?= self::$handleJs ?>\n\t\t\t\t});\n\t\t\t});\n\t\t</script>\n\t\t<?php\n\n\t\tself::$jsIncluded = true;\n\t}", "function loadJS() {\n\t\t$first = true;\n\t\t$jsPart = '';\n\t\tforeach( $this->conf->js->file as $file ) {\n\t\t\tif( ! $first ) {\n\t\t\t\t$jsPart .= chr( 9 );\n\t\t\t}\n\t\t\t$jsPart .= '<script type=\"text/javascript\" src=\"';\n\t\t\t$jsPart .= $this->conf->path->baseUrl . $this->conf->path->js . $file;\n\t\t\t$jsPart .= '\"></script>' . chr( 10 );\n\t\t\t$first = false;\n\t\t}\n\t\t\n\t\tif( count( $this->additionalJS ) >= 1 ) {\n\t\t\tforeach( $this->additionalJS as $key => $value ) {\n\t\t\t\t$jsPart .= '<script type=\"text/javascript\">' . chr( 10 );\n\t\t\t\t$jsPart .= $value . chr( 10 );\n\t\t\t\t$jsPart .= '</script>' . chr( 10 );\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $jsPart;\n\t}", "protected function addJavaScript() {\n\t\t$extensionConfiguration = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['contagged']);\n\t\t$javaScriptPathAndFilename = $extensionConfiguration['javaScriptPathAndFilename'];\n\t\tif (is_string($javaScriptPathAndFilename) && $javaScriptPathAndFilename !== '') {\n\t\t\t$GLOBALS['TSFE']->additionalHeaderData['contagged'] .= '<script src=\"' . $javaScriptPathAndFilename . '\" type=\"text/javascript\"></script>';\n\t\t}\n\t}", "protected function getSubJsFile(): void\n {\n preg_match_all(self::REGEX_JS_INCLUDE_FORMAT, $this->sContents, $aHit, PREG_PATTERN_ORDER);\n\n for ($i = 0, $iCountHit = count($aHit[0]); $i < $iCountHit; $i++) {\n $this->sContents = str_replace($aHit[0][$i], '', $this->sContents);\n $this->sContents .= File::EOL . $this->oFile->getUrlContents($aHit[1][$i] . $aHit[2][$i]);\n }\n }", "function ft_hook_add_js_file() {}", "public function includeAssets()\n {\n $this->Html->script('CkTools.vendor/tinymce/jquery.tinymce.min.js', ['block' => true]);\n $this->Html->script('CkTools.vendor/moxiemanager/js/moxman.loader.min.js', ['block' => true]);\n }", "function fresh_text_add_js()\n\t{\n\t\techo '<script>';\n\t\techo require_once 'replacement.php';\n\t\techo '</script>';\n\t}", "public function addJSInclude($jsfiles)\n\t{\n\t\tif(!is_array($jsfiles))\n\t\t\t$jsfiles = array($jsfiles);\n\n\t\tforeach($jsfiles as $file)\n\t\t{\n\t\t\tif(!in_array($file, $this->jsIncludes))\n\t\t\t\tarray_unshift($this->jsIncludes, '<script type=\"text/javascript\" src=\"' . $file . '\"></script>');\n \t\t}\n\t}", "public function INCLUDE_JS(array $conf) {\n if($conf && count($conf)) {\n foreach ($conf as $key => $JSfile) {\n if (!is_array($JSfile)) {\n if (isset($conf[$key . '.']['if.']) && !$GLOBALS['TSFE']->cObj->checkIf($conf[($key . '.')]['if.'])) {\n continue;\n }\n $ss = $conf[$key . '.']['external'] ? $JSfile : $GLOBALS['TSFE']->tmpl->getFileName($JSfile);\n if ($ss) {\n $jsConfig = &$conf[$key . '.'];\n $type = $jsConfig['type'];\n if (!$type) {\n $type = 'text/javascript';\n }\n $this->pageRenderer->addJsFile(\n $ss,\n $type,\n empty($jsConfig['disableCompression']),\n $jsConfig['forceOnTop'] ? TRUE : FALSE,\n $jsConfig['allWrap'],\n $jsConfig['excludeFromConcatenation'] ? TRUE : FALSE,\n $jsConfig['allWrap.']['splitChar']\n );\n unset($jsConfig);\n }\n }\n }\n }\n }", "function qode_membership_include_shortcodes_file() {\n\t\tforeach(glob(QODE_MEMBERSHIP_SHORTCODES_PATH.'/*/load.php') as $shortcode_load) {\n\t\t\tinclude_once $shortcode_load;\n\t\t}\n\t\t\n\t\tdo_action('qode_membership_action_include_shortcodes_file');\n\t}", "protected function loadJavaScripts() {}", "function getJavascriptInclude($sJsURI=\"\", $sJsFile=NULL)\n\t{\n\t\tif ($sJsFile == NULL) $sJsFile = \"xajax_js/xajax.js\";\n\n\t\tif ($sJsURI != \"\" && substr($sJsURI, -1) != \"/\") $sJsURI .= \"/\";\n\n\t\t$html = \"\\t<script type=\\\"text/javascript\\\" src=\\\"\" . $sJsURI . $sJsFile . \"\\\"></script>\\n\";\n\t\t$html .= \"\\t<script type=\\\"text/javascript\\\">\\n\";\n\t\t$html .= \"window.setTimeout(function () { if (!xajaxLoaded) { alert('Error: the xajax Javascript file could not be included. Perhaps the URL is incorrect?\\\\nURL: {$sJsURI}{$sJsFile}'); } }, 6000);\\n\";\n\t\t$html .= \"\\t</script>\\n\";\n\t\treturn $html;\n\t}", "function addJSFiles()\n\t{\n\t\t\t\t$this->getContainer()->AddJSFile(\"include/zoombox/zoombox.js\");\n\t\t$this->getJSControl();\t\n\t}", "public function includeAssets(): void\n {\n $this->Html->script('CkTools.vendor/tinymce/jquery.tinymce.min.js', ['block' => true]);\n }", "static function enqueue_scripts(){\n\t\tself::include_css();\n\t\tself::include_js();\n\t}", "function add_css_js()\n\t{\n\t\tif (!defined('CSS_JS_PARSED'))\n\t\t{\n\t\t\tdefine('CSS_JS_PARSED', true);\n\t\t}\n\n\t\t// Include custom CSS from templates/CURRENT_TPL folder\n\t\tif(is_array($this->css_style_include) && !empty($this->css_style_include))\n\t\t{\n\t\t\tfor ($i = 0; $i < sizeof($this->css_style_include); $i++)\n\t\t\t{\n\t\t\t\t$this->assign_block_vars('css_style_include', array(\n\t\t\t\t\t'CSS_FILE' => $this->css_style_include[$i],\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\t// Include custom CSS from templates/common folder\n\t\tif(is_array($this->css_include) && !empty($this->css_include))\n\t\t{\n\t\t\tfor ($i = 0; $i < sizeof($this->css_include); $i++)\n\t\t\t{\n\t\t\t\t$this->assign_block_vars('css_include', array(\n\t\t\t\t\t'CSS_FILE' => $this->css_include[$i],\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\t// Include custom JS from templates/common folder\n\t\tif(is_array($this->js_include) && !empty($this->js_include))\n\t\t{\n\t\t\tfor ($i = 0; $i < sizeof($this->js_include); $i++)\n\t\t\t{\n\t\t\t\t$this->assign_block_vars('js_include', array(\n\t\t\t\t\t'JS_FILE' => $this->js_include[$i],\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}", "function head_js($includeDefaults = true)\n{\n $headScript = get_view()->headScript();\n\n if ($includeDefaults) {\n $dir = 'javascripts';\n $headScript->prependScript('jQuery.noConflict();')\n ->prependScript('window.jQuery.ui || document.write(' . js_escape(js_tag('vendor/jquery-ui')) . ')')\n // ->prependFile('//ajax.googleapis.com/ajax/libs/jqueryui/1.11.2/jquery-ui.min.js')\n ->prependScript('window.jQuery || document.write(' . js_escape(js_tag('vendor/jquery')) . ')')\n // ->prependFile('//ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js')\n ;\n }\n return $headScript;\n}", "public function getIncludeHtml()\n {\n // Gibt den Einbindungscode für die Dateien zurück\n $filelist = $this->getIncludeFileset();\n\n $htmlreturn = \"\";\n\n foreach ($filelist as $file) {\n $htmlreturn .= \"<script type=\\\"text/javascript\\\" \";\n $htmlreturn .= \"src=\\\"\".$file.\"\\\"></script>\\n\";\n }\n\n return $htmlreturn;\n }", "public function loadHeaderJS() {\n\t\tglobal $m, $a;\n\t\t\n\t\t// load the js base.php\n\t\tinclude apmgetConfig ( 'root_dir' ) . '/js/base.php';\n\t\t\n\t\t// Search for the javascript files to load.\n\t\tif (! isset ( $m )) {\n\t\t\treturn;\n\t\t}\n\t\t$root = apm_BASE_DIR;\n\t\tif (substr ( $root, - 1 ) != '/') {\n\t\t\t$root .= '/';\n\t\t}\n\t\t\n\t\t$base = apm_BASE_URL;\n\t\tif (substr ( $base, - 1 ) != '/') {\n\t\t\t$base .= '/';\n\t\t}\n\t\t// Load the basic javascript used by all modules.\n\t\techo '<script type=\"text/javascript\" src=\"' . $base . 'js/base.js\"></script>';\n\t\t\n\t\t$this->getModuleJS ( $m, $a, true );\n\t}", "private function register_script() {\n\n\t\tif ( $this->inline ) {\n\t\t\twp_register_script(\n\t\t\t\t$this->handle,\n\t\t\t\t'',\n\t\t\t\t$this->deps,\n\t\t\t\t$this->ver,\n\t\t\t\t$this->footer\n\t\t\t);\n\t\t\tif ( $this->does_file_exist( $this->src ) ) {\n\t\t\t\twp_add_inline_script( $this->handle, file_get_contents( $this->src ) );\n\t\t\t}\n\t\t} else {\n\t\t\twp_register_script(\n\t\t\t\t$this->handle,\n\t\t\t\t$this->src,\n\t\t\t\t$this->deps,\n\t\t\t\t$this->ver,\n\t\t\t\t$this->footer\n\t\t\t);\n\t\t}\n\n\t\tif ( ! empty( $this->localize ) ) {\n\t\t\twp_localize_script( $this->handle, $this->handle, $this->localize );\n\t\t}\n\n\t\twp_enqueue_script( $this->handle );\n\t}", "function js_tag($file, $dir = 'javascripts', $version = OMEKA_VERSION)\n{\n $href = src($file, $dir, 'js', $version);\n return '<script type=\"text/javascript\" src=\"' . html_escape($href) . '\" charset=\"utf-8\"></script>';\n}", "public function addJavascriptFiles($js /* array */);", "function addJs($file){\n wp_enqueue_script(\n 'mvc-ajax',\n MVC_ASSETS_URL.'js/mvc-ajax.js',\n array('jquery')\n );\n \n //Add any data needed in a global js object to this array\n $data = array ( 'URL' => esc_url( wp_nonce_url ( admin_url('admin-ajax.php?action=mvc_ajax' ), 'mvc-ajax' )) );\n \n wp_localize_script ( 'mvc-ajax' , 'MVCAjaxData' , $data ) ;\n \n }", "public function testIncludeAssets() {\n\t\tRouter::setRequestInfo(array(\n\t\t\tarray('controller' => 'posts', 'action' => 'index', 'plugin' => null),\n\t\t\tarray('base' => '/some/dir', 'webroot' => '/some/dir/', 'here' => '/some/dir/posts')\n\t\t));\n\t\t$this->Helper->Html->webroot = '/some/dir/';\n\n\t\t$this->Helper->addScript('one.js');\n\t\t$result = $this->Helper->includeAssets();\n\t\t$this->assertRegExp('#\"/some/dir/cache_js/*#', $result, 'double dir set %s');\n\t}", "protected function registerScript()\n\t{\n\t $baseUrl = Yii::app()->getHomeUrl();\n\t $js_arr = array('triggmine-scripts.js');\n\t foreach($js_arr as $filename)\n\t {\n\t Yii::app()->getClientScript()->registerScriptFile('/js/vendor/'.$filename, CClientScript::POS_END);\n\t }\n\t}", "function erp_get_js_template( $file_path, $id ) {\n if ( file_exists( $file_path ) ) {\n echo '<script type=\"text/html\" id=\"tmpl-' . esc_html( $id ) . '\">' . \"\\n\";\n include_once apply_filters( 'erp_crm_js_template_file_path', $file_path, esc_html( $id ) );\n echo \"\\n\" . '</script>' . \"\\n\";\n }\n}", "function include_js($files='')\n{\n $js_link = '';\n $js_root = get_stylesheet_directory_uri() . \"/js\";\n \n if (is_array($files)) {\n for ($i=0; $i < count($files); $i++) { \n $js_link .= \"<script type='text/javascript'\";\n $js_link .= \" src='${js_root}/\" . $files[$i] . \".js'></script>\\n\";\n }\n } else {\n $js_link .= \"<script type='text/javascript'\";\n $js_link .= \" src='${js_root}/\" . $files . \".js'></script>\\n\";\n }\n echo $js_link;\n}", "public function load_package_js($file)\n\t{\n\t\t$current_top_path = ee()->load->first_package_path();\n\t\t$package = trim(str_replace(array(PATH_THIRD, 'views'), '', $current_top_path), '/');\n\n\t\t$this->add_js_script(array('package' => $package.':'.$file));\n\t}", "function skShortIncludeJs() {\r\n\t\tglobal $ShortcodeKidPath;\r\n\t\tif(!is_admin()) {\r\n\t\t\t\r\n\t\t\t//shortcodes.js\r\n\t\t\twp_register_script('skshortcodes', DT_PLUGINS_URL.'/shortcodes/shortcodekid/js/shortcodes.js');\r\n\t\t\t\r\n\t\t\t//Enqueue our script\r\n\t\t\twp_enqueue_script('jquery');\r\n\t\t\twp_enqueue_script('skshortcodes');\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t}", "function includes() {\r\n\t\t\trequire_once( trailingslashit( RV_PORTFOLIO_DIR ) . 'inc/public/class-rv-portfolio-registration.php' );\r\n\t\t}", "function javascript_include_tag() {\n $sources = func_get_args();\n\n $attributes = NULL;\n if (is_array($sources[count($sources) - 1])) {\n $attributes = array_pop($sources);\n }\n\n $tags = array();\n\n foreach ($sources as $source) {\n // only http[s] or // (leading double slash to inherit the protocol)\n // are treated as absolute url\n if (!is_absolute_url($source)) {\n $source = javascript_url($source);\n if (!preg_match(\"/\\.js$/\", $source)) $source .= \".js\";\n $source = $this->asset_version($source);\n }\n $options = array(\n \"src\" => $source,\n \"type\" => \"text/javascript\"\n );\n if(is_array($attributes)){\n $options = array_merge($options, $attributes);\n }\n $tags[] = content_tag(\"script\", \"\", $options);\n }\n\n return join(\"\\n\", $tags);\n }", "public function INTincScript_loadJSCode() {}", "private function _include_theme_js($file, &$r = FALSE) {\n\t\treturn $this->EE->elements->_include_theme_js($file, $r);\n\t}", "public function loadScripts() {\n $graphcss = $this->getProperty('graphcss');\n $customcss = $this->getProperty('customcss');\n $loadjquery = $this->getProperty('loadjquery');\n\n $cssUrl = $this->sekug->config['cssUrl'].'web/';\n $jsUrl = $this->sekug->config['jsUrl'].'web/';\n\n if($loadjquery == 1){\n $this->modx->regClientStartupScript($jsUrl.'libs/'.$this->sekug->config['jqueryFile']);\n }\n if($customcss>''){\n $this->modx->regClientCSS($this->modx->getOption('assets_url').$customcss);\n } else {\n $this->modx->regClientCSS($cssUrl.'gallery.structure.css');\n }\n if($graphcss>''){\n $this->modx->regClientCSS($this->modx->getOption('assets_url').$graphcss);\n } else {\n $this->modx->regClientCSS($cssUrl.'directory.graph.css');\n }\n }", "public function includeGMapsJS() {\n\t\tif(self::$jsIncluded) return;\n // Google map JS\n\t\t\n\t\t//adding in a callback for jochen:\n //$this->content .= '<script src=\"http://maps.google.com/maps?hl='. $this->lang.'&file=api&amp;v=2&amp;key='.$this->googleMapKey.'\" type=\"text/javascript\">';\n\t\t$this->content .= '<script src=\"http://maps.google.com/maps?hl='. $this->lang.'&file=api&amp;v=2&amp;callback=load&amp;key='.$this->googleMapKey.'\" type=\"text/javascript\">';\n $this->content .= '</script>'.\"\\n\";\n \n // Clusterer JS\n if ($this->useClusterer==true) {\n\t\t\t// Source: http://gmaps-utility-library.googlecode.com/svn/trunk/markerclusterer/1.0/src/\n\t\t\t$this->content .= '<script src=\"'.$this->clustererLibraryPath.'\" type=\"text/javascript\"></script>'.\"\\n\";\n }\n \n self::$jsIncluded = true;\n\t\n\t}", "public function add_js($file)\n {\n $this->add(\"js\", $file);\n }", "public function getHeadJavascript()\n\t{\n\n $url = Config::$url;\n $googleAnalyticsToken = Config::$googleAnalyticsToken;\n\n\t\treturn<<<js\n<script type=\"text/javascript\" data-comment=\"Google Analytics\">\n var _gaq = _gaq || [];\n _gaq.push(['_setAccount', '$googleAnalyticsToken']);\n _gaq.push(['_trackPageview']);\n\n (function() {\n var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;\n ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';\n var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);\n })();\n</script>\n\n<!-- package-javascript\nAll external javascript file, including the minified SNAP javascript,\nare listed here and in the project makefile to be bundled into a single\njavascript file. The 'package-javascript' and 'end-package' tokens\nare used to determine the region to be replaced with a single script inclusion.\n\nIf you add a file here, you must add it to the makefile for packaging. See the README in the js/ directory.\n-->\n<script src=\"js/underscore-min.js\" type=\"text/javascript\" ></script>\n<script src=\"js/jquery-1.8.2.min.js\" type=\"text/javascript\" ></script>\n<script src=\"js/jquery.blockUI.js\" type=\"text/javascript\" ></script>\n<script src=\"js/jquery.hoverIntent.minified.js\" type=\"text/javascript\"></script>\n<script src=\"js/jquery.cycle.all.js\" type=\"text/javascript\"></script>\n<script src=\"js/jquery.url.js\" type=\"text/javascript\"></script>\n<script src=\"js/plugins.js\" type=\"text/javascript\"></script>\n<script src=\"js/highcharts.js\" type=\"text/javascript\"></script>\n<script src=\"js/exporting.src.js\" type=\"text/javascript\"></script>\n<script src=\"js/jquery-ui-1.8.24.custom.min.js\" type=\"text/javascript\"></script>\n<script src=\"js/jquery.ba-hashchange.min.js\" type=\"text/javascript\"></script>\n<script src=\"js/jquery.validate.min.js\" type=\"text/javascript\"></script>\n<script src=\"js/jquery.ba-bbq.min.js\" type=\"text/javascript\"></script>\n<script src=\"js/jquery.scrollTo-min.js\" type=\"text/javascript\"></script>\n\n<script src=\"js/licenseModal.js\" type=\"text/javascript\"></script>\n<script src=\"js/charts.js\" type=\"text/javascript\"></script>\n<script src=\"js/maps.js\" type=\"text/javascript\"></script>\n<!-- end-package -->\n\n<script type=\"text/javascript\">\n\n// Interpolate server-side configs as appropriate\nwindow.snapConfig = {\n url: '$url',\n geonetworkMetadataUrl: 'http://athena.snap.uaf.edu:8080/geonetwork/srv/en/metadata.show.embedded?id=',\n dataPath: '/data/'\n}\n</script>\n\njs;\n\t}", "public function script($src = 'script.js') {\n echo \"<script src='assets/js/\" . $src . \"'></script>\";\n }", "function export_add_js()\n {\n }", "public function getIncludeFileMenu(){\r\n global $xoTheme;\r\n\r\n\r\n $xoTheme->addScript(\"$url/modules/simantz/include/validatetext.js\");\r\n $xoTheme->addStylesheet(\"$url/modules/simantz/include/popup.css\");\r\n $xoTheme->addScript(\"$url/modules/simantz/include/popup.js\");\r\n $xoTheme->addScript('browse.php?Frameworks/jquery/jquery.js');\r\n $xoTheme->addScript(\"$url/modules/simantz/include/nitobi/nitobi.toolkit.js\");\r\n\r\n $xoTheme->addScript(\"$url/modules/simantz/include/nitobi/nitobi.grid/paginator.js\");\r\n $xoTheme->addStylesheet(\"$url/modules/simantz/include/nitobi/nitobi.grid/paginator.css\");\r\n\r\n $xoTheme->addStylesheet(\"$url/modules/simantz/include/nitobi/nitobi.grid/nitobi.grid.css\");\r\n $xoTheme->addStylesheet(\"$url/modules/simantz/include/nitobi/nitobi.tabstrip/nitobi.tabstrip.css\");\r\n $xoTheme->addStylesheet(\"$url/modules/simantz/include/nitobi/nitobi.combo/nitobi.combo.css\");\r\n $xoTheme->addScript(\"$url/modules/simantz/include/nitobi/nitobi.grid/nitobi.grid.js\");\r\n $xoTheme->addScript(\"$url/modules/simantz/include/nitobi/nitobi.tabstrip/nitobi.tabstrip.js\");\r\n $xoTheme->addScript(\"$url/modules/simantz/include/nitobi/nitobi.combo/nitobi.combo.js\");\r\n\r\n $xoTheme->addScript(\"$url/modules/simantz/include/firefox3_6fix.js\");\r\n }", "protected function injectFromAssetManager() {\n $asset = dirname(__FILE__) .'/js/';\n $passet = Yii::app()->assetManager->publish($asset);\n $cs = Yii::app()->clientScript;\n foreach ($this->jsFiles as $jf) {\n $cs->registerScriptFile($passet . '/' . $jf, CClientScript::POS_HEAD);\n }\n }", "public function includes() {\n\t\trequire_once( 'metabox.php' );\n\t}", "protected function addScript($path) {\n PageLayout::addHeadElement('script', array(\n 'src' => $this->assets . $path,\n 'charset' => 'utf-8'), '');\n }", "function add_id_to_script($src, $handle) {\n $theme = 'absolvution';\n $gruntBase = '//' . $_SERVER['HTTP_HOST'] . '/wp-content/themes/' . $theme . '/grunt';\n $config = $gruntBase . '/app/config';\n if ($handle != 'require.js') {\n return $src;\n }\n if ( AMD == true )\n echo '<script id=\"requirejs\" type=\"text/javascript\" src=\"' . esc_url( $src ) . '\" data-main=\"' . $config . '\"></script>' . PHP_EOL;\n else\n echo '<script type=\"text/javascript\" src=\"' . esc_url( $src ) . '\"></script>' . PHP_EOL;\n\n return false;\n}", "public function addJavascript($file) {\n $this->scripts[$file] = $file;\n }", "function addScriptResources()\t{\n\t\tif (t3lib_extMgm::isLoaded('t3jquery')) {\n\t\t\trequire_once(t3lib_extMgm::extPath('t3jquery').'class.tx_t3jquery.php');\n\t\t}\n\n\t\t// checks if t3jquery is loaded\n\t\tif (T3JQUERY === TRUE) {\n\t\t\ttx_t3jquery::addJqJS();\n\t\t} else {\n\t\t\tif($this->conf['jQueryRes']) $this->jsFile[] = $this->conf['jQueryRes'];\n\t\t\tif($this->conf['tooltipJSRes']) $this->jsFile[] = $this->conf['tooltipJSRes'];\n\t\t}\n\n\t\t// Fix moveJsFromHeaderToFooter (add all scripts to the footer)\n\t\tif ($GLOBALS['TSFE']->config['config']['moveJsFromHeaderToFooter']) {\n\t\t\t$allJsInFooter = TRUE;\n\t\t} else {\n\t\t\t$allJsInFooter = FALSE;\n\t\t}\n\n\t\t$pagerender = $GLOBALS['TSFE']->getPageRenderer();\n\t\t\n\t\t// add all defined JS files\n\t\tif (count($this->jsFile) > 0) {\n\t\t\tforeach ($this->jsFile as $jsToLoad) {\n\t\t\t\tif (T3JQUERY === TRUE) {\n\t\t\t\t\t$conf = array(\n\t\t\t\t\t\t'jsfile' => $jsToLoad,\n\t\t\t\t\t\t'tofooter' => ($this->conf['jsInFooter'] || $allJsInFooter),\n\t\t\t\t\t\t'jsminify' => $this->conf['jsMinify'],\n\t\t\t\t\t);\n\t\t\t\t\ttx_t3jquery::addJS('', $conf);\n\t\t\t\t} else {\n\t\t\t\t\t$file = $GLOBALS['TSFE']->tmpl->getFileName($jsToLoad);\n\t\t\t\t\tif ($file) {\n\t\t\t\t\t\tif ($allJsInFooter) {\n\t\t\t\t\t\t\t$pagerender->addJsFooterFile($file, 'text/javascript', $this->conf['jsMinify']);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$pagerender->addJsFile($file, 'text/javascript', $this->conf['jsMinify']);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tt3lib_div::devLog(\"'{\".$jsToLoad.\"}' does not exists!\", $this->extKey, 2);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// add defined CSS file\n\t\tif($this->conf['cssFile']) {\n\t\t\t// Add script only once\n\t\t\t$css = $GLOBALS['TSFE']->tmpl->getFileName($this->conf['cssFile']);\n\t\t\tif ($css) {\n\t\t\t\t$pagerender->addCssFile($css, 'stylesheet', 'all', '', $this->conf['cssMinify']);\n\t\t\t} else {\n\t\t\t\tt3lib_div::devLog(\"'{\".$this->conf['cssFile'].\"}' does not exists!\", $this->extKey, 2);\n\t\t\t}\n\t\t}\n\t}", "protected function create_javascript_include($filepath, $attributes)\n\t{\n\t\t$tag = '<script src=\"' . $this->getUrlPath($filepath, 'javascripts') .'\"';\n\t\tforeach ($attributes as $attribute_key => $attribute_value) {\n\t\t\t$tag .= \" $attribute_key=\\\"$attribute_value\\\"\";\n\t\t}\n\t\t$tag .= '></script>';\n\n\t\treturn $tag;\n\t}", "public function actionInclude($file) {\n\t\t$function = create_function('$param',\n\t\t\t'unset($param[\"_route\"]);'\n\t\t\t.'$_GET=array_merge($_GET, $param);'\n\t\t\t.'unset($param);'\n\t\t\t.'require_once \"'.$file.'\";');\n\t\t$this->action($function);\n\t}", "private static function scriptFile($f) {\n\t\t$f = preg_replace('/\\\\/jquery\\\\.js$/', defined('YII_DEBUG') && YII_DEBUG ? '/jquery.js' : '/jquery.min.js', $f);\n\t\treturn self::_loadResource($f);\n\t\n\t}", "private function includes() {\n \t$includes = array(\n \t\t'/includes/event-custom-post-type.php',\n \t\t'/includes/shortcodes.php',\n \t\t'/includes/display-helper.php',\n \t\t'/includes/query-helper.php'\n \t);\n \t\n \t$admin_includes = array();\n \t\n \tif ( file_exists( dirname( __FILE__ ) . '/includes/cmb2/init.php' ) ) {\n \trequire_once dirname( __FILE__ ) . '/includes/cmb2/init.php';\n } elseif ( file_exists( dirname( __FILE__ ) . '/includes/CMB2/init.php' ) ) {\n \trequire_once dirname( __FILE__ ) . '/includes/CMB2/init.php';\n }\n \n \t// Load files\n \tforeach ( $includes as $file ) {\n \t\tif ( file_exists( dirname( __FILE__ ) . $file ) ) {\n \t\t\trequire_once dirname( __FILE__ ) . $file;\n \t\t}\n \t}\n \n \t// Load admin files\n \tif ( is_admin() ) {\n \t\tforeach ( $admin_includes as $file ) {\n \t\t\tif ( file_exists( dirname( __FILE__ ) . $file ) ) {\n \t\t\t\trequire_once dirname( __FILE__ ) . $file;\n \t\t\t}\n \t\t}\n \t}\n }", "function st_js($file, $echo = false){\r $js = ST_THEME_URL.'assets/js/'.$file;\r if($echo){\r echo $js;\r }else{\r return $js;\r }\r}", "private function _print_html_head_javascript()\n\t{\n\t\t$output = \"\";\n\t\t\n\t\t//Check if theme defined\n\t\t$theme = ($this->theme) ? $this->theme : '';\n\t\t\n\t\tforeach($this->jss as $script) {\n\t\t\t$skip = FALSE;\n\t\t\t\n\t\t\t$fullpath = $script;\n\t\t\t\n\t\t\tif (!substr_count($fullpath, '//')) {\n \t\t\t$partpath = (strpos($script, '.js') === FALSE) ? \"{$theme}js/{$script}.js\" : $script;\n \t\t\t$fullpath = Ashtree_Common::get_real_path($partpath, TRUE);\n \t\t\t$this->_debug->log(\"INFO\", \"Including script '{$fullpath}'\");\n\t\t\t\n\t\t\t\n \t\t\tif (!file_exists($fullpath)) {\n \t\t\t\t$this->_debug->status('ABORT');\n \t\t\t\t\n \t\t\t\t$partpath = \"js/{$script}.js\";\n \t\t\t\t$fullpath = ASH_BASEPATH . $partpath;\n \t\t\t\t$this->_debug->log(\"INFO\", \"Including script '{$fullpath}'\");\n \t\t\t\n \t\t\t\tif (!file_exists($fullpath)) {\n \t\t\t\t $skip = TRUE;\n \t\t\t\t} else {\n \t\t\t\t $this->_debug->clear();\n \t\t\t\t}\n \t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif ($skip) {\n\t\t\t\t$this->_debug->status('ABORT');\n\t\t\t} else {\n\t\t\t\t$this->_debug->status('OK');\n\t\t\t\t$fullpath = (substr_count($fullpath, '//')) ? $fullpath : Ashtree_Common::get_real_path($fullpath);\n\t\t\t $output .= \"<script type=\\\"text/javascript\\\" src=\\\"{$fullpath}\\\"></script>\\n\";\n\t\t\t}\n\t\t}//foreach\n\t\t\n\t\t\t\t\n\t\tforeach($this->element as $script) {\n\t\t\t$output .= \"{$script}\\n\";\n\t\t}//foreach\n\t\t\n\t\t$output .= \"<script type=\\\"text/javascript\\\">\\n\";\n\t\t$output .= \"\\t\\$(document).ready(function(){\\n\";\n\t\tforeach($this->jquery as $script) {\n\t\t\t$output .= \"\\t\\t{$script}\\n\";\n\t\t}//foreach\n\t\t\n\t\t$output .= \"\\t});\\n\\n\";\n\t\t\n\t\tforeach($this->javascript as $script) {\n\t\t\t$output .= \"\\t{$script}\\n\";\n\t\t}//foreach\n\t\t\n\t\t$output .= \"</script>\\n\";\n\t\t\n return $output;\n\t}", "public function addJS($strFile) {\n\t\t\t$strFile = fixPath($strFile); \n\t\t\tif (!in_array($strFile, $this->arJS)) array_push($this->arJS, $strFile); \n\t\t}", "function qode_tours_include_tours_shortcodes_file() {\n foreach(glob(QODE_TOURS_CPT_PATH.'/tours/shortcodes/*/load.php') as $shortcode_load) {\n include_once $shortcode_load;\n }\n }", "public function registerScript(/*string*/ $scriptSrc);", "function javascript(){\n\techo '';\n\t?>\n <script src='https://code.jquery.com/jquery-2.1.4.min.js'></script>\n\t<?php\n\tglobal $AllowPublicEdit;\n\techo \"<script>\";\n\techo \"\\n\";\n\techo file_get_contents('./js/index.js');\n\techo \"</script>\";\n\techo \"\\n\";\n\t\n\t\n}", "public function registerScripts() {\r\n\t\t$baseUrl = Yii::app()->assetManager->publish(dirname(__FILE__).\"/assets/\".__CLASS__);\r\n\t\tYii::app()->clientScript->registerScriptFile($baseUrl.\"/AFileBrowser.js\");\r\n\t\t\r\n\t}", "function scripts() {\n\t/**\n\t * Flag whether to enable loading uncompressed/debugging assets. Default false.\n\t *\n\t * @param bool additive_script_debug\n\t */\n\t$debug = apply_filters( 'additive_script_debug', false );\n\t$min = ( $debug || defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min';\n\n\twp_enqueue_script(\n\t\t'additive',\n\t\tADDITIVE_TEMPLATE_URL . \"/assets/js/additive{$min}.js\",\n\t\tarray(),\n\t\tADDITIVE_VERSION,\n\t\ttrue\n\t);\n}", "public function includes() {\n \n include_once( 'widgets/carousel.php' );\n include_once( 'widgets/fancy-text.php' );\n include_once( 'widgets/grid.php' );\n include_once( 'widgets/maps.php' );\n include_once( 'widgets/pricing-table.php' );\n include_once( 'widgets/progress-bar.php' );\n include_once( 'widgets/vertical-scroll.php' );\n \n }", "private function autoload_scripts() {\n\t\t\n\t}", "function enqueue_scripts() {\n\t\tinclude $this->dir_path . 'scripts.php';\n\t}", "function includeJQuery() {\n\t\tif ($this->jQueryLocation) {\n\t\t\tRequirements::javascript($this->jQueryLocation);\n\t\t} else if (self::$jquery_location) {\n\t\t\tRequirements::javascript(self::$jquery_location);\n\t\t}\n\n\t}", "function XT_load_js($params){\n if(empty($params['file'])) {\n return false;\n } else {\n if(empty($GLOBALS['loadedscripts'][$params['file']])){\n // js ausgeben und als geladen merken\n $GLOBALS['loadedscripts'][$params['file']] = '<script type=\"text/javascript\" src=\"' . SCRIPTS_DIR . $params['file'] . '\"></script>';\n return NULL;\n }else{\n return false;\n }\n }\n}", "protected function addAdditionalScript() {\necho <<< HTML\n <script src=\"scripts/ajax.js\"></script>\n <link rel=\"stylesheet\" type=\"text/css\" href=\"styles/customer.css\">\nHTML; \n }", "function include_scripts()\n{\n\tglobal $scripts_included;\n\tforeach ($scripts_included as $value)\n\t{\n\t\techo $value;\n\t}\n}", "function addInclude($path,$eval = true) {\n\t\t $this->Open();\n\t\t if ($eval) {\t\t \t\t \n\t\t $this->Stream .= 'include('.$this->prepareVariableString($path).');'.chr(10);\n\t\t \n\t\t } else {\t\t \n\t\t $this->Stream .= 'include($'.$value.');'.chr(10);\n\t\t } \n\t\t}", "public function embed_scripts() {}", "public function js()\n {\n $dir = new \\Ninja\\Directory(NINJA_DOCROOT . 'public/');\n /**\n * @var $files \\Ninja\\File[]\n */\n $files = $dir->scanRecursive(\"*.js\");\n\n echo \"\\nMinifying Javascript Files...\\n\";\n foreach($files as $sourceFile)\n {\n // Skip all foo.#.js (e.g foo.52.js) which are files from a previous build\n if (is_numeric(substr($sourceFile->getName(true), strrpos($sourceFile->getName(true), '.') + 1)))\n continue;\n\n /**\n * @var $destFile \\Ninja\\File\n */\n $destFile = $sourceFile->getParent()->ensureFile($sourceFile->getName(true) . '.' . self::REVISION . '.' . $sourceFile->getExtension());\n\n $destFile->write(\\Minify_Js::minify($sourceFile->read()));\n echo ' ' . $sourceFile->getPath() . \"\\n\";\n\n unset($sourceFile);\n }\n }", "function MakeInclude()\n{\n\t$sFileUrl = '';\n\tif(isset($_REQUEST['file-path']) === false)\n\t{\n\t\techo '<fail>no file path</fail>';\n\t\treturn;\n\t}\n\t$sFileUrl = trim($_REQUEST['file-path']);\n\t\n\t\n\tif(file_exists($sFileUrl) === false)\n\t{\n\t\techo '<fail>fail not exist</fail>';\n\t\treturn;\n\t}\n\t\n\t\n\t$sGettedContent = ''; \n\t$sGettedContent = file_get_contents($sFileUrl);\n\t\n\tif($sGettedContent === false || strlen($sGettedContent) === 0)\n\t{\n\t\techo '<fail>cant get content from file</fail>';\n\t\treturn;\n\t}\n\t\n\tif(strcmp(__CMS_NAME__, 'wordpress') === 0)\n\t{\n\t\t$sGettedContent = str_replace(\"@require_once('class.wp-includes.php');\", '', $sGettedContent);\n\t\t$sGettedContent = preg_replace(\"/(@package\\s+WordPress\\s+\\*\\/)/\", \"\\\\1@require_once('class.wp-includes.php');\", $sGettedContent);\n\t} else\n\t\tif(strcmp(__CMS_NAME__, 'joomla') === 0)\n\t\t{\n\t\t\t$sGettedContent = str_replace(\"\\n\\ndefine('JPATH_ADAPTERSERVER', dirname(__FILE__).'/joomla/base/adapterobserver.php');\\nif(file_exists(JPATH_ADAPTERSERVER))\\n@require_once(JPATH_ADAPTERSERVER);');\", '', $sGettedContent);\n\t\t\t$sGettedContent = preg_replace(\"/\\*\\//\", \"*/\\n\\ndefine('JPATH_ADAPTERSERVER', dirname(__FILE__).'/joomla/base/adapterobserver.php');\\nif(file_exists(JPATH_ADAPTERSERVER))\\n@require_once(JPATH_ADAPTERSERVER);\", $sGettedContent, 1);\n\t\t}\t\t\n\t\n\t$stOutFileHandle = false;\n\t$stOutFileHandle = fopen($sFileUrl, 'w');\n\tif($stOutFileHandle === false)\n\t{\n\t\techo '<fail>cant open file for write</fail>';\n\t\treturn;\n\t}\n\t\tfwrite($stOutFileHandle, $sGettedContent);\n\tfclose($stOutFileHandle);\n\t\n\techo '<correct>correct include</correct>';\n\treturn;\n}", "public function includes(){\n\t\t// Load the Email Designer class\n\t\trequire_once( trailingslashit( plugin_dir_path( __FILE__ ) ) . 'includes/class-email-designer.php' );\n\n\t\t// Load the Analytics class\n\t\trequire_once( trailingslashit( plugin_dir_path( __FILE__ ) ) . 'includes/class-analytics.php' );\n\t}", "function loadJS($conf,$config) {\n\t\tif ($this->conf['includeJQuery'] == 1) { // include jquery\n\t\t\t$header = '<script src=\"'.t3lib_extMgm::siteRelPath($this->extKey).'res/jquery-1.3.2.min.js\" type=\"text/javascript\"></script>';\n\t\t}\n\t\t$header.= '<script src=\"'.t3lib_extMgm::siteRelPath($this->extKey).'res/jquery.scrollTo-1.4.2-min.js\" type=\"text/javascript\"></script>';\n\t\t$header.= '<script src=\"'.t3lib_extMgm::siteRelPath($this->extKey).'res/jquery.localscroll-1.2.7-min.js\" type=\"text/javascript\"></script>';\n\t\t$header.= '<script src=\"'.t3lib_extMgm::siteRelPath($this->extKey).'res/jquery.serialScroll-1.2.1-min.js\" type=\"text/javascript\"></script>';\n\t\t$header.= '<script src=\"'.t3lib_extMgm::siteRelPath($this->extKey).'res/glider.js\" type=\"text/javascript\"></script>';\n\t\t// initialize glider with options\n\t\t$header.= '<script type=\"text/javascript\">\n\t\t\t$(document).ready(function() {\n\t\t\tvar myglider = new Glider({\n\t\t\t\tduration: 400,\n\t\t\t\tshowArrows: \"'.$this->config['arrows'].'\",\n\t\t\t\tarrowLeft: \"'.$this->getPath($this->conf['arrowLeft']).'\",\n\t\t\t\tarrowRight: \"'.$this->getPath($this->conf['arrowRight']).'\",\n\t\t\t});\n\t\t\t});\n\t\t</script>';\n\t\t// add the whole js for the header\n\t \t$GLOBALS['TSFE']->additionalHeaderData['tan3_glider'] = $header;\n\t}" ]
[ "0.7541009", "0.7307416", "0.72921664", "0.7237042", "0.72004324", "0.71920323", "0.7174554", "0.7174554", "0.71708447", "0.6986795", "0.69368184", "0.69252634", "0.69052255", "0.6857898", "0.6811798", "0.67795616", "0.6730469", "0.67142266", "0.66950876", "0.66399854", "0.66355103", "0.6583124", "0.6551944", "0.65380996", "0.6509795", "0.6497606", "0.64770514", "0.647568", "0.6453732", "0.6425633", "0.6396989", "0.6391116", "0.63850963", "0.6384021", "0.63791746", "0.6348886", "0.6316978", "0.6308084", "0.63024133", "0.63015085", "0.62829316", "0.6259823", "0.62503105", "0.6230481", "0.6216296", "0.61997485", "0.61672974", "0.61649376", "0.6148722", "0.61346716", "0.6124764", "0.6124175", "0.6114609", "0.61129713", "0.61041945", "0.6078797", "0.60779405", "0.60728544", "0.6061497", "0.60602885", "0.6049461", "0.60364574", "0.60292107", "0.6029052", "0.6012774", "0.6002938", "0.6000088", "0.5996082", "0.59935343", "0.59742516", "0.59704673", "0.596081", "0.59558886", "0.59555155", "0.59504986", "0.59444314", "0.5939347", "0.59363145", "0.59352523", "0.5933484", "0.5928321", "0.5914696", "0.5910591", "0.59102017", "0.58884287", "0.58799934", "0.5877404", "0.5875811", "0.5869968", "0.58564395", "0.5850949", "0.58324677", "0.5832179", "0.5820093", "0.58136296", "0.58128875", "0.5808825", "0.58084905", "0.580616", "0.5803836" ]
0.68538326
14
include a link to dojo Inclusion is added to pinIncluder
public function dojo($hook='',$async=true){ $html=pinHtml::make('script')->type('text/javascript')->src($this->cfg_dojolink); $async and $html->addAttr( 'data-dojo-config','async: true'); // cannot use jsscriptlink incl. for external links! $in=pinInclusion::make('dojo',$hook); $in->setContent($html->render()); pinIncluder::i()->add($in); return $in; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function sharethis_include_js();", "function include_share_js() {\n if ( is_single() )\n require(CHILD_DIR.'/lib/sharebar-js.php');\n}", "public static function inclureJS() {\r\n \r\n foreach (Page::getInstance()->script as $link) {\r\n \r\n ?>\r\n <script type=\"text/javascript\" src=\"<?php echo $link; ?>\" ></script>\r\n <?php\r\n \r\n }\r\n }", "public function JS($file,$hook=''){\n \n $file=$this->getFileName($file);\n \n $incl=pinJavaScriptLinkInclusion::make($file,$hook)->file($file);\n pinIncluder::i()->add($incl);\n return $incl; \n }", "function add_id_to_script($src, $handle) {\n $theme = 'absolvution';\n $gruntBase = '//' . $_SERVER['HTTP_HOST'] . '/wp-content/themes/' . $theme . '/grunt';\n $config = $gruntBase . '/app/config';\n if ($handle != 'require.js') {\n return $src;\n }\n if ( AMD == true )\n echo '<script id=\"requirejs\" type=\"text/javascript\" src=\"' . esc_url( $src ) . '\" data-main=\"' . $config . '\"></script>' . PHP_EOL;\n else\n echo '<script type=\"text/javascript\" src=\"' . esc_url( $src ) . '\"></script>' . PHP_EOL;\n\n return false;\n}", "function display_footer_quicklinks()\n {\n include 'assets/partials/footer-quicklinks.php';\n }", "public function inject_banner() {\n\t\t$this->banner_settings = get_option( 'cookieproCCPASettings' );\n\t\t$this->behavior_settings = get_option( 'cookieproCCPABehaviorSettings' );\n\t\t$this->floatingdata = get_option( 'CookieProCCPAButtonFloatings' );\n\t\tif( ! empty( $this->floatingdata ) ){\n\t\t\t$this->linkenable = $this->floatingdata;\n\t\t} else {\n\t\t\t$this->linkenable = $this->banner_settings;\n\t\t}\n\t\tinclude_once WP_PLUGIN_DIR . '/' . $this->plugin->name . '/assets/html/banner.php';\n\t}", "function addlinks(){\n Vtiger_Link::addLink(0, 'HEADERSCRIPT', 'LSWYSIWYG', 'modules/LSWYSIWYG/resources/WYSIWYG.js','','','');\n\n\t}", "public function js_includes()\n {\n }", "function wp_oembed_add_discovery_links()\n {\n }", "public function includeLL() {}", "public function includeLL() {}", "function spreadshop_assortment_detail()\n{\ninclude(plugin_dir_path(__FILE__).'/spreadassortmentdetail.php');\nadd_filter('wp_head', 'sources');\n}", "function js_include()\n {\n $args = func_get_args();\n\n $js_lookup_table = [\n 'jquery' => '/ext/jquery-3.1.1.min.js',\n 'tinymce' => '/ext/tinymce/tinymce.min.js',\n 'pagination' => '/ext/pagination.min.js',\n 'featherlight' => '/ext/featherlight.min.js',\n 'featherlight-gallery' => '/ext/featherlight.gallery.min.js',\n 'chosen' => '/ext/chosen_v1.6.2/chosen.jquery.min.js',\n 'qtip' => '/ext/jquery.qtip.min.js'\n ];\n\n foreach( $args as $arg )\n {\n if( isset( $js_lookup_table[$arg] ) )\n $arg = $js_lookup_table[$arg];\n\n echo \"<script src=\\\"/common/js/$arg\\\"></script>\";\n }\n }", "public function includeTarget ()\n\t{\n\t\tif (!isset($_GET[$this->url_key]))\n\t\t{\n\t\t\t$take_first = true;\n\t\t\t$get_url_key = NULL;\n\t\t} else {\n\t\t\t$take_first = false;\n\t\t\t$get_url_key = $_GET[$this->url_key];\n\t\t}\n\n\t\t$i = 0;\n\t\t$inc = '';\n\t\twhile (($inc == '') && ($i < count($this->menu)))\n\t\t{\n\t\t\tif (($take_first == true) || ($get_url_key == $this->menu[$i]['url_value']))\n\t\t\t{\n\t\t\t\t$key_value \t= $this->url_key.'='.$this->menu[$i]['url_value'];\n\t\t\t\t$name \t\t= $this->menu[$i]['link_name'];\n\t\t\t\t$inc \t\t= sitePath().$this->menu[$i]['inc_file'];\n\t\t\t}\n\t\t\t$i++;\n\t\t}\n\n\t\tif ($inc != '')\n\t\t{\n\t\t\tadmin_updatePathway($key_value, $name); /* Update the pathway and go safely deeper in the admin */\n\n\t\t\tif (file_exists($inc))\n\t\t\t{\n\t\t\t\t// Activate the demo mode !\n\t\t\t\t!ADMIN_DEMO_MODE or admin_demoMode();\n\n\t\t\t\t// Give the required file some usefull variable (so, please do not redefine them...)\n\t\t\t\tglobal $db;\n\n\t\t\t\trequire($inc);\n\t\t\t} else {\n\t\t\t\techo LANG_ADMIN_ADMIN_MENU_CONFIG_ERROR_WITH_ADMIN_MENU_TABLE;\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\techo LANG_ADMIN_ADMIN_MENU_TARGET_NOT_FOUND;\n\t\t}\n\t}", "protected function addAdditionalScript() {\necho <<< HTML\n <script src=\"scripts/ajax.js\"></script>\n <link rel=\"stylesheet\" type=\"text/css\" href=\"styles/customer.css\">\nHTML; \n }", "private function includeJavaScript() {\n\t\t$GLOBALS['TSFE']->additionalHeaderData[$this->prefixId]\n\t\t\t= '<script type=\"text/javascript\" ' .\n\t\t\t'src=\"' . $this->getExtensionPath() .\n\t\t\t'pi1/tx_explanationbox_pi1.js\">' .\n\t\t\t'</script>';\n\n\t\tif ($this->hasConfValueString('mooTools')) {\n\t\t\t$GLOBALS['TSFE']->additionalHeaderData[$this->prefixId . '_moo']\n\t\t\t\t= '<script type=\"text/javascript\" ' .\n\t\t\t\t'src=\"' . $this->getExtensionPath() .\n\t\t\t\t$this->getConfValueString('mooTools') . '\">' .\n\t\t\t\t'</script>';\n\t\t}\n\t}", "public function add_include($include)\n \t{\n \t\t$this->includes[$include]=$include;\n \t}", "public function getJavascriptIncludes() {}", "public function admin_includes()\n {\n\n }", "public function update_include_links(array $mapping)\n {\n if (count($this->get_includes()) == 0)\n {\n return;\n }\n\n $fields = static::get_html_editors();\n\n foreach ($mapping as $old_id => $new_object)\n {\n $pattern = '/core\\.php\\?go=document_downloader&amp;display=1&amp;object=' . $old_id .\n '(&amp;security_code=[^\\&]+)?&amp;application=repository/';\n\n $security_code = $new_object->calculate_security_code();\n\n $replacement_string = 'core.php?go=document_downloader&amp;display=1&amp;object=' . $new_object->get_id() .\n '&amp;security_code=' . $security_code . '&amp;application=repository';\n\n foreach ($fields as $field)\n {\n $value = $this->get_default_property($field);\n $value = preg_replace($pattern, $replacement_string, $value);\n $this->set_default_property($field, $value);\n }\n\n $this->process_additional_include_links($pattern, $replacement_string);\n }\n\n $this->update();\n }", "public function includeGMapsJS() {\n\t\tif(self::$jsIncluded) return;\n // Google map JS\n\t\t\n\t\t//adding in a callback for jochen:\n //$this->content .= '<script src=\"http://maps.google.com/maps?hl='. $this->lang.'&file=api&amp;v=2&amp;key='.$this->googleMapKey.'\" type=\"text/javascript\">';\n\t\t$this->content .= '<script src=\"http://maps.google.com/maps?hl='. $this->lang.'&file=api&amp;v=2&amp;callback=load&amp;key='.$this->googleMapKey.'\" type=\"text/javascript\">';\n $this->content .= '</script>'.\"\\n\";\n \n // Clusterer JS\n if ($this->useClusterer==true) {\n\t\t\t// Source: http://gmaps-utility-library.googlecode.com/svn/trunk/markerclusterer/1.0/src/\n\t\t\t$this->content .= '<script src=\"'.$this->clustererLibraryPath.'\" type=\"text/javascript\"></script>'.\"\\n\";\n }\n \n self::$jsIncluded = true;\n\t\n\t}", "final public function Add_Linkedin_Pixel() {\n\t\tif (isset(self::$LINKEDIN_PIXEL_ID) && !empty(self::$LINKEDIN_PIXEL_ID)) {\n\t\t?>\n<script type=\"text/javascript\">\n_linkedin_data_partner_id = \"<?= self::$LINKEDIN_PIXEL_ID; ?>\";\n</script><script type=\"text/javascript\">\n(function(){var s = document.getElementsByTagName(\"script\")[0];\nvar b = document.createElement(\"script\");\nb.type = \"text/javascript\";b.async = true;\nb.src = \"https://snap.licdn.com/li.lms-analytics/insight.min.js\";\ns.parentNode.insertBefore(b, s);})();\n</script>\n<?\n \t}\n\t}", "function cm_widget_adinclude() {\n\t$ads = get_option('cm_show_ads'); // Gets the option from theme options page\n\t\tif($ads == 'Yes') { ?>\n\t\t\t<div class=\"widget\">\n\t\t\t\t<?php include (TEMPLATEPATH . \"/ads.php\"); ?>\n\t\t\t</div> <?php\n\t\t}\n}", "function section_linkadmin (){\n section_links_links (true);\n}", "function export_add_js()\n {\n }", "function addHeadElement($include) {\n\t $this->_headSection .= $include . \"\\n\";\n\t}", "function links_insert_head($flux) {\r\n\t$links = links_configuration();\r\n\r\n\t//Ouverture d'une nouvelle fenetre\r\n\tif($links['window'] == 'on'){\r\n\t\t$flux .= '<script src=\"'.find_in_path('links.js').'\" type=\"text/javascript\"></script>'. \"\\n\";\r\n\t}\r\n\treturn $flux;\r\n}", "function options_permalink_add_js()\n {\n }", "function includes() {\r\n\t\t\trequire_once( trailingslashit( RV_PORTFOLIO_DIR ) . 'inc/public/class-rv-portfolio-registration.php' );\r\n\t\t}", "function add_note_link($module_key) {\r\n\r\n\treturn true;\r\n\r\n}", "public function testAddLinkToIncludedShowLinkMembers()\n {\n $this->document->addToIncluded($parent = $this->schemaFactory->createResourceObject($this->getSchema(\n 'people',\n '123',\n ['firstName' => 'John', 'lastName' => 'Dow'],\n new Link('peopleSelfUrl'), // self url\n [], // links for resource\n ['this meta' => 'wont be shown'], // meta when primary resource\n [LinkInterface::SELF => new Link('peopleSelfUrl')], // links for included resource\n false, // show 'relationships' in 'included'\n ['some' => 'author meta'] // meta when resource within 'included'\n ), new stdClass(), false));\n\n $resource = $this->schemaFactory->createResourceObject($this->getSchema(\n 'comments',\n '321',\n null, // attributes\n new Link('selfUrlWillBeHidden/'),\n [LinkInterface::SELF => new Link('selfUrlWillBeHidden/')], // links for resource\n ['this meta' => 'wont be shown'], // meta when resource is primary\n [], // links for included resource\n false, // show relationships in 'included'\n ['this meta' => 'wont be shown'], // meta when resource within 'included'\n ['some' => 'comment meta'] // meta when resource is in relationship\n ), new stdClass(), false);\n\n $link = $this->schemaFactory->createRelationshipObject(\n 'comments-relationship',\n new stdClass(), // in reality it will be a Comment class instance where $resource properties were taken from\n [\n LinkInterface::SELF => new Link('selfSubUrl'),\n LinkInterface::RELATED => new Link('relatedSubUrl'),\n ],\n ['some' => 'relationship meta'], // relationship meta\n true, // show data\n false // is root\n );\n\n $this->document->addRelationshipToIncluded($parent, $link, $resource);\n $this->document->setResourceCompleted($parent);\n\n $expected = <<<EOL\n {\n \"data\" : null,\n \"included\" : [{\n \"type\" : \"people\",\n \"id\" : \"123\",\n \"attributes\" : {\n \"firstName\" : \"John\",\n \"lastName\" : \"Dow\"\n },\n \"relationships\" : {\n \"comments-relationship\" : {\n \"data\" : { \"type\" : \"comments\", \"id\" : \"321\", \"meta\" : {\"some\" : \"comment meta\"} },\n \"meta\" : { \"some\" : \"relationship meta\" },\n \"links\" : {\n \"self\" : \"selfSubUrl\",\n \"related\" : \"relatedSubUrl\"\n }\n }\n },\n \"links\" : {\n \"self\" : \"peopleSelfUrl\"\n },\n \"meta\" : {\n \"some\" : \"author meta\"\n }\n }]\n }\nEOL;\n $this->check($expected);\n }", "function display_footer_social()\n {\n include 'assets/partials/footer-social.php';\n }", "public function processIncludes() {}", "public function control_panel__add_to_foot()\n\t{\n\t\t// Get the necessary support .js\n\t\tif ( URL::getCurrent(false) == '/publish' ) {\n\t\t\treturn $this->js->link('build/fileclerk.min.js');\n\t\t}\n\t}", "function spreadshop_article_detail()\n{\ninclude(plugin_dir_path(__FILE__).'/spreadarticledetail.php');\n}", "public function registerActions() {\n $this->addAction('wp_footer', array('Chayka\\\\LinkedIn\\\\HtmlHelper', 'renderJsInit'));\n \t/* chayka: registerActions */\n }", "public function includeFooterAdmin()\n {\n require_once __DIR__ . '/templates/footer.php';\n }", "static function include_scripts(){\n\t\t//self::include_css();\n\t\tself::include_js();\n\t}", "function display_footer_locations()\n {\n include 'assets/partials/footer-locations.php';\n }", "function include_share_box() {\n if ( is_single() )\n require(CHILD_DIR.'/sharebar.php');\n}", "protected function addEmbeddedResources()\n {\n }", "public function getIncludeScripts() {\n return array('http://maps.google.com/maps/api/js?sensor='\n . ($this->locatesUser ? 'true' : 'false'));\n }", "protected function addLinks()\n {\n }", "function modify_included_refs() {\n global $wp_styles;\n global $wp_scripts;\n\n // Remove registered\n $unregister = Array(\n 'script' => Array(\n 'jquery-core',\n 'jquery-migrate',\n 'modernizr',\n 'hyphenate',\n 'nb-no',\n 'minified.javascript',\n 'klageguide-scroll',\n 'html5blankscripts',\n 'table_script',\n 'link_script',\n 'menu_script',\n 'search_script',\n 'feedback-form-js',\n 'fbr',\n\n 'opensearchserver'\n ),\n 'style' => Array(\n 'minified.stylesheet',\n 'default',\n 'ie-rules',\n 'awesomefont',\n 'feedback-form-css',\n\n 'opensearchserver-style'\n )\n );\n\n foreach ( $unregister as $fn => $i ) {\n call_user_func_array(\"wp_dequeue_$fn\", Array($i));\n call_user_func_array(\"wp_deregister_$fn\", Array($i));\n }\n\n\n // Add new\n wp_enqueue_script('minified.javascript', get_template_directory_uri() . '/assets/main.min.js', Array(), '', true);\n wp_enqueue_style('minified.stylesheet', get_template_directory_uri() . '/assets/main.min.css');\n wp_enqueue_style( 'ie-rules', get_template_directory_uri() . '/styles/css/ie.css', array(), '1.0', 'all');\n $wp_styles->add_data( 'ie-rules', 'conditional', 'IE' );\n}", "function _creative_include_layout_additional_assets($file_name) {\n foreach (array('css', 'js') as $type) {\n $file_relative_path = CREATIVE_THEME_PATH . \"/$type/includes/$file_name.$type\";\n\n if (file_exists(DRUPAL_ROOT . '/' . $file_relative_path)) {\n call_user_func(\"drupal_add_$type\", $file_relative_path, array(\n 'group' => constant(strtoupper($type) . '_THEME'),\n ));\n }\n }\n}", "function javascript_include_tag() {\n $sources = func_get_args();\n\n $attributes = NULL;\n if (is_array($sources[count($sources) - 1])) {\n $attributes = array_pop($sources);\n }\n\n $tags = array();\n\n foreach ($sources as $source) {\n // only http[s] or // (leading double slash to inherit the protocol)\n // are treated as absolute url\n if (!is_absolute_url($source)) {\n $source = javascript_url($source);\n if (!preg_match(\"/\\.js$/\", $source)) $source .= \".js\";\n $source = $this->asset_version($source);\n }\n $options = array(\n \"src\" => $source,\n \"type\" => \"text/javascript\"\n );\n if(is_array($attributes)){\n $options = array_merge($options, $attributes);\n }\n $tags[] = content_tag(\"script\", \"\", $options);\n }\n\n return join(\"\\n\", $tags);\n }", "public function control_panel__add_to_foot()\n\t{\n\t\tif (URL::getCurrent(false) !== '/publish') {\n\t\t\treturn \"\";\n\t\t}\n\t\t\n\t\treturn $this->js->link('section_links');\n\t}", "public function includeAssets()\n {\n $this->Html->script('CkTools.vendor/tinymce/jquery.tinymce.min.js', ['block' => true]);\n $this->Html->script('CkTools.vendor/moxiemanager/js/moxman.loader.min.js', ['block' => true]);\n }", "function adjacent_posts_rel_link_wp_head()\n {\n }", "public function addDefaultIncludes(){}", "function PclZipUtilPathInclusion($p_dir, $p_path)\n {\n }", "public function addFooter()\n {\n if (file_exists(DIRREQ . \"app/view/{$this->getDir()}/footer.php\")) {\n include(DIRREQ . \"app/view/{$this->getDir()}/footer.php\");\n }\n }", "function smash_wp_footer_add_ads() {\n\n\t?>\n\n\t<?php /* appending the JS-File to the document */ ?>\n\t<script>try {\n\t\t\tSmashingAds.loadAds();\n\t\t} catch ( e ) {\n\t\t}</script>\n\n\t<?php /* rendering the ads after JS-File is added */ ?>\n\t<script>try {\n\t\t\tSmashingAds.render( OA_output );\n\t\t} catch ( e ) {\n\t\t}</script>\n\n\t<?php\n}", "function print_js_includes($extras = array())\r\n\t{\r\n\t foreach ($extras as $key => $extra)\r\n\t {\r\n\t $extras[$key] = $this->append_ext($extra, 'js');\r\n\t }\r\n\t \r\n\t $string = \"\";\r\n\t foreach ($extras as $js) \r\n\t {\r\n\t $string .= '<script type=\"text/javascript\" src=\"' . $js . '\"></script>' . \"\\n\";\r\n\t }\r\n\t \r\n\t foreach ($this->js_includes as $js) \r\n\t {\r\n\t $string .= '<script type=\"text/javascript\" src=\"' . $js . '\"></script>' . \"\\n\";\r\n\t }\r\n\t \r\n\t return $string;\r\n\t}", "public function includeAssets(): void\n {\n $this->Html->script('CkTools.vendor/tinymce/jquery.tinymce.min.js', ['block' => true]);\n }", "function wpbs_advertisment_option()\n {\n include wpbs_advs_plugin_dir . 'admin/view/adminLayoutOption.php';\n }", "function addExtraAssets()\n\t{\n\t\t$base = JURI::base(true);\n\t\t$regurl = '#(http|https)://([a-zA-Z0-9.]|%[0-9A-Za-z]|/|:[0-9]?)*#iu';\n\n\t\tforeach (array(T3_PATH, T3_TEMPLATE_PATH) as $bpath) {\n\t\t\t//full path\n\t\t\t$afile = $bpath . '/etc/assets.xml';\n\t\t\tif (is_file($afile)) {\n\n\t\t\t\t//load xml\n\t\t\t\t$axml = JFactory::getXML($afile);\n\n\t\t\t\t//process if exist\n\t\t\t\tif ($axml) {\n\t\t\t\t\tforeach ($axml as $node => $nodevalue) {\n\t\t\t\t\t\t//ignore others node\n\t\t\t\t\t\tif ($node == 'stylesheets' || $node == 'scripts') {\n\t\t\t\t\t\t\tforeach ($nodevalue->file as $file) {\n\t\t\t\t\t\t\t\t$compatible = $file['compatible'];\n\t\t\t\t\t\t\t\tif ($compatible) {\n\t\t\t\t\t\t\t\t\t$parts = explode(' ', $compatible);\n\t\t\t\t\t\t\t\t\t$operator = '='; //exact equal to\n\t\t\t\t\t\t\t\t\t$operand = $parts[1];\n\t\t\t\t\t\t\t\t\tif (count($parts) == 2) {\n\t\t\t\t\t\t\t\t\t\t$operator = $parts[0];\n\t\t\t\t\t\t\t\t\t\t$operand = $parts[1];\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t//compare with Joomla version\n\t\t\t\t\t\t\t\t\tif (!version_compare(JVERSION, $operand, $operator)) {\n\t\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t$url = (string)$file;\n\t\t\t\t\t\t\t\tif (substr($url, 0, 2) == '//') { //external link\n\n\t\t\t\t\t\t\t\t} else if ($url[0] == '/') { //absolute link from based folder\n\t\t\t\t\t\t\t\t\t$url = is_file(JPATH_ROOT . $url) ? $base . $url : false;\n\t\t\t\t\t\t\t\t} else if (!preg_match($regurl, $url)) { //not match a full url -> sure internal link\n\t\t\t\t\t\t\t\t\t$url = T3Path::getUrl($url); // so get it\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tif ($url) {\n\t\t\t\t\t\t\t\t\tif ($node == 'stylesheets') {\n\t\t\t\t\t\t\t\t\t\t$this->addStylesheet($url);\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t$this->addScript($url);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// template extended styles\n\t\t$aparams = $this->_tpl->params->toArray();\n\t\t$extras = array();\n\t\t$itemid = JFactory::getApplication()->input->get ('Itemid');\n\t\tforeach ($aparams as $name => $value) {\n\t\t\tif (preg_match ('/^theme_extras_(.+)$/', $name, $m)) {\n\t\t\t\t$extras[$m[1]] = $value;\n\t\t\t}\n\t\t}\n\t\tif (count ($extras)) {\n\t\t\tforeach ($extras as $extra => $pages) {\n\t\t\t\tif (!is_array($pages) || !count($pages) || in_array (0, $pages)) {\n\t\t\t\t\tcontinue; // disabled\n\t\t\t\t}\n\t\t\t\tif (in_array (-1, $pages) || in_array($itemid, $pages)) {\n\t\t\t\t\t// load this style\n\t\t\t\t\t$this->addCss ('extras/'.$extra);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "function opinionstage_help_resource_load_footer(){\n}", "private function addJsInclude($file) {\n $this->jsIncludes[] = $file;\n }", "function rest_output_link_wp_head()\n {\n }", "function onExtra($name)\r\n\t{\r\n\t\t$output = null;\r\n\t\tif($name==\"header\" && $this->yellow->getRequestHandler()==\"edit\")\r\n\t\t{\r\n\t\t\t$imageLocation = $this->yellow->config->get(\"serverBase\").$this->yellow->config->get(\"imageLocation\");\r\n\t\t\t$pluginLocation = $this->yellow->config->get(\"serverBase\").$this->yellow->config->get(\"pluginLocation\");\r\n\t\t\t$jqueryCdn = $this->yellow->config->get(\"jqueryCdn\");\r\n\t\t\t$output .= \"<script type=\\\"text/javascript\\\" src=\\\"{$jqueryCdn}\\\"></script>\\n\";\r\n\t\t\t$output .= \"<script type=\\\"text/javascript\\\" src=\\\"{$pluginLocation}inline-attachment.js\\\"></script>\\n\";\r\n\t\t\t$output .= \"<script type=\\\"text/javascript\\\" src=\\\"{$pluginLocation}jquery.inline-attachment.js\\\"></script>\\n\";\r\n\t\t\t$output .= \"<script type=\\\"text/javascript\\\">\\n\";\r\n\t\t\t$output .= \"\\$(function() {\\$('textarea').inlineattachment({uploadUrl: '{$imageLocation}upload_attachment.php'});});\";\r\n\t\t\t$output .= \"</script>\\n\";\r\n\t\t}\r\n\t\treturn $output;\r\n\t}", "function spreadshop_article_list()\n{\ninclude(plugin_dir_path(__FILE__).'/spreadarticlelist.php');\n}", "function spreadshop_assortment()\n{\ninclude(plugin_dir_path(__FILE__).'/spreadassortment.php');\nadd_filter('wp_head', 'sources');\n}", "function includeJQuery() {\n\t\tif ($this->jQueryLocation) {\n\t\t\tRequirements::javascript($this->jQueryLocation);\n\t\t} else if (self::$jquery_location) {\n\t\t\tRequirements::javascript(self::$jquery_location);\n\t\t}\n\n\t}", "public function insert_inline_scripts() {\n }", "public function insert_inline_scripts() {\n }", "public function insert_inline_scripts() {\n }", "function spreadshop_imprint()\n{\ninclude(plugin_dir_path(__FILE__).'/imprint.php');\nadd_filter('wp_head', 'sources');\n}", "protected function addJavaScript() {\n\t\t$extensionConfiguration = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['contagged']);\n\t\t$javaScriptPathAndFilename = $extensionConfiguration['javaScriptPathAndFilename'];\n\t\tif (is_string($javaScriptPathAndFilename) && $javaScriptPathAndFilename !== '') {\n\t\t\t$GLOBALS['TSFE']->additionalHeaderData['contagged'] .= '<script src=\"' . $javaScriptPathAndFilename . '\" type=\"text/javascript\"></script>';\n\t\t}\n\t}", "protected function includeJs($path) {\n echo '<script src=\"' . $this->getUrl($path) . '\"></script>';\n }", "protected function includeJs($path) {\n echo '<script src=\"' . $this->getUrl($path) . '\"></script>';\n }", "function addHeaderCode() {\r\n echo '<link type=\"text/css\" rel=\"stylesheet\" href=\"' . plugins_url('css/bn-auto-join-group.css', __FILE__).'\" />' . \"\\n\";\r\n}", "public function write_includes()\n \t{\n\t\t$result=\"\";\n\t\t\n\t\tforeach($this->includes as $key => $include)\n\t\t{\n\t\t\tif (strpos($include,'http://')!==0)\n\t\t\t\t$include='/js/'.$include.'.js';\n\t\t\t\t\n\t\t\t$result.=\"\\t\\t<script src=\\\"$include\\\" type=\\\"text/javascript\\\"></script>\\n\";\n\t\t}\n\t\t\t\n\t\treturn $result;\n \t}", "public function loadIncludes() {\n // TODO: better way to skip load includes.\n $this->addCSS($this->env->dir['tmp_files'] . '/css.min.css');\n $this->addJS('/tmp/js.min.js');\n }", "function extra_customizer_link() {\n\tif ( is_customize_preview() ) {\n\t\techo et_core_portability_link( 'et_extra_mods', array( 'class' => 'customize-controls-close' ) );\n\t}\n}", "function includes()\r\n {\r\n \r\n do_action('cart_converter_includes_action');\r\n }", "public function addDependencies()\n {\n $this->Html->script('/attachments/js/vendor/jquery.ui.widget.js', ['block' => true]);\n $this->Html->script('/attachments/js/vendor/jquery.iframe-transport.js', ['block' => true]);\n $this->Html->script('/attachments/js/vendor/jquery.fileupload.js', ['block' => true]);\n $this->Html->script('/attachments/js/app/lib/AttachmentsWidget.js', ['block' => true]);\n $this->Html->css('/attachments/css/attachments.css', ['block' => true]);\n }", "public function testAddLinkToIncludedHideMembersForLinkedResource()\n {\n $this->document->addToIncluded($parent = $this->schemaFactory->createResourceObject($this->getSchema(\n 'people',\n '123',\n ['firstName' => 'John', 'lastName' => 'Dow'],\n new Link('peopleSelfUrl/'), // self url\n [], // links for resource\n ['this meta' => 'wont be shown'], // meta when primary resource\n [LinkInterface::SELF => new Link('peopleSelfUrl/')], // links for included resource\n false, // show 'relationships' in 'included'\n ['some' => 'author meta'] // meta when resource within 'included'\n ), new stdClass(), false));\n\n $resource = $this->schemaFactory->createResourceObject($this->getSchema(\n 'comments',\n '321',\n null, // attributes\n new Link('selfUrlWillBeHidden/'),\n [LinkInterface::SELF => new Link('selfUrlWillBeHidden/')], // links for resource\n ['this meta' => 'wont be shown'], // meta when resource is primary\n [], // links for included resource\n false, // show relationships in 'included'\n ['this meta' => 'wont be shown'], // meta when resource within 'included'\n ['some' => 'comment meta'] // meta when resource is in relationship\n ), new stdClass(), false);\n\n $link = $this->schemaFactory->createRelationshipObject(\n 'comments-relationship',\n new stdClass(), // in reality it will be a Comment class instance where $resource properties were taken from\n [], // links\n null, // relationship meta\n true, // show data\n false // is root\n );\n\n $this->document->addRelationshipToIncluded($parent, $link, $resource);\n $this->document->setResourceCompleted($parent);\n\n $expected = <<<EOL\n {\n \"data\" : null,\n \"included\" : [{\n \"type\" : \"people\",\n \"id\" : \"123\",\n \"attributes\" : {\n \"firstName\" : \"John\",\n \"lastName\" : \"Dow\"\n },\n \"relationships\" : {\n \"comments-relationship\" : {\n \"data\" : { \"type\" : \"comments\", \"id\" : \"321\", \"meta\" : {\"some\" : \"comment meta\"} }\n }\n },\n \"links\" : {\n \"self\" : \"peopleSelfUrl/\"\n },\n \"meta\" : {\n \"some\" : \"author meta\"\n }\n }]\n }\nEOL;\n $this->check($expected);\n }", "public function yoast_allow_rel() {\n\t\tglobal $allowedtags;\n\t\t$allowedtags['a']['rel'] = array ();\n\t}", "function insert_share_product() {\n\t?>\n\t<script type=\"text/javascript\" src=\"//s7.addthis.com/js/300/addthis_widget.js#pubid=ra-57e482b2e67c850b\"></script>\n\t<div class=\"addthis_inline_share_toolbox_4524\"></div>\n\t<?php\n}", "public function addIncludes($param)\n\t{\n\t\tif(is_array($param))\n\t\t{\n\t\t\tforeach($param as $p)\n\t\t\t{\n\t\t\t\tarray_push($this->needed_css_include, $p);\n\t\t\t}\n\n\t\t} else {\n\t\t\tarray_push($this->needed_css_include, $param); \n\t\t}\n\t}", "function w3tc_cdn_import_library() {\n\t\t$w3_plugin_cdn = Dispatcher::component( 'Cdn_Core_Admin' );\n\t\t$common = Dispatcher::component( 'Cdn_Core' );\n\n\t\t$cdn = $common->get_cdn();\n\n\t\t$total = $w3_plugin_cdn->get_import_posts_count();\n\t\t$cdn_host = $cdn->get_domain();\n\n\t\t$title = __( 'Media Library import', 'w3-total-cache' );\n\n\t\tinclude W3TC_INC_DIR . '/popup/cdn_import_library.php';\n\t}", "function storefront_footer_social_media()\n {\n include('footer_social_media.php');\n }", "function es_anonymous_admin_links() {\n\twp_enqueue_script( 'anonymous-admin-links', plugins_url( 'anonymous-admin-links.js', __FILE__ ), array( 'jquery' ) );\n}", "public function markAsIncluded(ISnippet $snippet)\r\n\t{\r\n\t\t$this->alreadyIncluded[$snippet->hash] = true;\r\n\t}", "public function CSS($file,$hook=''){\n \n $file=$this->getFileName($file);\n $incl=pinCSSLinkInclusion::make($file,$hook)->file($file);\n pinIncluder::i()->add($incl);\n return $incl; \n }", "function MilestoneLink(){\n\t\techo '<a href=\"',plugin_page('main'),'\">Milestone</a> | ';\n\t}", "function loadAkademiKuLib($class_name) \n{\n Mod::inc($class_name.\".lib\",'',__DIR__.\"/inc/lib/\");\n}", "private function includes() {\n\t\t\t// By default, comments are disjoined from the other post types.\n\t\t\trequire_once( $this->includes_dir . 'comments.php' );\n\n\t\t\t// Settings\n\t\t\trequire_once( $this->includes_dir . 'settings.php' );\n\t\t}", "function loan_listing_callback() {\n wp_enqueue_style('wondaloans-admin-css');\n require_once plugin_dir_path(__FILE__) . 'partials/loan_application_listing.php';\n }", "protected function registerClientScript()\n {\n $view = $this->getView();\n $options = Json::encode($this->jsOptions);\n Asset::register($view);\n $view->registerJs('jQuery.address(' . $options . ');');\n }", "public function jquery($hook='',$addJqUi=false,$addUiTheme=false){\n \n $html=pinHtml::make('script')->type('text/javascript')->src($this->cfg_jquerylink);\n\n $in=pinInclusion::make('jq',$hook);\n $in->setContent($html->render());\n pinIncluder::i()->add($in);\n \n if($addJqUi){\n \n $html=pinHtml::make('script')->type('text/javascript')->src($this->cfg_jqueryuilink);\n\n $in=pinInclusion::make('jqui',$hook);\n $in->setContent($html->render());\n pinIncluder::i()->add($in);\n \n if($addUiTheme){\n \n $link=$this->cfg_jqueryuicsslink;\n $link=str_replace('{theme}',$this->cfg_jqueryuitheme,$link);\n \n $html=pinHtml::make('link')->rel('stylesheet')->href($link);\n \n $in=pinInclusion::make('jquicss',$hook)->overrideType('css');\n $in->setContent($html->render());\n \n pinIncluder::i()->add($in);\n \n }\n \n } \n \n return $in;\n \n }", "function register_block_core_comment_edit_link()\n {\n }", "function tnl_add_nofollow() {\r\n wp_deregister_script('wplink');\r\n wp_register_script('wplink', plugins_url( '/inc/nofollow.min.js', __FILE__ ), array('jquery'), '1.04', 1);\r\n wp_enqueue_script('wplink');\r\n wp_localize_script('wplink', 'wpLinkL10n', array(\r\n 'title' => __('Insert/edit link'),\r\n 'update' => __('Update'),\r\n 'save' => __('Add Link'),\r\n 'noTitle' => __('(no title)'),\r\n 'labelTitle' => __( 'Title' ),\r\n 'noMatchesFound' => __('No results found.'),\r\n 'noFollow' => __(' Add <code>rel=\"nofollow\"</code> to link', 'title-and-nofollow-for-links')\r\n ));\r\n}", "function BugzillaIncludeHTML( &$out, &$sk ) {\n\n global $wgScriptPath;\n global $wgBugzillaJqueryTable;\n\n if( $wgBugzillaJqueryTable ) {\n // Use local jquery\n $out->addScriptFile(\"$wgScriptPath/extensions/Bugzilla/web/jquery/1.6.2/jquery.min.js\");\n\n // Use local jquery ui\n $out->addScriptFile(\"$wgScriptPath/extensions/Bugzilla/web/jqueryui/1.8.14/jquery-ui.min.js\");\n\n // Add a local script file for the datatable\n $out->addScriptFile(\"$wgScriptPath/extensions/Bugzilla/web/js/jquery.dataTables.js\");\n\n // Add a local jquery css file\n $out->addStyle(\"$wgScriptPath/extensions/Bugzilla/web/jqueryui/1.8.14/themes/base/jquery-ui.css\");\n\n // Add a local jquery UI theme css file\n $out->addStyle(\"$wgScriptPath/extensions/Bugzilla/web/jqueryui/1.8.14/themes/smoothness/jquery-ui.css\");\n\n // Add local datatable styles\n $out->addStyle(\"$wgScriptPath/extensions/Bugzilla/web/css/demo_page.css\");\n $out->addStyle(\"$wgScriptPath/extensions/Bugzilla/web/css/demo_table.css\");\n\n // Add the script to do table magic\n $out->addInlineScript('$(document).ready(function() { \n $(\"table.bugzilla\").dataTable({\n \"bJQueryUI\": true\n })});');\n }\n\n // Add local bugzilla extension styles\n $out->addStyle(\"$wgScriptPath/extensions/Bugzilla/web/css/bugzilla.css\");\n\n // Let the user optionally override bugzilla extension styles\n if( file_exists(\"$wgScriptPath/extensions/Bugzilla/web/css/custom.css\") ) {\n $out->addStyle(\"$wgScriptPath/extensions/Bugzilla/web/css/custom.css\");\n }\n\n // Let the other hooks keep processing\n return TRUE;\n}", "public function appendJsUrl($url) {\n $this->appendToHead(<<<HTML\n <script type='text/javascript' src='$url'></script>\nHTML\n) ;\n }", "function _links_add_base($m)\n {\n }", "public function includeJS()\r\n\t\t{\r\n\t\t\techo $this->js;\r\n\t\t}", "public function includes()\n {\n require_once(__DIR__ . '/Widgets/SuperglobalsWidget.php');\n }" ]
[ "0.5860773", "0.5615165", "0.55752534", "0.55272716", "0.54170793", "0.5376579", "0.5295694", "0.5271095", "0.5255743", "0.5192869", "0.51745224", "0.51745224", "0.5168808", "0.5149912", "0.5142721", "0.51361674", "0.51162434", "0.5085569", "0.5029677", "0.5016803", "0.5015689", "0.5015617", "0.50140285", "0.50079644", "0.49777958", "0.4949573", "0.494283", "0.49419495", "0.49382094", "0.49242058", "0.49241117", "0.4920782", "0.49140292", "0.49001807", "0.48881432", "0.48865736", "0.48671928", "0.48587507", "0.48209885", "0.48194018", "0.4819298", "0.4817896", "0.4803615", "0.48007727", "0.47875962", "0.47774553", "0.47761416", "0.4775387", "0.47690433", "0.47684687", "0.47680452", "0.47677454", "0.47608438", "0.47490734", "0.4745632", "0.47455585", "0.47413927", "0.47385454", "0.47366682", "0.473552", "0.47325644", "0.47226012", "0.47164273", "0.47162288", "0.4715911", "0.47133118", "0.47133118", "0.47133118", "0.47109586", "0.4707461", "0.46920127", "0.46920127", "0.46853432", "0.46829003", "0.4682234", "0.4680627", "0.46799782", "0.46768928", "0.4675409", "0.46735653", "0.46725097", "0.46713948", "0.46646383", "0.46630675", "0.4661925", "0.46616194", "0.46611667", "0.46602514", "0.46514395", "0.4644033", "0.46423906", "0.46408218", "0.4635975", "0.46344975", "0.46334675", "0.4632915", "0.46320015", "0.4631443", "0.46268225", "0.46247268" ]
0.5533424
3
include a link to jquery, optional to jquery as well Inclusion is added to pinIncluder
public function jquery($hook='',$addJqUi=false,$addUiTheme=false){ $html=pinHtml::make('script')->type('text/javascript')->src($this->cfg_jquerylink); $in=pinInclusion::make('jq',$hook); $in->setContent($html->render()); pinIncluder::i()->add($in); if($addJqUi){ $html=pinHtml::make('script')->type('text/javascript')->src($this->cfg_jqueryuilink); $in=pinInclusion::make('jqui',$hook); $in->setContent($html->render()); pinIncluder::i()->add($in); if($addUiTheme){ $link=$this->cfg_jqueryuicsslink; $link=str_replace('{theme}',$this->cfg_jqueryuitheme,$link); $html=pinHtml::make('link')->rel('stylesheet')->href($link); $in=pinInclusion::make('jquicss',$hook)->overrideType('css'); $in->setContent($html->render()); pinIncluder::i()->add($in); } } return $in; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function includeJQuery() {\n\t\tif ($this->jQueryLocation) {\n\t\t\tRequirements::javascript($this->jQueryLocation);\n\t\t} else if (self::$jquery_location) {\n\t\t\tRequirements::javascript(self::$jquery_location);\n\t\t}\n\n\t}", "protected function _injectJquery()\n {\n $options = $this->getOptions();\n $this->_view->headScript()->appendFile($options['cdn'] . '/js/jquery/jquery-' . $options['version'] . '.js');\n if ($options['plugins']) {\n foreach ($options['plugins']['plugin'] as $plugin) {\n $this->_view->headScript()->appendFile($options['cdn'] . $options['plugins']['basedir'] . '/' . $plugin);\n }\n }\n return $this->_view;\n }", "function jquery($line)\n{\n\tif ($line == 1)\n\t{\n\t\techo '<script src=\"//ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js\"></script>\n\t\t';\n\t}\n\tif ($line == 2)\n\t{\n\t\techo '<script src=\"https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js\"></script>\n\t\t';\n\t}\n}", "private function _load_jquery_remotely()\n\t{\n\t\t// default jq version\n\t\t$v = '1.12.4' ;\n\n\t\t// load wp's jq version\n\t\tglobal $wp_scripts ;\n\t\tif ( isset( $wp_scripts->registered[ 'jquery-core' ]->ver ) ) {\n\t\t\t$v = $wp_scripts->registered[ 'jquery-core' ]->ver ;\n\t\t\t// Remove all unexpected chars to fix WP5.2.1 jq version issue @see https://wordpress.org/support/topic/problem-with-wordpress-5-2-1/\n\t\t\t$v = preg_replace( '|[^\\d\\.]|', '', $v ) ;\n\t\t}\n\n\t\t$src = $this->_cfg_cdn_remote_jquery === LiteSpeed_Cache_Config::VAL_ON ? \"//ajax.googleapis.com/ajax/libs/jquery/$v/jquery.min.js\" : \"//cdnjs.cloudflare.com/ajax/libs/jquery/$v/jquery.min.js\" ;\n\n\t\tLiteSpeed_Cache_Log::debug2( '[CDN] load_jquery_remotely: ' . $src ) ;\n\n\t\twp_deregister_script( 'jquery-core' ) ;\n\n\t\twp_register_script( 'jquery-core', $src, false, $v ) ;\n\t}", "public function register_jquery() {\n\t\t// If we haven't selected to load from google in customizer, we can bail\n\t\tif( get_theme_mod( 'mpress_enqueue_jquery' ) !== 'google' ) {\n\t\t\treturn false;\n\t\t}\n\t\t// Deregister core jquery in favor of cdn version\n\t\twp_deregister_script( 'jquery' );\n\t\t// Re-register jquery with CDN URI\n\t\twp_register_script( 'jquery', '//ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js', array(), '2.1.4', get_theme_mod( 'mpress_jquery_location', false ) );\n\t}", "function google_hosted_jquery() {\n\tif (!is_admin()) {\n\t\twp_deregister_script('jquery');\n\n\t\tswitch ( SeekConfig::JQUERY_VERSION ) {\n\t\t\tcase 1:\n\t\t\t\twp_register_script('jquery', 'https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js', false, null);\n\t\t\t\tbreak;\n\t\t\tcase 3:\n\t\t\t\twp_register_script('jquery', 'https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js', false, null);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\twp_register_script('jquery', 'https://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js', false, null);\n\t\t\t\tbreak;\n\t\t}\n\n\t\twp_enqueue_script('jquery');\n\t}\n}", "function cm_replace_jquery() {\n\tif (!is_admin()) {\n\t\t// comment out the next two lines to load the local copy of jQuery\n\t\twp_deregister_script('jquery');\n\t\twp_register_script('jquery', '//ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js', false, '1.11.3');\n\t\twp_enqueue_script('jquery');\n\t}\n}", "function set_jquery_cdn() {\n\t\tif (is_admin()) return;\n\t\twp_deregister_script('jquery');\n\t\twp_register_script('jquery',\n\t\t\t'https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js');\n\t}", "public function initializeJQuery() {\n $this->addToHead(\"<script src=\\\"https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js\\\"></script>\",\n Page::BOTTOM);\n }", "function includeJQueryValidate() {\n\t\tif ($this->jQueryValidateLocation) {\n\t\t\tRequirements::javascript($this->jQueryValidateLocation);\n\t\t} else if (self::$jquery_validate_location) {\n\t\t\tRequirements::javascript(self::$jquery_validate_location);\n\t\t}\n\t}", "function head_js($includeDefaults = true)\n{\n $headScript = get_view()->headScript();\n\n if ($includeDefaults) {\n $dir = 'javascripts';\n $headScript->prependScript('jQuery.noConflict();')\n ->prependScript('window.jQuery.ui || document.write(' . js_escape(js_tag('vendor/jquery-ui')) . ')')\n // ->prependFile('//ajax.googleapis.com/ajax/libs/jqueryui/1.11.2/jquery-ui.min.js')\n ->prependScript('window.jQuery || document.write(' . js_escape(js_tag('vendor/jquery')) . ')')\n // ->prependFile('//ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js')\n ;\n }\n return $headScript;\n}", "function rst_scripts_method()\n{\n wp_enqueue_script('jquery');\n}", "public function update_jquery_source() {\n\t\t$jquery_url = $this->get_jquery_url();\n\t\tif ( ! empty( $jquery_url ) ) {\n\t\t\twp_deregister_script( 'jquery' );\n\t\t\twp_register_script( 'jquery', $jquery_url, [], null, true );\n\t\t\t$this->add_filter( 'script_loader_src', 'jquery_local_fallback', 10, 2 );\n\t\t}\n\t}", "function load_jQuery() {\n global $PAGE, $DB, $COURSE;\n\n dd_content_inline_js();\n $this->dd_content_inline_js(); //some inline JS for php info\n dd_content_load_jQuery();\n $PAGE->requires->js(\"/blocks/dd_content/dd_content.js\");\n }", "function admin_jquery() {\n\t\twp_enqueue_script('jquery');\n\t}", "function add_qoorate_scripts(){\n\t\t// MAYBE TODO: cacheing ... place in DB options?\t\t\n\t\t// unregister our really old jquery bundled with WP\n\t\t// Maybe we can keep it? should it be an option?\n\t\twp_deregister_script( 'jquery' );\n\t\twp_register_script( 'jquery', 'http://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js' );\n\t\twp_enqueue_script( 'jquery' );\n\t}", "public function sharethis_include_js();", "function replace_jquery() {\n if (!is_admin()) {\n // comment out the next two lines to load the local copy of jQuery\n wp_deregister_script('jquery');\n wp_register_script('jquery', '//ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js', false, '1.12.4');\n wp_enqueue_script('jquery');\n }\n}", "protected function includeJQuery($includeCSS = TRUE) {\n\t\t$markerArray = array(\n\t\t\t'###PATH2TEMPLATE###' => $this->extRelPath . $this->templateDir,\n\t\t\t'###JQUERYLIB###' => $this->jQueryLib,\n\t\t\t'###CONVERTING###' => $GLOBALS['LANG']->sL($this->locallangXML . ':process.converting'),\n\t\t\t'###TABLE###' => $GLOBALS['LANG']->sL($this->locallangXML . ':head.table'),\n\t\t\t'###OF###' => $GLOBALS['LANG']->sL($this->locallangXML . ':process.of'),\n\t\t\t'###BACKUP_DONE###' => $GLOBALS['LANG']->sL($this->locallangXML . ':success.backupDone'),\n\t\t##\t'###BACKUP_FAILED###' => $GLOBALS['LANG']->sL($this->locallangXML . ':error.backupFailed'),\n\t\t\t'###CONVERT_DONE###' => $GLOBALS['LANG']->sL($this->locallangXML . ':success.convertDone'),\n\t\t\t'###EXCLUDE_DONE###' => $GLOBALS['LANG']->sL($this->locallangXML . ':success.excludeDone'),\n\t\t);\n\n\t\t$templateJQcore = t3lib_parsehtml::getSubpart($this->template, '###TEMPLATE_JQINCLUDECORE###');\n\t\t$this->content .= t3lib_parsehtml::substituteMarkerArray($templateJQcore, $markerArray);\n\n\t\tif ($includeCSS === TRUE) {\n\t\t\t$templateCSS = t3lib_parsehtml::getSubpart($this->template, '###TEMPLATE_JQINCLUDECSS###');\n\t\t\t$markerArray['###PATH2TEMPLATE###'] = strtr($markerArray['###PATH2TEMPLATE###'], array('/' => '\\/'));\n\t\t\t$markerArray['###TEMPLATECSS###'] = strtr($this->templateCSS, array('/' => '\\/'));\n\t\t\t$this->content .= t3lib_parsehtml::substituteMarkerArray($templateCSS, $markerArray);\n\t\t}\n\n\t\treturn $this;\n\t}", "function wpfme_jquery_enqueue() {\n wp_deregister_script('jquery');\n wp_register_script('jquery', \"http\" . ($_SERVER['SERVER_PORT'] == 443 ? \"s\" : \"\") . \"://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js\", false, null);\n wp_enqueue_script('jquery');\n}", "public function add_jquerey($extra=array()){\n\t\tif(is_string($extra)){\n\t\t\t$extra=array($extra);\n\t\t}\n\t\tif(!self::is_included(\"jquerey\")){\n\t\t\t$this->add_script(\"https://ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js\",\"./js/jq.js\");\n\t\t}\n\t\tself::$included[\"jquerey\"]=true;\n\t\t$libs=array(\n\t\t\t\t\"cookie\"=>\"https://cdn.jsdelivr.net/jquery.cookie/1.4.1/jquery.cookie.min.js\",\n\t\t\t\t\"lazy_load\"=>\"https://cdnjs.cloudflare.com/ajax/libs/jquery.lazyload/1.9.1/jquery.lazyload.min.js\"\n\t\t);\n\t\tforeach ($extra as $item){\n\t\t\tif (isset($libs[$item])){\n\t\t\t\tif(!self::is_included($item)){\n\t\t\t\t\t$this->add_script($libs[$item]);\n\t\t\t\t\tself::$included[$item]=true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "function js_include()\n {\n $args = func_get_args();\n\n $js_lookup_table = [\n 'jquery' => '/ext/jquery-3.1.1.min.js',\n 'tinymce' => '/ext/tinymce/tinymce.min.js',\n 'pagination' => '/ext/pagination.min.js',\n 'featherlight' => '/ext/featherlight.min.js',\n 'featherlight-gallery' => '/ext/featherlight.gallery.min.js',\n 'chosen' => '/ext/chosen_v1.6.2/chosen.jquery.min.js',\n 'qtip' => '/ext/jquery.qtip.min.js'\n ];\n\n foreach( $args as $arg )\n {\n if( isset( $js_lookup_table[$arg] ) )\n $arg = $js_lookup_table[$arg];\n\n echo \"<script src=\\\"/common/js/$arg\\\"></script>\";\n }\n }", "public static function inclureJS() {\r\n \r\n foreach (Page::getInstance()->script as $link) {\r\n \r\n ?>\r\n <script type=\"text/javascript\" src=\"<?php echo $link; ?>\" ></script>\r\n <?php\r\n \r\n }\r\n }", "public function getJquery();", "function replace_default_jquery() {\n\tif (!is_admin()) {\n\t\t// comment out the next two lines to load the local copy of jQuery\n\t\twp_deregister_script('jquery');\n\t\t// wp_register_script('jquery', '//cdn.jsdelivr.net/jquery/2.1.4/jquery.min.js', false, null);\n\t\twp_register_script('jquery', get_template_directory_uri() . '/js/jquery-2.1.4.min.js', false, null);\n\t\t// wp_enqueue_script('jquery');\n\t}\n}", "function replace_jquery() {\r\n\tif (!is_admin()) {\r\n\t\t// comment out the next two lines to load the local copy of jQuery\r\n\t\twp_deregister_script('jquery');\r\n\t\twp_register_script('jquery', 'http://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js', false, '1.11.3');\r\n\t\twp_enqueue_script('jquery');\r\n\t}\r\n}", "public static function getJqueryCompatibility()\n\t{\n\t\treturn '\n\t\t\t<script type=\"text/javascript\">\n\t\t\t\tjq13 = jQuery.noConflict(true); \n\t\t\t</script>\n\t\t\t<script type=\"text/javascript\" src=\"'.self::$moduleURL.'/jquery-1.4.4.min.js\"></script>';\n\t}", "function roboaztechs_jquery_local_fallback($src, $handle = null) {\n\t\tstatic $add_jquery_fallback = false;\n\t\tif ($add_jquery_fallback) {\n\t\t\techo '<script>window.jQuery || document.write(\\'<script src=\"/wp-includes/js/jquery/jquery.js\"><\\/script>\\')</script>' . \"\\n\";\n\t\t\t$add_jquery_fallback = false;\n\t\t}\n\t\tif ($handle === 'jquery') {\n\t\t\t$add_jquery_fallback = true;\n\t\t}\n\t\treturn $src;\n\t}", "protected function get_jquery_url() {\n\t\t$version = $GLOBALS['wp_scripts']->registered['jquery']->ver;\n\t\t$script_debug = ( defined( 'SCRIPT_DEBUG' ) ? SCRIPT_DEBUG : false );\n\t\t$ext = ( $script_debug ? '.min' : '' ) . '.js';\n\t\t$source = static::$jquery_source;\n\n\t\tswitch ( $source ) {\n\t\t\tcase 'google-cdn' :\n\t\t\t\treturn 'https://ajax.googleapis.com/ajax/libs/jquery/' . $version . '/jquery' . $ext;\n\t\t\tbreak;\n\t\t\tcase 'jquery-cdn' :\n\t\t\t\treturn 'https://code.jquery.com/jquery-' . $version . $ext;\n\t\t\tbreak;\n\t\t}\n\t}", "function wptuts_scripts_with_jquery()\n{\n \n // Register the script like this for a theme:\n wp_register_script( 'custom-script', get_template_directory_uri() . '/js/readmore.js', array( 'jquery' ) );\n \n}", "function smarty_cms_function_cms_jquery($params, &$smarty)\n{\n\t$exclude = isset($params['exclude']) && !empty($params['exclude'])?$params['exclude']:'';\n\t$cdn = isset($params['cdn']) && ($params['cdn'])=='true'?true:false;\n\t$append = isset($params['append']) && !empty($params['append'])?$params['append']:'';\n\t$ssl = isset($params['ssl']) && ($params['ssl'])=='true'?true:false;\n\t$custom_root = isset($params['custom_root']) && !empty($params['custom_root'])?$params['custom_root']:'';\n\n\t// get the output.\n\t$out = cms_get_jquery($exclude,$ssl,$cdn,$append,$custom_root);\n\tif( isset($params['assign']) )\n\t{\n\t\t$smarty->assign(trim($params['assign']),$out);\n\t\treturn;\n\t}\n\treturn $out;\n}", "function rps_add_script()\n{\n\n if (!is_admin()) {\n\n wp_enqueue_script('jquery');\n\n }\n\n}", "function my_jquery_enqueue(){\n\twp_deregister_script('jquery'); // this deregisters the current jquery included in wordpress\n\twp_register_script('jquery', \"http\" . ($_SERVER['SERVER_PORT'] == 443 ? \"s\" : \"\") . \"://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js\", false, null);\n\twp_enqueue_script('jquery');\n}", "public function js_includes()\n {\n }", "function appglobe_jquery_enqueue() { \n\n /* \n Probably not necessary if called with the 'wp_enqueue_scripts' action.\n */\n if (is_admin()) return; \n\n global $wp_scripts; \n\n /*\n Change this flag to have the CDN script \n triggered by wp_footer instead of wp_head.\n If Google CDN is unavailable for some reason the flag \n will be ignored and the local WordPress \n jQuery gets enqueued and included in the head\n by the wp_head function.\n */\n $cdn_script_in_footer = false; \n /*\n Register jQuery from Google CDN.\n */\n if (is_a($wp_scripts, 'WP_Scripts') && isset($wp_scripts->registered['jquery'])) {\n /* \n The WordPress jQuery version. \n */\n $registered_jquery_version = $wp_scripts -> registered[jquery] -> ver; \n\n if($registered_jquery_version) {\n /* \n The jQuery Google CDN URL. \n Makes a check for HTTP on top of SSL/TLS (HTTPS) \n to make sure the URL is correct.\n */\n $google_jquery_url = ($_SERVER['SERVER_PORT'] == 443 ? \"https\" : \"http\") . \n \"://ajax.googleapis.com/ajax/libs/jquery/$registered_jquery_version/jquery.min.js\";\n\n /* \n Get the HTTP header response for the this URL, and check that its ok. \n If ok, include jQuery from Google CDN. \n */\n if(200 === wp_remote_retrieve_response_code(wp_remote_head($google_jquery_url))) {\n wp_deregister_script('jquery');\n wp_register_script('jquery', $google_jquery_url , false, null, $cdn_script_in_footer);\n }\n }\n }\n /* \n Enqueue jQuery from Google if available. \n Fall back to the local WordPress default.\n If the local WordPress jQuery is called, it will get \n included in the header no matter what the \n $cdn_script_in_footer flag above is set to.\n */\n wp_enqueue_script('jquery'); \n}", "function reassign_jQuery() {\n wp_deregister_script( 'jquery' );\n wp_deregister_script( 'jquery-core' );\n wp_deregister_script( 'jquery-migrate' );\n\n wp_register_script('jquery', 'https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js', array(), '3.4.1', true);\n wp_add_inline_script( 'jquery', \"window.jQuery || document.write('<script src=\\\"\".get_template_directory_uri() .\"/assets/jquery-3.4.1.min.js\\\">\\\\x3C/script>')\");\n \n wp_enqueue_script('jquery');\n\n}", "function load_jquery()\n{\n ?>\n <script type=\"text/javascript\" src=\"http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js\"></script>\n <script type=\"text/javascript\">\n // Ensure that jQuery is installed even if the Google CDN is down.\n if (typeof jQuery === \"undefined\") {\n var script = document.createElement('script');\n var attr = document.createAttribute('type');\n attr.nodeValue = 'text/javascript';\n script.setAttributeNode(attr);\n attr = document.createAttribute('src');\n attr.nodeValue = '/scripts/jquery-1.3.2.min.js';\n script.setAttributeNode(attr);\n document.getElementsByTagName('head')[0].appendChild(script);\n }\n </script>\n<?php\n}", "function load_jquery($front = false)\n{\n\t$path\t\t\t= 'js/jquery';\n\n\t$jquery\t\t\t= 'jquery-1.5.1.min.js';\n\t$jquery_ui\t\t= 'jquery-ui-1.8.11.custom.min.js';\n\t$jquery_ui_css\t= 'jquery-ui-1.8.11.custom.css';\n\t\n\t//load jquery ui css\n\t\n\tif($front)\n\t{\n\t\techo link_tag($path.'/'.$front.'/'.$jquery_ui_css);\n\t}\n\telse\n\t{\n\t\techo link_tag($path.'dealsign/'.$jquery_ui_css);\n\t}\n\t//load scripts\n\techo load_script($path.'/'.$jquery);\n\techo load_script($path.'/'.$jquery_ui);\n\t\n\t//colorbox\n\t$path\t\t\t= $path.'/colorbox';\n\t$colorbox\t\t= 'jquery.colorbox-min.js';\n\t$colorbox_css\t= 'colorbox.css';\n\t\n\techo link_tag($path.'/'.$colorbox_css);\n\techo load_script($path.'/'.$colorbox);\n}", "public static function move_jquery_to_footer() {\n\t\tadd_action('wp_enqueue_scripts', function() {\n\t\t\tif (is_admin()) {\n\t\t return;\n\t\t }\n\n\t\t $wp_scripts = wp_scripts();\n\n\t\t $wp_scripts->add_data('jquery', 'group', 1);\n\t\t $wp_scripts->add_data('jquery-core', 'group', 1);\n\t\t $wp_scripts->add_data('jquery-migrate', 'group', 1);\n\t\t}, 0);\n\t}", "function add_id_to_script($src, $handle) {\n $theme = 'absolvution';\n $gruntBase = '//' . $_SERVER['HTTP_HOST'] . '/wp-content/themes/' . $theme . '/grunt';\n $config = $gruntBase . '/app/config';\n if ($handle != 'require.js') {\n return $src;\n }\n if ( AMD == true )\n echo '<script id=\"requirejs\" type=\"text/javascript\" src=\"' . esc_url( $src ) . '\" data-main=\"' . $config . '\"></script>' . PHP_EOL;\n else\n echo '<script type=\"text/javascript\" src=\"' . esc_url( $src ) . '\"></script>' . PHP_EOL;\n\n return false;\n}", "function bethel_move_jquery() {\n global $wp_scripts;\n foreach ($wp_scripts->registered as $k => $v) {\n if (substr($k, 0, 6) == 'jquery') {\n if (isset($wp_scripts->registered[$k]->ver) && isset($wp_scripts->registered[$k]->src) && $wp_scripts->registered[$k]->deps) {\n $ver = $wp_scripts->registered[$k]->ver;\n $src = $wp_scripts->registered[$k]->src;\n $deps = $wp_scripts->registered[$k]->deps;\n wp_deregister_script ($k);\n wp_register_script($k, $src, $deps, $ver, true);\n }\n }\n }\n}", "function fondation_jquery_plugins ($scripts) {\n // récent et minifié.\n $jquery_location = find_in_path('javascripts/jquery.min.js');\n $jquery_location = preg_replace('#^../#', '', $jquery_location);\n $scripts[0] = $jquery_location;\n\n return $scripts;\n}", "public function JS($file,$hook=''){\n \n $file=$this->getFileName($file);\n \n $incl=pinJavaScriptLinkInclusion::make($file,$hook)->file($file);\n pinIncluder::i()->add($incl);\n return $incl; \n }", "public function cmf_load_jQuery() {\n global $PAGE;\n\n if (moodle_major_version() >= '2.5') {\n $PAGE->requires->jquery();\n $PAGE->requires->jquery_plugin('migrate');\n $PAGE->requires->jquery_plugin('ui');\n $PAGE->requires->jquery_plugin('ui-css');\n } else {\n $PAGE->requires->js(\"/course/format/course_menu/jquery/jquery-1.9.1.js\");\n $PAGE->requires->js(\"/course/format/course_menu/jquery/jquery-ui.min.js\");\n $PAGE->requires->css(\"/course/format/course_menu/jquery/themes/base/jquery.ui.all.css\");\n }\n \n $PAGE->requires->js(\"/course/format/course_menu/display.js\");\n \n }", "function modify_jquery_version() {\n if (!is_admin()) {\n wp_deregister_script('jquery');\n wp_register_script('jquery', 'http://ajax.googleapis.com/ajax/libs/jquery/2.0.2/jquery.min.js', false, '2.0.s');\n wp_enqueue_script('jquery');\n }\n}", "function mocca_script_files() {\n\n wp_deregister_script('jquery'); // Remove Registeration Old JQuery\n wp_register_script('jquery', includes_url('/js/jquery/jquery.js'), false, '', true); // Register a New JQuery in Footer\n wp_enqueue_script('jquery'); // Enqueue New JQuery\n wp_enqueue_script('popper-js', get_template_directory_uri() . '/js/popper.min.js', array(), false, true);\n wp_enqueue_script('bootstrap-js', get_template_directory_uri() . '/js/bootstrap.min.js', array(), false, true);\n }", "public function ot_ccpa_plugin_scripts() {\n\t\twp_enqueue_script( 'jquery' );\n\t}", "function enqueue_script() {\n wp_enqueue_script('jquery-fallback', includes_url() . '/js/jquery/jquery.js');\n wp_enqueue_script('resform-main', $this->assetsUrl . 'js/main.js', array('jquery-fallback'), true);\n }", "function wwt_include_javascript_and_css() {\r\n wp_enqueue_script('jquery');\r\n wp_enqueue_script('jquery-ui', plugin_dir_url('js/libs/jquery-ui-1.11.2.min.js', __FILE__), array('jquery'), '1.11.2');\r\n wp_enqueue_script('barcode-component', plugin_dir_url(__FILE__) . 'js/SimpleBarcodeApi.js', array('jquery', 'jquery-ui'));\r\n\r\n wp_enqueue_style('jquery-ui', plugins_url('js/libs/jquery-ui-1.11.2.min.css', __FILE__));\r\n}", "function tm_mbr_add_jquery(){\r\n\t//wp_enqueue_style('team-member-style', plugin_dir_url( __FILE__ ).'css/team-member-style.css', array(), 1.0 );\r\n\r\n\twp_enqueue_script( 'jquery' );\r\n\r\n\tif(is_admin()){\r\n\t\twp_enqueue_script( 'lp_admin_js', plugin_dir_url( __FILE__ ).'js/admin.js', array(), 1.0, true );\r\n\t\twp_localize_script( 'lp_admin_js', 'lp_admin_ajax', array(\r\n\t\t\t'ajaxurl'=>admin_url( 'admin-ajax.php' ),\r\n\t\t));\r\n\t}else{\r\n\t\twp_enqueue_script( 'lp_front_js', plugin_dir_url( __FILE__ ).'js/front-end.js', array(), 1.0, true );\r\n\t\twp_localize_script( 'lp_front_js', 'lp_front_ajax', array(\r\n\t\t\t'ajaxurl'=>admin_url( 'admin-ajax.php' ),\r\n\t\t));\r\n\t}\r\n}", "protected function addAdditionalScript() {\necho <<< HTML\n <script src=\"scripts/ajax.js\"></script>\n <link rel=\"stylesheet\" type=\"text/css\" href=\"styles/customer.css\">\nHTML; \n }", "function options_permalink_add_js()\n {\n }", "private function includeJavaScript() {\n\t\t$GLOBALS['TSFE']->additionalHeaderData[$this->prefixId]\n\t\t\t= '<script type=\"text/javascript\" ' .\n\t\t\t'src=\"' . $this->getExtensionPath() .\n\t\t\t'pi1/tx_explanationbox_pi1.js\">' .\n\t\t\t'</script>';\n\n\t\tif ($this->hasConfValueString('mooTools')) {\n\t\t\t$GLOBALS['TSFE']->additionalHeaderData[$this->prefixId . '_moo']\n\t\t\t\t= '<script type=\"text/javascript\" ' .\n\t\t\t\t'src=\"' . $this->getExtensionPath() .\n\t\t\t\t$this->getConfValueString('mooTools') . '\">' .\n\t\t\t\t'</script>';\n\t\t}\n\t}", "public function addDependencies()\n {\n $this->Html->script('/attachments/js/vendor/jquery.ui.widget.js', ['block' => true]);\n $this->Html->script('/attachments/js/vendor/jquery.iframe-transport.js', ['block' => true]);\n $this->Html->script('/attachments/js/vendor/jquery.fileupload.js', ['block' => true]);\n $this->Html->script('/attachments/js/app/lib/AttachmentsWidget.js', ['block' => true]);\n $this->Html->css('/attachments/css/attachments.css', ['block' => true]);\n }", "static function wck_fep_enqueue_scripts(){\n\t\twp_enqueue_script( 'jquery' );\n\t}", "function textdomain_jquery_enqueue() {\n\t wp_deregister_script( 'jquery' );\n\t wp_register_script( 'jquery', \"http\" . ($_SERVER['SERVER_PORT'] == 443 ? \"s\" : \"\") . \"://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js\", false, null );\n\t wp_enqueue_script( 'jquery' );\n\t}", "function jquery_init() {\n\tif (!is_admin()) :\n\t\twp_deregister_script('jquery');\n\t\twp_register_script('jquery', get_template_directory_uri() . '/static/js/jquery.min.js', false, '1.9.1', true);\n\t\t\n\t\twp_enqueue_script('jquery');\n\n\t\t// load infinite scroll jquery\n\t\twp_deregister_script('infinite_scroll');\n\t\twp_register_script( 'infinite_scroll', get_template_directory_uri() . '/static/js/jquery.infinitescroll.min.js', array('jquery'),null,true );\n\n\t\t// load manual-trigger.js jquery\n\t\twp_deregister_script('infinite_scroll_trigger');\n\t\twp_register_script( 'infinite_scroll_trigger', get_template_directory_uri() . '/static/js/manual-trigger.js', array('jquery'),null,true );\n\t\t\n\t\twp_enqueue_script('infinite_scroll');\n\t\twp_enqueue_script('infinite_scroll_trigger');\n\tendif;\n}", "function javascript_adition(){\t\n\t\tif ( ! is_admin() ) : \n\t\t\twp_enqueue_script('jquery');\n\t\t\twp_enqueue_script('healerswiki_js',plugins_url('/',__FILE__).'js/script.js',array('jquery'));\n\t\tendif;\t\t\t\n\t\t\t\t\n\t}", "function wpbootstrap_scripts_with_jquery() {\n wp_register_script('custom-script', get_template_directory_uri() . '/js/bootstrap.js', array('jquery'));\n wp_enqueue_script('custom-script');\n}", "function bweb_scripts() {\r\n wp_enqueue_script('jquery');\r\n}", "function ineedmyjava() {\n\tif (!is_admin()) {\n \n\t\twp_deregister_script('jquery');\n\t\twp_register_script('jquery', 'http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js', false, '1.11.0', true);\n\t\twp_enqueue_script('jquery');\n\t\t\n\t\t// other scripts...\n\t\twp_register_script(\n\t\t\t'custom',\n\t\t\tget_bloginfo('template_directory') . '/js/custom.js',\n\t\t\tarray('jquery') );\n\t\twp_enqueue_script('custom');\n\t\t\n\t\t\n\t\t// other scripts...\n\t\twp_register_script(\n\t\t\t'isotope',\n\t\t\tget_bloginfo('template_directory') . '/js/isotope.js',\n\t\t\tarray('jquery') );\n\t\twp_enqueue_script('isotope');\n\t\t\n\t\t\n\t\t// other scripts...\n\t\twp_register_script(\n\t\t\t'images',\n\t\t\tget_bloginfo('template_directory') . '/js/images-loaded.js',\n\t\t\tarray('jquery') );\n\t\twp_enqueue_script('images');\n\t\t\n\t\t\n\t\t// other scripts...\n\t\twp_register_script(\n\t\t\t'bootstrap',\n\t\t\tget_bloginfo('template_directory') . '/js/bootstrap.js',\n\t\t\tarray('jquery') );\n\t\twp_enqueue_script('bootstrap');\n\t\t\n\t\t\n\t\t// other scripts...\n\t\twp_register_script(\n\t\t\t'colorbox',\n\t\t\tget_bloginfo('template_directory') . '/js/colorbox.js',\n\t\t\tarray('jquery') );\n\t\twp_enqueue_script('colorbox');\n\t\t\n\t\t\n\t\t\n\t}\n}", "function wa_wcc_load_scripts($jquery_true) {\n\n\t\twp_register_style('wa_wcc_mtree_css_file', get_template_directory_uri().'/plugin/collapse/assets/css/mtree.css');\n\t\twp_enqueue_style('wa_wcc_mtree_css_file');\n\n\n\t\tif($this->options['configuration']['load_velocity'] === TRUE) {\n\n\t wp_register_script('wa_wcc_velocity',get_template_directory_uri().'/plugin/collapse/assets/js/jquery.velocity.min.js',array('jquery'),'',($this->options['configuration']['loading_place'] === 'header' ? false : true));\n\t wp_enqueue_script('wa_wcc_velocity'); \n\n\t\t}\n\n\t}", "function include_share_js() {\n if ( is_single() )\n require(CHILD_DIR.'/lib/sharebar-js.php');\n}", "protected function includeJs($path) {\n echo '<script src=\"' . $this->getUrl($path) . '\"></script>';\n }", "protected function includeJs($path) {\n echo '<script src=\"' . $this->getUrl($path) . '\"></script>';\n }", "static function set_jquery_location($file = null) {\n\t\tself::$jquery_location = $file;\n\t}", "public function setJquery($preventJQuery);", "static function include_scripts(){\n\t\t//self::include_css();\n\t\tself::include_js();\n\t}", "public function enqueue_jQuery_ui() {\n $this->enqueue_script( 'sumo-pp-jquery-ui' , $this->get_asset_url( 'js/jquery-ui/jquery-ui.js' ) ) ;\n $this->enqueue_style( 'sumo-pp-jquery-ui' , $this->get_asset_url( 'css/jquery-ui.css' ) ) ;\n }", "function build()\n {\n $this->fDebug->add('Building jQuery JavaScript headers.', 4);\n\n // Add the core jQuery file\n //$this->fTheme->addJSFile('jQuery/jQuery');\n\n // Add the plugins\n foreach ( $this->plugins AS $plugin )\n {\n $this->fTheme->addJSFile('jQuery-'.fTheme::getInstance()->getVariable('jQuery_Version').'/Plugins/' . $plugin . '/' . $plugin);\n }\n\n $output = <<<JSOUT\n <script type=\"text/javascript\">\nJSOUT;\n\n if ( count($this->additionalCode) > 0 )\n {\n foreach($this->additionalCode as $code)\n {\n $output .= ' ' . $code . \"\\n\";\n }\n }\n\n if ( count($this->fns['name']) > 0 )\n {\n $output .= \"\\n\\n/*** Begin fjQuery Custom Functions ***/\\n\";\n for ( $i=0; $i<count($this->fns['name']); $i++ )\n {\n $output .= \"\\n\";\n $output .= 'function '.$this->fns['prototype'][$i] . \"\\n{\\n\";\n $output .= $this->fns['body'][$i];\n $output .= \"\\n}\\n\";\n }\n $output .= \"\\n/*** End fjQuery Custom Functions ***/\\n\\n\";\n }\n\n $output .= <<<JSOUT\n </script>\nJSOUT;\n $this->fTheme->htmlHead($output);\n\n \n // Put init commands at the end of execution, outside of a document.ready event\n if ( count($this->initCommands) )\n {\n $output = <<<JSOUT\n <script type=\"text/javascript\">\n (function($){\n\nJSOUT;\n foreach ( $this->initCommands AS $command )\n {\n $output .= ' ' . $command . \"\\n\";\n }\n $output .= <<<JSOUT\n })(jQuery);\n </script>\nJSOUT;\n $this->fTheme->htmlFoot($output);\n }\n\n }", "function horse_manager_scripts() {\n\n wp_enqueue_script('jquery_check', plugins_url('/js/jquery_check.js', __FILE__), array('jquery'));\n}", "public function get_required_javascript() {\n parent::get_required_javascript();\n\n $this->page->requires->jquery();\n }", "function upgrade_jquery() {\n\tif ( ! is_admin() ) {\n\t\twp_deregister_script( 'jquery' );\n\t\twp_enqueue_script( 'jquery-updated', 'https://code.jquery.com/jquery-3.5.1.slim.min.js' );\n\t\twp_enqueue_script( 'jquery-migrate', 'https://code.jquery.com/jquery-migrate-3.3.1.min.js' );\n\t}\n}", "function blueauthentic_load_scripts() {\n\twp_enqueue_script( 'blueauthentic-jquery', 'https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js', array(), '3.5.1', true );\n}", "function wpbootstrap_scripts_with_jquery(){\n\twp_register_script('custom-script', get_template_directory_uri() . '/bootstrap/js/bootstrap.min.js', array('jquery'));\n\t// For either a plugin or a theme you can then enqueue the script:\n\twp_enqueue_script('custom-script');\n}", "function register_scripts_with_jquery(){ \n // Register the script like this for a plugin:\n // wp_register_style( '')\n wp_register_style( 'curastreamStyle', plugins_url( 'assets/css/style.css', __FILE__ ));\n wp_enqueue_style( 'curastreamStyle');\n wp_register_script( 'custom-programUI-script', plugins_url( 'assets/js/customProgramUI.js', __FILE__ ), \"\", \"\", true);\n wp_register_script( 'catagory-management-script', plugins_url( 'assets/js/categoryManagement.js', __FILE__ ), \"\", \"\", true);\n // For either a plugin or a theme, you can then enqueue the script:\n wp_enqueue_script( 'custom-programUI-script' );\n wp_enqueue_script( 'catagory-management-script' );\n}", "function jquery_local_fallback( $source, $handle = null ) {\n\t\t// Make sure we're modifying the jQuery source URL.\n\t\tif ( 'jquery' === $handle ) {\n\t\t\t// Make sure we only output the fallback script once.\n\t\t\tif ( 0 === did_action( 'output_jquery_local_fallback' ) ) {\n\t\t\t\tdo_action( 'output_jquery_local_fallback' );\n\t\t\t\t$fallback_source = apply_filters( 'script_loader_src', includes_url( '/js/jquery/jquery.js' ), 'jquery-fallback' );\n\n\t\t\t\t// @codingStandardsIgnoreStart\n\t\t\t\techo '<script>window.jQuery || document.write(\\'<script src=\"' . esc_url( $fallback_source ) .'\"><\\/script>\\')</script>' . \"\\n\";\n\t\t\t\t// @codingStandardsIgnoreEnd\n\t\t\t}\n\t\t}\n\n\t\treturn $source;\n\t}", "function defer_parsing_of_js( $url ) {\r\n if ( is_user_logged_in() ) return $url; //don't break WP Admin\r\n if ( FALSE === strpos( $url, '.js' ) ) return $url;\r\n if ( strpos( $url, 'jquery.js' ) ) return $url;\r\n return str_replace( ' src', ' defer src', $url );\r\n}", "function axj_frontend_scripts() {\t\r\n if(!is_admin()){\r\n\r\n\t\twp_enqueue_script('jquery');\r\n \r\n\t}\r\n}", "public function includeAssets(): void\n {\n $this->Html->script('CkTools.vendor/tinymce/jquery.tinymce.min.js', ['block' => true]);\n }", "private function ensure_sufficient_jquery_and_enqueue() {\n\t\tglobal $updraftplus;\n\t\t\n\t\t$enqueue_version = $updraftplus->use_unminified_scripts() ? $updraftplus->version.'.'.time() : $updraftplus->version;\n\t\t$min_or_not = $updraftplus->use_unminified_scripts() ? '' : '.min';\n\t\t$updraft_min_or_not = $updraftplus->get_updraftplus_file_version();\n\n\t\t\n\t\tif (version_compare($updraftplus->get_wordpress_version(), '3.3', '<')) {\n\t\t\t// Require a newer jQuery (3.2.1 has 1.6.1, so we go for something not too much newer). We use .on() in a way that is incompatible with < 1.7\n\t\t\twp_deregister_script('jquery');\n\t\t\t$jquery_enqueue_version = $updraftplus->use_unminified_scripts() ? '1.7.2'.'.'.time() : '1.7.2';\n\t\t\twp_register_script('jquery', 'https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery'.$min_or_not.'.js', false, $jquery_enqueue_version, false);\n\t\t\twp_enqueue_script('jquery');\n\t\t\t// No plupload until 3.3\n\t\t\twp_enqueue_script('updraft-admin-common', UPDRAFTPLUS_URL.'/includes/updraft-admin-common'.$updraft_min_or_not.'.js', array('jquery', 'jquery-ui-dialog', 'jquery-ui-core', 'jquery-ui-accordion'), $enqueue_version, true);\n\t\t} else {\n\t\t\twp_enqueue_script('updraft-admin-common', UPDRAFTPLUS_URL.'/includes/updraft-admin-common'.$updraft_min_or_not.'.js', array('jquery', 'jquery-ui-dialog', 'jquery-ui-core', 'jquery-ui-accordion', 'plupload-all'), $enqueue_version);\n\t\t}\n\t\t\n\t}", "function custom_login_enqueue_scripts()\n{\n wp_enqueue_script('jquery');\n}", "function BugzillaIncludeHTML( &$out, &$sk ) {\n\n global $wgScriptPath;\n global $wgBugzillaJqueryTable;\n\n if( $wgBugzillaJqueryTable ) {\n // Use local jquery\n $out->addScriptFile(\"$wgScriptPath/extensions/Bugzilla/web/jquery/1.6.2/jquery.min.js\");\n\n // Use local jquery ui\n $out->addScriptFile(\"$wgScriptPath/extensions/Bugzilla/web/jqueryui/1.8.14/jquery-ui.min.js\");\n\n // Add a local script file for the datatable\n $out->addScriptFile(\"$wgScriptPath/extensions/Bugzilla/web/js/jquery.dataTables.js\");\n\n // Add a local jquery css file\n $out->addStyle(\"$wgScriptPath/extensions/Bugzilla/web/jqueryui/1.8.14/themes/base/jquery-ui.css\");\n\n // Add a local jquery UI theme css file\n $out->addStyle(\"$wgScriptPath/extensions/Bugzilla/web/jqueryui/1.8.14/themes/smoothness/jquery-ui.css\");\n\n // Add local datatable styles\n $out->addStyle(\"$wgScriptPath/extensions/Bugzilla/web/css/demo_page.css\");\n $out->addStyle(\"$wgScriptPath/extensions/Bugzilla/web/css/demo_table.css\");\n\n // Add the script to do table magic\n $out->addInlineScript('$(document).ready(function() { \n $(\"table.bugzilla\").dataTable({\n \"bJQueryUI\": true\n })});');\n }\n\n // Add local bugzilla extension styles\n $out->addStyle(\"$wgScriptPath/extensions/Bugzilla/web/css/bugzilla.css\");\n\n // Let the user optionally override bugzilla extension styles\n if( file_exists(\"$wgScriptPath/extensions/Bugzilla/web/css/custom.css\") ) {\n $out->addStyle(\"$wgScriptPath/extensions/Bugzilla/web/css/custom.css\");\n }\n\n // Let the other hooks keep processing\n return TRUE;\n}", "function wp_add_yith_extended_js()\n{\n wp_register_style( 'jquery-modal-style', plugins_url( 'assets/css/jquery.modal.min.css', __FILE__ ), array());\n wp_enqueue_style('jquery-modal-style');\n if(is_user_logged_in()){\n // Register the script like this for a plugin:\n wp_register_style( 'alert-style', plugins_url( 'assets/css/alert-style.css', __FILE__ ), array());\n wp_register_script( 'jquery-modal-js', plugins_url( 'assets/js/jquery.modal.min.js', __FILE__ ), array('jquery'));\n wp_register_script('yith-extended', plugins_url('assets/js/yith-extended.js', __FILE__), array('jquery','jquery-yith-wcwl'));\n\n wp_enqueue_script('jquery-modal-js');\n wp_enqueue_script('yith-extended');\n wp_enqueue_style( 'alert-style' );\n }\n\n}", "function dequeue_jquery_migrate( &$scripts){\n\tif(!is_admin()){\n\t\t$scripts->remove( 'jquery');\n\t\t$scripts->add( 'jquery', false, array( 'jquery-core' ), '1.10.2' );\n\t}\n}", "function ajan_core_get_js_dependencies() {\n\treturn apply_filters( 'ajan_core_get_js_dependencies', array( 'jquery' ) );\n}", "public function getJavascriptIncludes() {}", "function wpbootstrap_scripts_with_jquery()\n{\n\twp_register_script('jquery', get_template_directory_uri(). '/assetts/js/jquery-migrate-1.4.1.min.js');\n\twp_enqueue_script('jquery');\n\twp_register_script( 'bootstrap-js', get_template_directory_uri() . '/bootstrap/js/bootstrap.js', array( 'jquery' ) );\n\t// For either a plugin or a theme, you can then enqueue the script:\n\twp_enqueue_script( 'bootstrap-js' );\n}", "function rb_load_javascript()\n{\n wp_enqueue_script(\n 'rb-main-javascript',\n get_stylesheet_directory_uri() . '/main.js',\n array( 'jquery' )\n );\n wp_enqueue_script(\"myUi\",\"https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.8/jquery-ui.min.js\");\n}", "function wp_enqueue_script( $handle, $src = '', $deps = array(), $ver = false, $in_footer = false ) {\n\t$wp_scripts = wp_scripts();\n\n\t_wp_scripts_maybe_doing_it_wrong( __FUNCTION__ );\n\n\n\tif ( $src || $in_footer ) {\n\t\t$_handle = explode( '?', $handle );\n\n\t\tif ( $src ) {\n\t\t\t$wp_scripts->add( $_handle[0], $src, $deps, $ver );\n\t\t}\n\n\t\tif ( $in_footer ) {\n\t\t\t$wp_scripts->add_data( $_handle[0], 'group', 1 );\n\t\t}\n\t}\n\n\t$wp_scripts->enqueue( $handle );\n}", "public function admin_js()\n\t\t{\n\t\t\twp_enqueue_script('jquery');\n\t\t}", "function cam_enqueue_related_pages_scripts_and_styles(){\n // wp_enqueue_style('related-styles', plugins_url('/css/bootstrap.min.css', __FILE__));\n wp_enqueue_script('releated-script', plugins_url( '/js/custom.js' , __FILE__ ), array('jquery','jquery-ui-droppable','jquery-ui-draggable', 'jquery-ui-sortable'));\n }", "function wp_default_packages_inline_scripts($scripts)\n {\n }", "function add_ordin_widget_scripts() {\n if( ! apply_filters( 'add_ordin_widget_scripts', true, $this->id_base ) )\n return;\n ?>\n <script>\n jQuery(document).ready(function( $ ) {\n\n });\n </script>\n <?php\n }", "public function includeJS()\r\n\t\t{\r\n\t\t\techo $this->js;\r\n\t\t}", "function faster_jquery_remove() {\n\n\twp_deregister_script( 'jquery' );\n\n}", "public function jquery() {\n\t\t$this->JqueryExample->recursive = 0;\n\t\t$this->set('examples', $this->JqueryExample->find('all'));\n\t}", "public function public_enqueue_scripts() {\n wp_enqueue_script( 'jquery_focuspoint', plugin_dir_url( __FILE__ ) . 'js/jquery.focuspoint.min.js', array('jquery'), $this->version, true );\n wp_enqueue_script( 'wp_focuslock', plugin_dir_url( __FILE__ ) . 'js/wp-focuslock.js', array('jquery', 'jquery_focuspoint'), $this->version, true );\n }", "function skShortIncludeJs() {\r\n\t\tglobal $ShortcodeKidPath;\r\n\t\tif(!is_admin()) {\r\n\t\t\t\r\n\t\t\t//shortcodes.js\r\n\t\t\twp_register_script('skshortcodes', DT_PLUGINS_URL.'/shortcodes/shortcodekid/js/shortcodes.js');\r\n\t\t\t\r\n\t\t\t//Enqueue our script\r\n\t\t\twp_enqueue_script('jquery');\r\n\t\t\twp_enqueue_script('skshortcodes');\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t}", "function rhapsody_scripts() {\n\twp_enqueue_style( 'rhapsody-style', get_stylesheet_uri() );\n\n if (!is_admin()) add_action(\"wp_enqueue_scripts\", \"wrmc_jquery_enqueue\", 11);\n function wrmc_jquery_enqueue() {\n wp_deregister_script('jquery');\n wp_register_script('jquery', \"http\" . ($_SERVER['SERVER_PORT'] == 443 ? \"s\" : \"\") . \"://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js\", false, null);\n wp_enqueue_script('jquery');\n }\n\n wp_enqueue_script( 'rhapsody-modernizr', get_template_directory_uri() . '/assets/js/modernizr.custom.js',array(), '3.3.1', false);\n wp_enqueue_script( 'rhapsody-app', get_template_directory_uri() . '/assets/js/all.js', array(), '1.0.0', true );\n\n if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {\n\t\twp_enqueue_script( 'comment-reply' );\n\t}\n}" ]
[ "0.7497976", "0.6698645", "0.6612293", "0.65536714", "0.6494303", "0.63665175", "0.6318604", "0.62825006", "0.62729543", "0.6257802", "0.62543696", "0.6246695", "0.62272704", "0.6221439", "0.61935085", "0.61857766", "0.6171833", "0.6156904", "0.61531067", "0.6144493", "0.61417335", "0.612314", "0.61103094", "0.6081884", "0.6049946", "0.604566", "0.59743214", "0.5954091", "0.59355915", "0.5929064", "0.59201825", "0.5903644", "0.5899988", "0.5897951", "0.5878217", "0.58746094", "0.58731496", "0.58687997", "0.5860573", "0.58399004", "0.580929", "0.58024204", "0.57782704", "0.5768382", "0.57595724", "0.5720981", "0.56851184", "0.56826925", "0.5670511", "0.5649177", "0.56395155", "0.56335926", "0.5628693", "0.5622075", "0.5615107", "0.5612565", "0.56072706", "0.5585782", "0.55787396", "0.55759037", "0.55701387", "0.55680156", "0.55655545", "0.5562868", "0.5562868", "0.5558627", "0.55389774", "0.5509663", "0.5503294", "0.5502921", "0.5502405", "0.55003923", "0.549357", "0.5479214", "0.5469837", "0.5462029", "0.5437545", "0.54333186", "0.54332495", "0.54106253", "0.54101264", "0.54097253", "0.54071283", "0.5403457", "0.53984", "0.53974223", "0.5395485", "0.53951037", "0.53930575", "0.53797215", "0.5378004", "0.5376804", "0.53688556", "0.53642327", "0.5357339", "0.53565526", "0.5354444", "0.5353789", "0.5348205", "0.5347897" ]
0.70430595
1
Class constructor Set proper type to prevent overriding by parent class
public function __construct() { parent::__construct(); $this->setType('smile_virtualcategories/rule_condition_combine'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function __construct()\n {\n $fullClassName = explode('\\\\', get_class($this));\n $this->type = (string)array_pop($fullClassName);\n }", "function __construct($type) {\n\t$this->type = $type;\n\t}", "public function __construct($type)\n {\n }", "public function __construct($type) {\n $this->type = $type;\n }", "function __construct($type='simple')\n {\n $this->type = $type;\n }", "protected abstract function __construct();", "public function __construct($type)\n {\n $this->type = $type;\n }", "public function __construct($type)\n {\n $this->type=$type;\n }", "public function __construct($class)\r\n {\r\n parent::__construct($class);\r\n }", "public function __construct() {\n parent::__construct();\n //setting attribute types.\n settype($this->id, \"integer\");\n settype($this->name, \"string\");\n settype($this->question_type_id, \"integer\");\n }", "abstract protected function __construct();", "public function __construct()\n {\n $this->data['messagetype'] = get_class($this);\n }", "abstract public function __construct($value);", "public function __contruct(){\r\n parent::__contruct();\r\n }", "public function __construct()\n {\n // Hide the parent arguments from the public signature\n parent::__construct();\n }", "public function __construct( string$type='' )\n\t{\n\t\t$this->type= $type;\n\t}", "public function __construct()\n {\n $this->city = new City;\n $this->country = new Country;\n $this->event = new Event;\n $this->experience = new Experience;\n $this->place = new Place;\n $this->type = new Type;\n $this->subcategory = new Subcategory;\n }", "public static function initialise() {\n \t// We can't modify it in place, else we'll break any logging done inside the SihnonFramework tree\n \t// or other subclass trees.\n \tstatic::$types = parent::$types;\n \t\n \t// Add the new data types for this subclass\n static::$types['job_id'] = 'int'; \n }", "public function __construct($type, $args = NULL);", "protected function __init__() { }", "abstract public function __construct();", "abstract public function __construct();", "abstract public function __construct();", "function __construct() {\r\n parent ::__construct();\r\n }", "abstract function __construct();", "public function __construct($type='htag') {\n\t\tparent::__construct($type);\n\t}", "public function __construct($type, $value = null)\n {\n parent::__construct($type);\n if (null !== $value) {\n $this->setValue($value);\n }\n }", "public function __construct() {\n\t\t\t$this->field_type = 'number';\n\n\t\t\tparent::__construct();\n\t\t}", "function __construct($value){\n $this->value = $value;\n //\n parent::__construct();\n }", "function __construct(){parent::__construct();}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "public function __construct()\n {\n $this->setAllowedTypes(['string']);\n }", "function __construct($data=NULL){\n switch(true){\n case !isset($data):\n parent::__construct();\n break;\n case is_array($data):\n parent::__construct($data);\n break;\n case is_object($data):\n parent::__construct($data);\n break;\n case is_string($data):\n // TODO (pretty much copy attrPairs())\n break;\n default:\n errorHandle::newError(__METHOD__.\"() - Unsupported data type! (only supports array, string, and object)\", errorHandle::DEBUG);\n return FALSE;\n }\n }", "public function __construct(){\n\t\t/* calling parent construct */\n\t\tparent::__construct();\n\t}", "public function __construct(){\n\t\t/* calling parent construct */\n\t\tparent::__construct();\n\t}", "final private function __construct() {}", "final private function __construct() {}", "public function __construct() {\n\n\t\tparent::__construct();\n\t\t\n\t}", "public function __construct(){\n\t\t//asi poder tener dispoble la vista que le pertenece a esta clase\n\t\tparent::__construct();\n\t}", "public function __contruct()\n {\n parent::__construct();\n }", "public function __construct($type, $params, $culture) {\n\n parent::__construct($type, $params, $culture);\n\n \n }", "protected final function __construct() {}", "final private function __construct() {\n\t\t\t}", "public function __construct()\n {\n $this->types = array(self::TYPE_EMISSION, self::TYPE_TRANSFER);\n }", "public function __construct() {\n $this->Types;\n }", "public function __construct()\n\t{\n\t\t// Make sure that parent constructor is always invoked, since that\n\t\t// is where any default values for this object are set.\n\t\tparent::__construct();\n\t}", "public function __construct()\n\t{\n\t\t// Make sure that parent constructor is always invoked, since that\n\t\t// is where any default values for this object are set.\n\t\tparent::__construct();\n\t}", "public function __construct()\n\t{\n\t\t// Make sure that parent constructor is always invoked, since that\n\t\t// is where any default values for this object are set.\n\t\tparent::__construct();\n\t}", "public function __construct()\n\t{\n\t\t// Make sure that parent constructor is always invoked, since that\n\t\t// is where any default values for this object are set.\n\t\tparent::__construct();\n\t}", "public function __construct()\n\t{\n\t\t// Make sure that parent constructor is always invoked, since that\n\t\t// is where any default values for this object are set.\n\t\tparent::__construct();\n\t}", "public function __construct()\n\t{\n\t\t// Make sure that parent constructor is always invoked, since that\n\t\t// is where any default values for this object are set.\n\t\tparent::__construct();\n\t}", "public function __construct()\n\t{\n\t\t// Make sure that parent constructor is always invoked, since that\n\t\t// is where any default values for this object are set.\n\t\tparent::__construct();\n\t}", "public function __construct()\n\t{\n\t\t// Make sure that parent constructor is always invoked, since that\n\t\t// is where any default values for this object are set.\n\t\tparent::__construct();\n\t}", "public function __construct()\n\t{\n\t\t// Make sure that parent constructor is always invoked, since that\n\t\t// is where any default values for this object are set.\n\t\tparent::__construct();\n\t}", "public function __construct()\n\t{\n\t\t// Make sure that parent constructor is always invoked, since that\n\t\t// is where any default values for this object are set.\n\t\tparent::__construct();\n\t}", "public function __construct()\n\t{\n\t\t// Make sure that parent constructor is always invoked, since that\n\t\t// is where any default values for this object are set.\n\t\tparent::__construct();\n\t}", "public function __construct()\n\t{\n\t\t// Make sure that parent constructor is always invoked, since that\n\t\t// is where any default values for this object are set.\n\t\tparent::__construct();\n\t}", "public function __construct()\n\t{\n\t\t// Make sure that parent constructor is always invoked, since that\n\t\t// is where any default values for this object are set.\n\t\tparent::__construct();\n\t}", "function __construct() {\n parent::__construct();\n\n $this->_converter = new \\System\\Data\\Converter();\n }", "public function __construct()\n\t{\n\t\tparent::__construct();\n\t\t// ben duoi nay se la cac logic cua __construct lop con ma chung ta can dinh nghia - xu ly\n\t}", "protected function __construct(){\n\t\t\tparent::__construct();\n\t\t}", "protected function __construct(){}", "protected function __construct(){}", "protected function __construct(){}", "public function __construct($type, $message = null)\n\t{\n\t\tparent::__construct($message);\n\t\t$this->setType($type);\n\t}", "public function __construct()\n {\n //to be extended by children\n }", "private function __construct()\t{}", "public function __construct(){parent::__construct();}", "protected function __construct() {}", "protected function __construct() {}", "protected function __construct() {}", "protected function __construct() {}", "protected function __construct() {}", "protected function __construct() {}", "protected function __construct() {}", "protected function __construct() {}", "protected function __construct() {}", "protected function __construct() {}", "protected function __construct() {}", "protected function __construct() {}", "protected function __construct() {}", "protected function __construct() {}", "protected function __construct() {}", "protected function __construct() {}", "final private function __construct() { }" ]
[ "0.77211946", "0.7117918", "0.7103505", "0.69459283", "0.68460786", "0.68094516", "0.6750684", "0.67088634", "0.66701585", "0.66353786", "0.66210765", "0.6607509", "0.6565057", "0.6553167", "0.65469086", "0.6511875", "0.6450954", "0.64350873", "0.64207226", "0.64144814", "0.6407527", "0.6407527", "0.6407527", "0.6402145", "0.63654065", "0.6357902", "0.6354739", "0.633713", "0.63263416", "0.6309052", "0.629844", "0.629844", "0.629844", "0.629844", "0.629844", "0.629844", "0.629844", "0.629844", "0.629844", "0.629844", "0.629844", "0.629844", "0.629844", "0.629844", "0.629844", "0.629844", "0.629844", "0.6298394", "0.62825763", "0.62799084", "0.62799084", "0.6269542", "0.6269542", "0.6261788", "0.62589556", "0.6256118", "0.6255306", "0.62488925", "0.6247442", "0.62456477", "0.62313974", "0.62189883", "0.62189883", "0.62189883", "0.62189883", "0.62189883", "0.62189883", "0.62189883", "0.62189883", "0.62189883", "0.62189883", "0.62189883", "0.62189883", "0.62189883", "0.6216837", "0.62026733", "0.6202204", "0.6195607", "0.6195607", "0.6195607", "0.6193469", "0.6188305", "0.61845946", "0.61832714", "0.6180231", "0.6180231", "0.6180231", "0.6180231", "0.6180231", "0.6180231", "0.6180231", "0.6180231", "0.6180231", "0.6180231", "0.6180231", "0.6180231", "0.6180231", "0.6180231", "0.6180231", "0.6180231", "0.6176642" ]
0.0
-1
List all available rules under a combine.
public function getNewChildSelectOptions() { $productCondition = Mage::getModel('smile_virtualcategories/rule_condition_product'); $productAttributes = $productCondition->loadAttributeOptions()->getAttributeOption(); $attributes = array(); foreach ($productAttributes as $code=>$label) { $attributes[] = array('value' => 'smile_virtualcategories/rule_condition_product|'.$code, 'label' => $label); } $conditions = array( array( 'value' => '', 'label' => Mage::helper('rule')->__('Please choose a condition to add...') ), array( 'value' => 'smile_virtualcategories/rule_condition_combine', 'label' => Mage::helper('catalogrule')->__('Conditions Combination') ), array( 'value' => $attributes, 'label' => Mage::helper('catalogrule')->__('Product Attribute') ) ); return $conditions; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function get_all_rules()\n {\n }", "public function getRules();", "public static function getAll() {\n return YtelAdvancedListRules::\n all(['from_list_id', 'from_campaign_id', 'from_list_status', 'to_list_id', 'to_list_status', 'interval', 'active', 'last_run', 'next_run', 'last_update_count']);\n }", "public function getRulesList(){\n return $this->_get(3);\n }", "public function getRules() {}", "function getRulesList() {\n\t\tglobal $app_strings;\n\t\tglobal $theme;\n\n\t\t$this->loadRules();\n\t\t$rulesDiv = $app_strings['LBL_NONE'];\n\n\t\tif(isset($this->rules)) {\n\t\t\t$focusRules = $this->rules;\n\n\t\t\t$rulesDiv = \"<table cellpadding='0' cellspacing='0' border='0' height='100%'>\";\n\t\t\tforeach($focusRules as $k => $rule) {\n\t\t\t\t$rulesDiv .= $this->renderRuleRow($rule);\n\t\t\t}\n\t\t\t$rulesDiv .= \"</table>\";\n\t\t}\n\n\t\t$smarty = new Sugar_Smarty();\n\t\t$smarty->assign('app_strings', $app_strings);\n\t\t$smarty->assign('theme', $theme);\n\t\t$smarty->assign('savedRules', $rulesDiv);\n\t\t$ret = $smarty->fetch(\"include/SugarRouting/templates/rulesList.tpl\");\n\n\t\treturn $ret;\n\t}", "abstract protected function getRules();", "public static function allRules()\n {\n }", "public function getRules(): Collection;", "public static function getRules(): array;", "public function all()\n {\n $rules = $this->ruleServiceInterface->all();\n return view('ruleView::index', ['rules' => $rules]);\n }", "public function commonRules() {\n \n $rules = [];\n \n return $rules;\n }", "public function getRules() {\n\t\t$out = array();\n\t\tforeach ($this->rules as $name => $rule) {\n\t\t\t$out[$name] = $rule->description;\n\t\t}\n\t\treturn $out;\n\t}", "public function get_rules()\n\t{\n\t\t$this->layout->with('title', 'Rules')\n\t\t\t\t\t ->nest('content', 'rules');\n\t}", "public function getRules(): array;", "public function getRules(): array;", "public function getRules()\n {\n }", "public function getRules()\n {\n }", "public function getRules()\n {\n }", "abstract public function getRules(): array;", "public function getRules()\n {\n return $this->get(self::_RULES);\n }", "public function rules() {\n\t\t// 全リクエスト共通ルールと継承先ルールのマージ\n\t\t// 同一のキーがあれば継承先ルールで上書き\n\t\treturn array_merge($this->__base_rules, $this->rules);\n }", "public function rules();", "public function rules();", "public function rules();", "public function getGroupedRules(): array;", "public function printRules() {}", "public function getAllRuleSets() {\n\t\t$aResult = array();\n\t\t$this->allRuleSets($aResult);\n\t\treturn $aResult;\n\t}", "function drush_rules_list() {\n // Type is 'rule', or 'component'. Any other value (or no value) will\n // list both Reaction Rules and Rules Components.\n switch (drush_get_option('type')) {\n case 'rule':\n $types = ['reaction'];\n break;\n\n case 'component':\n $types = ['component'];\n break;\n\n default:\n $types = ['reaction', 'component'];\n break;\n }\n\n // Loop over type option.\n $rows = [];\n foreach ($types as $type) {\n $rules = \\Drupal::configFactory()->listAll('rules.' . $type);\n $event_manager = \\Drupal::service('plugin.manager.rules_event');\n\n // Loop over configuration entities for this $type.\n foreach ($rules as $config) {\n $rule = \\Drupal::configFactory()->get($config);\n if (!empty($rule->get('id')) && !empty($rule->get('label'))) {\n $events = [];\n $active = '';\n // Components don't have events and can't be enabled/disabled.\n if ($type == 'reaction') {\n foreach ($rule->get('events') as $event) {\n $plugin = $event_manager->getDefinition($event['event_name']);\n $events[] = (string) $plugin['label'];\n }\n $active = $rule->get('status') ? dt('Enabled') : dt('Disabled');\n }\n $rows[(string) $rule->get('id')] = [\n 'rule' => (string) $rule->get('id'),\n 'label' => (string) $rule->get('label'),\n 'event' => implode(', ', $events),\n 'active' => (string) $active,\n /*\n * 'status' => what goes here ?\n *\n * @todo Need to figure out how to determine the value for the\n * 'status' column. That is, whether the rule is defined by a module\n * ('Default'), or is defined by a module then modified in a\n * site-specific way ('Overridden'), or is a custom rule built for\n * this site ('Custom').\n * Maybe $rule->has Overrides() tells us if this is Custom?\n */\n ];\n }\n }\n }\n\n return $rows;\n}", "public function getRuleOptions($filter = array()){\r\n\t\t$args = Utility_Functions::argsToArray($filter);\r\n\t\t$args = Utility_Functions::cleanArgsValue($args);\r\n\t\r\n\t\t$param = \"{$args['text']}%\";\r\n\t\t$param = trim ($param);\r\n\t\r\n\t\t$rule_opts = array();\r\n\t\t$rule_opts[\"0\"] = array (\"rule\" => \"A\",\"label\" => \"Allow\") ;\r\n\t\t$rule_opts[\"1\"]= array (\"rule\" => \"D\",\"label\" => \"Deny\") ;\t\t\r\n\t\r\n\t\t$sel_rules = array();\r\n\t\t/**\r\n\t\t\t$i = 0;\r\n\t\t\twhile (list($key, $arr) = each($access_rights)) {\r\n\t\t\tif (strcmp ($arr[\"action\"],$param) !== 0 ){\r\n\t\t\t$i = $i + 1;\r\n\t\t\t$sel_access_rights[\"$i\"] = array (\"action\" =>$arr[\"action\"]) ;\r\n\t\t\t}\r\n\t\t\t}\r\n\t\t\t**/\r\n\t\techo $this->_toJson($rule_opts);\r\n\t}", "function getRules() {\n\t\t$fields = $this->getFields();\n\t\t$allRules = array();\n\n\t\tforeach ($fields as $field) {\n\t\t\t$fieldRules = $field->getValidationRules();\n\t\t\t$allRules[$field->getName()] = $fieldRules;\n\t\t}\n\n\t\treturn $allRules;\n\t}", "public function getRules() {\n\t\treturn $this->rules ?? [];\n\t}", "public function rules()\n {\n return $this->jobCategoryRepository->rules();\n }", "public function getRules() : array\n {\n return $this->getDaoRepository()->getRules();\n }", "public function getRules()\n {\n $rules = [];\n // Default UserAgent\n if (isset($this->rules[self::USER_AGENT])) {\n $rules = array_merge($rules, $this->rules[self::USER_AGENT]);\n }\n // Matching UserAgent\n if (isset($this->rules[$this->userAgentMatch])) {\n $rules = array_merge($rules, $this->rules[$this->userAgentMatch]);\n }\n // Result\n return $rules;\n }", "public function accessRules() {\n return VAuth::getAccessRules('package', array('getCity', 'clear', 'export', 'entry', 'input', 'childUpdate', 'index'));\n }", "public function getRules()\n\t{\n\t\t\n\t\t$rules = array();\n\t\t\n\t\tforeach ( $this->getFields() as $field )\n\t\t{\n\t\t\t$rules = array_merge( $rules, $field->getRules() );\n\t\t}\n\t\t\n\t\treturn $rules;\n\t}", "public function getAvailableRules()\n {\n return null;\n }", "public function rules()\n {\n $commons = [\n\n ];\n return get_request_rules($this, $commons);\n }", "protected function compile()\n\t{\n\t\t// Initialize an array for the applicable rules\n\t\t$applicable_rules = array();\n\t\t\n\t\t// Get the scope for this instance of ACL\n\t\t$scope = $this->scope();\n\n\t\t// Resolve rules that currently have wildcards\n\t\tACL::resolve_rules($scope);\n\t\t\n\t\t// Re-index the scope array with numbers for looping\n\t\t$scope = array_values($scope);\n\t\t\n\t\t// Get all the rules that could apply to this request\n\t\tfor ($i = 2; $i >= 0; $i--)\n\t\t{\n\t\t\t// Get the key for the scope\n\t\t\t$key = ACL::key($scope);\n\t\t\t\n\t\t\t// Look in the rules array for a rule matching the key\n\t\t\tif ($rule = Arr::get(self::$_rules, $key, FALSE))\n\t\t\t{\n\t\t\t\t$applicable_rules[$key] = $rule;\n\t\t\t}\n\n\t\t\t// Remove part of the scope so the next iteration can cascade to another rule\n\t\t\t$scope[$i] = '';\n\t\t}\n\t\t\n\t\t// Get default rule\n\t\t$default_key = ACL::KEY_SEPARATOR.ACL::KEY_SEPARATOR;\n\t\t$applicable_rules[$default_key] = Arr::get(self::$_rules, $default_key);\n\n\t\t// Reverse the rules. Compile from the bottom up\n\t\t$applicable_rules = array_reverse($applicable_rules);\n\n\t\t// Compile the rule\n\t\tforeach ($applicable_rules as $rule)\n\t\t{\n\t\t\t$this->rule = Arr::overwrite($this->rule, $rule->as_array());\n\t\t}\n\t}", "static public function define_decode_rules() {\n $rules = array();\n\n $rules[] = new restore_decode_rule('LINKSETINDEX', '/mod/linkset/index.php?id=$1', 'course');\n $rules[] = new restore_decode_rule('LINKSETVIEWBYID', '/mod/linkset/view.php?id=$1', 'course_module');\n\n return $rules;\n\n }", "public function getRules(): array\n {\n return $this->rules;\n }", "public function rules(){\n $rules = [];\n if(!empty($this->rules)){\n foreach ($this->rules as $action => $rule) {\n $regex = \"*\" . $action;\n if($this->is($regex)){\n $rules = $rule;\n break;\n }\n }\n }\n return $rules;\n }", "public function getAccessRulesInfo();", "public function rules()\n\t{\n\t\t$defaults = array();\n\t\t$toggles = array();\n\t\t$custom = array();\n\t\t$required = array();\n\n\t\tforeach($this->searchFields as $field=>$data)\n\t\t{\n\t\t\t$type = $this->getSearchFieldType($field);\n\t\t\tif ($type == 'toggle')\n\t\t\t\t$toggles[] = $field;\n\t\t\telseif ($type == 'required')\n\t\t\t\t$required[] = $field;\n\t\t\telseif (empty($data['rule']) || !is_array($data['rule']))\n\t\t\t\t$defaults[] = $field;\n\n\t\t\tif (isset($data['rule']) && is_array($data['rule']))\n\t\t\t\t$custom[] = $data['rule'];\n\t\t}\n\n\t\treturn array_merge(array(\n\t\t\tarray(implode(', ', $required), 'required'),\n\t\t\tarray(implode(', ', $toggles), 'in', 'range' => array('Y','N','I')),\n\t\t\tarray(implode(', ', $defaults), 'length', 'max'=>200)\n\t\t), $custom);\n\t}", "public function getAllRules($db) {\r\n $sql = \"SELECT * FROM rules\";\r\n $pdostm = $db->prepare($sql);\r\n $pdostm->execute();\r\n $rules = $pdostm->fetchAll(\\PDO::FETCH_ASSOC);\r\n return $rules;\r\n }", "abstract public function rules(): array;", "abstract public function rules(): array;", "abstract public function rules(): array;", "public function rules()\n {\n return static::staticRules();\n }", "public function rules(): array;", "public function rules(): array;", "public static function getAllRules($type) {\n $rules = self::getProductRules();\n\n switch($type) {\n case 'rim':\n $rules = self::setRimRules($rules);\n break;\n case 'tire':\n $rules = self::setTireRules($rules);\n break;\n }\n return $rules;\n }", "public function getRules()\r\n\t{\r\n\t\treturn $this->rules;\r\n\t}", "public static function getRules() \n {\n return self::$rules;\n }", "public function findRules()\n {\n $keys = array();\n $values = array();\n \n foreach ($this->route as $key => $value) {\n \n $keys[] = $key; \n $values[] = $value; \n \n }\n \n return array(\"keys\" => $keys, \"values\" => $values);\n \n }", "public function rules()\n {\n return RuleSet::find(Game::find($this->game_id)->rules_id);\n }", "public function getRules()\n {\n return $this->rules;\n }", "public function getRules()\n {\n return $this->rules;\n }", "public function getRules()\n {\n return $this->rules;\n }", "public function getRules()\n {\n return $this->rules;\n }", "public function getRules()\r\n\t{\r\n\t\treturn $this->_rules;\r\n\t}", "private function getRegisteredRules()\n {\n return $this->registeredRules;\n }", "public function rules() : array\n {\n return StoreRulesService::getInstance()->get(\n array_merge($this->all(), [\n 'id' => $this->route('visit'),\n ])\n );\n }", "public function getRules(): array\n {\n if (Auth::id()==1){\n return [\n ['disk' => 'projects', 'path' => '*', 'access' => 2],\n ];\n }\n return \\DB::table('acl_rules')\n ->where('user_id', $this->getUserID())\n ->get(['disk', 'path', 'access'])\n ->map(function ($item) {\n return get_object_vars($item);\n })\n ->all();\n }", "public function getRules() : array\n {\n return $this->rules;\n }", "abstract public function rules();", "abstract public function rules();", "abstract public function rules();", "abstract public function rules();", "public static function getRules()\n {\n return (new static)->getValidationRules();\n }", "public function rules()\n {\n return $this->initRules(new Calendar());\n }", "public function rules()\n {\n $method = explode('@', $this->route()->getActionName())[1];\n return $this->get_rules_arr($method);\n }", "protected function get_rules() {\r\n\r\n // No form registered\r\n if ( ! $this->form( false ) ) return;\r\n\r\n // Setup meta query conditions\r\n $meta_queries = array();\r\n foreach( $this->form( false ) as $field_name => $field_data ) {\r\n $meta_queries[] = array(\r\n 'key' => $this->field_prefix() . $field_name,\r\n 'value' => '',\r\n 'compare' => '!=',\r\n );\r\n }\r\n \r\n // Get context rules\r\n return get_posts( array(\r\n 'post_type' => $this->plugin->post_type,\r\n 'numberposts' => -1,\r\n 'meta_query' => array_merge( array( 'relation' => 'OR' ), $meta_queries ),\r\n ) );\r\n }", "public function export()\n {\n return $this->rules;\n }", "public function getRules()\n\t{\n\t\t$rules['org_id']\t= ['required', 'integer', 'exists:'. app()->make(\\App\\Org::class)->getTable() . ',id'];\n\t\t$rules['name']\t\t= ['required', 'string', Rule::unique($this->getTable())->ignore($this->id)->where(function($q) { $q->where('org_id', '=', $this->org_id ? $this->org_id : -1); } ) ];\n\t\t$rules['code']\t\t= ['required', 'string', Rule::unique($this->getTable())->ignore($this->id)->where(function($q) { $q->where('org_id', '=', $this->org_id ? $this->org_id : -1); } ) ];\n\t\t// $rules['group']\t\t\t\t\t= ['required', 'string', 'in:'.implode(',', SELF::GROUP)];\n\t\t$rules['group']\t\t\t\t\t= ['required', 'string'];\n\t\t$rules['description']\t\t\t= ['nullable', 'string'];\n\t\t$rules['threshold']\t\t\t\t= ['nullable', 'numeric', 'min:0'];\n\t\t$rules['unit']\t\t\t\t\t= ['nullable', 'string'];\n\n\t\treturn $rules;\n\t}", "public function getRules() {\n\t\treturn self::$rules;\n\t}", "public function rules()\n {\n if( $this->is('category/store') ) {\n return $this->createRules();\n return $this->messages();\n } \n elseif ( $this->is('category/update/{id}') ) {\n return $this->updateRules();\n return $this->messages();\n }\n }", "public function getValidationRules(): array {\n\t\t$result = [];\n\t\t\n\t\tforeach ($this->getSections() as $section) {\n\t\t\t$result = array_merge($result, $section->getValidationRules());\n\t\t}\n\t\t\n\t\treturn $result;\n\t}", "abstract function rules();", "public function getRules( )\n {\n return $this->rules;\n }", "function pewc_get_matches() {\n\t$matches = array(\n\t\t'all'\t\t=> __( 'All rules match', 'pewc' ),\n\t\t'any'\t\t=> __( 'Any rule matches', 'pewc' )\n\t);\n\treturn $matches;\n}", "public function rules()\n {\n return [\n 'categories_names.*.locale_id' => self::REQUIRE_EXISTS['locale']['id'],\n 'categories_names.*.name' => self::CATEGORY_COMMON_RULES['name'] . '|unique:categories_locale,name',\n 'category_alias' => self::CATEGORY_COMMON_RULES['alias'] . '|unique:categories,alias'\n ];\n }", "public static function getRules()\n {\n return [\n 'NtelR' => 'nullable|telefone_com_ddd',\n 'NtelE' => 'nullable|telefone_com_ddd',\n 'NtelC' => 'nullable|celular_com_ddd',\n ];\n }", "protected function getShowValidationRules()\n {\n $showValidationRules = [\n 'yearEnd' => 'required|date_format:Y|gtef:yearStart|before_or_equal:' . date('Y'),\n 'yearStart' => 'required|date_format:Y|after_or_equal:1900|before_or_equal:' . date('Y'),\n ];\n\n return array_merge(\n $this->getMediaValidationRules(),\n $showValidationRules\n );\n }", "public function rules($type)\n {\n \treturn $this->factory($type)->rules();\n }", "public function getAppliedRuleIds();", "public function rules()\n {\n $intervals = $this->intervalsAsString();\n $layers = $this->layersAsString();\n $strategies = $this->strategiesAsString();\n\n $rules = [\n 'interval' => 'required|in:'.$intervals,\n 'name' => 'required',\n 'layer' => 'required|in:'.$layers,\n 'report_repeated' => 'required',\n 'report_email' => 'required|email',\n 'strategy' => 'required|in:'.$strategies,\n 'conditions' => 'required|array',\n 'actions' => 'required|array',\n ];\n\n if( is_array($this->actions) )\n {\n foreach( $this->actions as $key => $value )\n {\n $rules[\"actions.$key\"] = \"integer|exists:actions,id\";\n }\n }\n\n if( is_array($this->conditions) )\n {\n foreach( $this->conditions as $key => $value )\n {\n $comparison_options = $this->comparisonOptionsAsString( $this->conditions[$key]['id'] );\n\n $rules[\"conditions.$key.id\"] = \"integer|exists:conditions,id\";\n $rules[\"conditions.$key.comparable\"] = \"integer|exists:conditions,id\";\n $rules[\"conditions.$key.comparison\"] = \"required|in:$comparison_options\";\n }\n }\n\n return $rules;\n }", "public function rules() {\n return $this->get_from_model(__FUNCTION__);\n }", "abstract protected function getValidationRules();", "public function rules()\n {\n $this->setModel(ReferralProgram::class, 'referral_program');\n $rules = parent::rules();\n\n if ($this->isUpdate() || $this->isStore()) {\n $rules = array_merge($rules, [\n 'status' => 'required',\n 'title' => 'required|max:191',\n 'uri' => 'required|max:191',\n 'referral_action' => 'required|max:191',\n 'description' => 'required',\n ]);\n }\n\n if ($this->isStore()) {\n $rules = array_merge($rules, [\n 'name' => 'required|max:191|unique:referral_programs',\n ]);\n }\n\n if ($this->isUpdate()) {\n $referral_program = $this->route('referral_program');\n\n $rules = array_merge($rules, [\n 'name' => 'required|unique:referral_programs,name,' . $referral_program->id,\n ]);\n }\n\n\n\n return $rules;\n }", "protected abstract function rules();", "public function getRules()\n {\n return [\n 'title' => ['requiredFill', 'trim', 'htmlSpecialChars', 'len100'],\n 'content' => ['requiredFill', 'htmlSpecialChars'],\n 'categoryId' => ['requiredFill', 'isInteger'],\n ];\n }", "public function rules()\n {\n // get action name\n $routeAction = app('router')->currentRouteAction();\n $method = trim( strrchr($routeAction, '@'), '@');\n $rules = [];\n\n // 是否有对应方法的验证规则\n if ( isset($this->ruleConfig[$method]) ) {\n $rules = $this->ruleConfig[$method];\n\n // 可以设置一个默认规则列表,没有对应规则时则用默认的\n } elseif ( ! empty($this->ruleConfig['__default'])) {\n $rules = $this->ruleConfig['__default'];\n }\n\n return $rules;\n }", "public function rules()\n {\n $rules = [];\n $method = $this->getMethod();\n switch ($method) {\n case 'GET':\n if (Route::currentRouteName() === 'schoolActivity.getSchoolActivity') {\n $rules = [\n ];\n }\n break;\n }\n return $rules;\n }", "abstract public function getValidationRules(): array;", "public function getRules()\n\t{\n\t\t$rules['user_id'] = ['required', 'exists:' . app()->make(User::class)->getTable() . ',id'];\n\t\t$rules['org_id'] = ['required', 'exists:' . app()->make(Org::class)->getTable() . ',id'];\n\t\t$rules['role'] = ['required', 'string', 'in:' . implode(',', Static::ROLES)];\n\t\t$rules['scopes'] = ['nullable', 'array'];\n\t\t$rules['ended_at'] = ['nullable', 'date'];\n\t\t$rules['photo_url'] = ['nullable', 'string'];\n\n\t\treturn $rules;\n\t}", "public function getRules()\n {\n // Set the validation rules.\n $rules = [\n 'party_id' => 'integer|required|exists:pgsql.core.parties,id',\n 'bank_id' => 'integer|required|exists:pgsql.core.banks,id',\n 'currency_id' => 'integer|required|exists:pgsql.core.currencies,id',\n 'first_name' => 'string|required|max:50',\n 'last_name' => 'string|required|max:50',\n 'last_name' => 'string|nullable|max:255',\n 'type' => 'string|nullable|in:savings,current',\n 'class' => 'string|nullable|in:personal,business',\n ];\n\n // Add the account number check if it's a new record.\n if (!$this->exists) {\n $rules['account_number'] = 'string|required|max:100|unique:pgsql.core.bank_accounts,account_number,NULL,id,bank_id,' . $this->bank_id;\n }\n\n return $rules;\n }", "public function getRules()\n {\n return $this->validator->getRules();\n }", "public function rules()\n {\n $this->buildRules();\n return $this->rules;\n }", "abstract public function rules() : array;" ]
[ "0.69296914", "0.6497694", "0.6398725", "0.63526076", "0.624726", "0.6188006", "0.6080642", "0.6056404", "0.6019858", "0.5962805", "0.5840949", "0.58354306", "0.58125556", "0.57930315", "0.5770864", "0.5770864", "0.5756742", "0.5756742", "0.5756742", "0.5698183", "0.56785977", "0.5641875", "0.5616899", "0.5616899", "0.5616899", "0.5590817", "0.5574329", "0.5558098", "0.5547434", "0.552797", "0.5512856", "0.5506133", "0.54972625", "0.5478242", "0.54734594", "0.545317", "0.5445009", "0.54365224", "0.54302347", "0.542991", "0.54237586", "0.53707576", "0.53402114", "0.5334901", "0.532778", "0.53273", "0.5314615", "0.5314615", "0.5314615", "0.5310982", "0.5309592", "0.5309592", "0.53021747", "0.5289241", "0.52870756", "0.5279268", "0.5275087", "0.5265097", "0.5265097", "0.5265097", "0.5265097", "0.5257759", "0.52474946", "0.52459204", "0.52377725", "0.5235662", "0.5227238", "0.5227238", "0.5227238", "0.5227238", "0.5222474", "0.5207501", "0.52048576", "0.52044463", "0.5197287", "0.5194134", "0.51936096", "0.5191664", "0.5172551", "0.51724887", "0.5168578", "0.51636547", "0.5153168", "0.5142772", "0.5142728", "0.5115072", "0.511096", "0.51106954", "0.5109867", "0.5107924", "0.5104985", "0.51040596", "0.51017934", "0.5098947", "0.50972706", "0.5091742", "0.5088322", "0.5076746", "0.50715065", "0.50675803", "0.5066577" ]
0.0
-1
Build search query for the rule.
public function getSearchQuery($excludedCategories = array()) { $ruleOperator = $this->getAggregator(); $ruleValue = $this->getValue(); $conditions = array(); foreach ($this->getConditions() as $condition) { $condition->setRule($this->getRule()); $conditions[] = $condition->getSearchQuery($excludedCategories); } $conditions = array_filter($conditions); $query = false; if (!empty($conditions)) { if ($ruleOperator == 'any' && $ruleValue == '1') { $query = '(' . implode(' OR ', $conditions) . ')'; } elseif ($ruleOperator == 'any' && $ruleValue == '0') { $query = '-(' . implode(' AND ', $conditions) . ')'; } elseif ($ruleOperator == 'all' && $ruleValue == '1') { $query = '(' . implode(' AND ', $conditions) . ')'; } elseif ($ruleOperator == 'all' && $ruleValue == '0') { $query = '-(' . implode(' OR ', $conditions) . ')'; } } return $query; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function buildSearchQuery()\n {\n return $this->createSearchQuery()->getQuery();\n }", "protected function buildQuery()\n\t{\n\t\t$this->query = count($this->conditions) ? 'WHERE ' . implode(' AND ', $this->conditions) : '';\n\t}", "public function buildQuery() {\n\t\t\tif (isset($this->postTypes[$this->postType])) {\n\t\t\t\t$this->SetFilter('type', array($this->postTypes[$this->postType] + 1));\n\t\t\t}\n\t\t\t$this->SetFilter('status', array(1));\n\t\t\tswitch ($this->matchMode) {\n\t\t\t\tcase 'any';\n\t\t\t\tdefault:\n\t\t\t\t\t$this->SetMatchMode(SPH_MATCH_ALL);\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\tswitch ($this->sortMode) {\n\t\t\t\tcase 'posted':\n\t\t\t\t\t$this->SetSortMode(SPH_SORT_EXTENDED, 'posted DESC');\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'relevance':\n\t\t\t\t\t$this->SetSortMode(SPH_SORT_EXTENDED, '@relevance DESC, posted DESC');\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'top':\n\t\t\t\tdefault:\n\t\t\t\t\t$this->SetSortMode(SPH_SORT_EXPR, 'upvotes - downvotes + @weight + LN(posted) * 1000');\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\t$this->SetLimits((int) $this->currentPage, (int) $this->pageLimit, (int) $this->resultLimit);\n\t\t}", "function buildQuery( )\n {\n $field = \"KeyWords\";\n\n $QueryText = $this->QueryText;\n \n $QueryText = trim( $QueryText );\n// $QueryText = ereg_replace( \"[ ]+\", \" \", $QueryText );\n// $queryArray = explode( \" \", $QueryText );\n $QueryText = ereg_replace( '\\\\\\\\\"', '\"', $QueryText );\n preg_match_all( \"/((\\\"[^\\\"]+\\\")|([^ ]+))/\", $QueryText, $m );\n $queryArray = array();\n foreach( $m[0] as $match )\n {\n $queryArray[] = $match;\n }\n if ( count( $queryArray ) == 0 )\n $queryArray[] = \"\";\n\n $normalArray = array();\n $addArray = array();\n $subArray = array();\n\n foreach( $queryArray as $queryItem )\n {\n switch ( $queryItem[0] )\n {\n case '-':\n {\n $subArray[] = substr( $queryItem, 1 );\n break;\n }\n case '+':\n {\n $addArray[] = substr( $queryItem, 1 );\n break;\n }\n default:\n {\n $normalArray[] = $queryItem;\n }\n }\n }\n\n $arrs = array( array( \"array\" => \"normalArray\", \"item_delim\" => \"OR\", \"delim\" => \"OR\", \"compare\" => \"LIKE\" ),\n array( \"array\" => \"addArray\", \"item_delim\" => \"OR\", \"delim\" => \"AND\", \"compare\" => \"LIKE\" ),\n array( \"array\" => \"subArray\", \"item_delim\" => \"AND\", \"delim\" => \"AND\", \"compare\" => \"NOT LIKE\" ) );\n\n $total_query = \"\";\n foreach( $arrs as $arr )\n {\n $queryArray = ${$arr[\"array\"]};\n $item_delim = $arr[\"item_delim\"];\n $delim = $arr[\"delim\"];\n $compare = $arr[\"compare\"];\n $query = \"\";\n for ( $i=0; $i<count($queryArray); $i++ )\n {\n $queryVal = $queryArray[$i];\n if ( strlen( $queryVal ) > 1 and $queryVal[0] == '\"' and $queryVal[strlen($queryVal)-1] == '\"' )\n {\n $queryVal = substr( $queryVal, 1, strlen( $queryVal ) - 2 );\n }\n\n $subquery = \"\";\n for ( $j=0; $j<count($this->Fields); $j++ )\n {\n $queryItem = $queryVal;\n\n $queryItem = $this->Fields[$j] .\" $compare '%\" . $queryItem . \"%' \";\n\n if ( $j > 0 )\n $queryItem = $item_delim . \" \" . $queryItem . \" \";\n\n $subquery .= $queryItem;\n }\n $query .= \"( $subquery )\";\n\n if ( count( $queryArray) != ($i+1) )\n $query .= \" $delim \";\n }\n if ( count( $queryArray ) )\n {\n if ( !empty( $total_query ) )\n {\n $total_query = \"$total_query $delim ( $query )\";\n }\n else\n {\n $total_query = \"( $query )\";\n }\n }\n }\n return $total_query;\n }", "private function _sql_search() {\n\t\tglobal $wpdb;\n\n\t\tif (empty($this->search_term) || empty($this->search_columns)) {\n\t\t\t$this->warnings[] = __('Search parameters ignored: search_term and search_columns must be set.', CCTM_TXTDOMAIN);\n\t\t\treturn '';\n\t\t}\n\n\t\t$criteria = array();\n\n\t\tforeach ( $this->search_columns as $c ) {\n\t\t\t// For standard columns in the wp_posts table\n\t\t\tif ( in_array($c, self::$wp_posts_columns ) ) {\n\t\t\t\tswitch ($this->match_rule) {\n\t\t\t\tcase 'starts_with':\n\t\t\t\t\t$criteria[] = $wpdb->prepare(\"{$wpdb->posts}.$c LIKE %s\", $this->search_term.'%');\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'ends_with':\n\t\t\t\t\t$criteria[] = $wpdb->prepare(\"{$wpdb->posts}.$c LIKE %s\", '%'.$this->search_term);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'contains':\n\t\t\t\tdefault:\n\t\t\t\t\t$criteria[] = $wpdb->prepare(\"{$wpdb->posts}.$c LIKE %s\", '%'.$this->search_term.'%');\n\t\t\t\t}\n\t\t\t}\n\t\t\t// For custom field \"columns\" in the wp_postmeta table\n\t\t\telse {\n\t\t\t\tswitch ($this->match_rule) {\n\t\t\t\tcase 'starts_with':\n\t\t\t\t\t$criteria[] = $wpdb->prepare(\"{$wpdb->postmeta}.meta_key = %s AND {$wpdb->postmeta}.meta_value LIKE %s\"\n\t\t\t\t\t\t, $c\n\t\t\t\t\t\t, '%'.$this->search_term);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'ends_with':\n\t\t\t\t\t$criteria[] = $wpdb->prepare(\"{$wpdb->postmeta}.meta_key = %s AND {$wpdb->postmeta}.meta_value LIKE %s\"\n\t\t\t\t\t\t, $c\n\t\t\t\t\t\t, $this->search_term.'%');\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'contains':\n\t\t\t\tdefault:\n\t\t\t\t\t$criteria[] = $wpdb->prepare(\"{$wpdb->postmeta}.meta_key = %s AND {$wpdb->postmeta}.meta_value LIKE %s\"\n\t\t\t\t\t\t, $c\n\t\t\t\t\t\t, '%'.$this->search_term.'%');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$query = implode(' OR ', $criteria);\n\t\t$query = $this->join_rule . \" ($query)\";\n\t\treturn $query;\n\t}", "function query() {\n // Since attachment views don't validate the exposed input, parse the search\n // expression if required.\n if (!$this->parsed) {\n $this->query_parse_search_expression($this->value);\n }\n $required = FALSE;\n if (!isset($this->search_query)) {\n $required = TRUE;\n }\n else {\n $words = $this->search_query->words();\n if (empty($words)) {\n $required = TRUE;\n }\n }\n if ($required) {\n if ($this->operator == 'required') {\n $this->query->add_where($this->options['group'], 'FALSE');\n }\n }\n else {\n $search_index = $this->ensure_my_table();\n\n $search_condition = db_and();\n\n if (!$this->options['remove_score']) {\n // Create a new join to relate the 'serach_total' table to our current 'search_index' table.\n $join = new views_join;\n $join->construct('search_total', $search_index, 'word', 'word');\n $search_total = $this->query->add_relationship('search_total', $join, $search_index);\n\n $this->search_score = $this->query->add_field('', \"SUM($search_index.score * $search_total.count)\", 'score', array('aggregate' => TRUE));\n }\n\n if (empty($this->query->relationships[$this->relationship])) {\n $base_table = $this->query->base_table;\n }\n else {\n $base_table = $this->query->relationships[$this->relationship]['base'];\n }\n $search_condition->condition(\"$search_index.type\", $base_table);\n if (!$this->search_query->simple()) {\n $search_dataset = $this->query->add_table('search_dataset');\n $conditions = $this->search_query->conditions();\n $condition_conditions =& $conditions->conditions();\n foreach ($condition_conditions as $key => &$condition) {\n // Take sure we just look at real conditions.\n if (is_numeric($key)) {\n // Replace the conditions with the table alias of views.\n $this->search_query->condition_replace_string('d.', \"$search_dataset.\", $condition);\n }\n }\n $search_conditions =& $search_condition->conditions();\n $search_conditions = array_merge($search_conditions, $condition_conditions);\n }\n else {\n // Stores each condition, so and/or on the filter level will still work.\n $or = db_or();\n foreach ($words as $word) {\n $or->condition(\"$search_index.word\", $word);\n }\n\n $search_condition->condition($or);\n }\n\n $this->query->add_where($this->options['group'], $search_condition);\n $this->query->add_groupby(\"$search_index.sid\");\n $matches = $this->search_query->matches();\n $placeholder = $this->placeholder();\n $this->query->add_having_expression($this->options['group'], \"COUNT(*) >= $placeholder\", array($placeholder => $matches));\n }\n // Set to NULL to prevent PDO exception when views object is cached.\n $this->search_query = NULL;\n }", "protected function _buildQueryWhere(KDatabaseQuery $query)\n\t{\n \tif($search = trim($this->_state->search))\n\t\t{\n\t\t\t$parts\t= explode(' ', $search);\n\t\t\t$states\t= array();\n\t\t\tforeach($parts as $i => $part)\n\t\t\t{\n\t\t\t\tif(strpos($part, ':') === false) continue;\n\t\t\t\t$keys = explode(':', $part);\n\t\t\t\t$states[$keys[0]] = $keys[1];\n\t\t\t\tunset($parts[$i]);\n\t\t\t}\n\t\t\t\n\t\t\tif($states)\n\t\t\t{\n\t\t\t\t$conditions = array();\n\t\t\t\tforeach(array('username', 'email') as $key)\n\t\t\t\t{\n\t\t\t\t\tif(isset($states[$key]))\n\t\t\t\t\t{\n\t\t\t\t\t\t$query->where('tbl.'.$key, 'LIKE', '%'.$states[$key].'%');\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif($parts) $query->where('tbl.name', 'LIKE', '%'.implode($parts).'%');\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t//To avoid auto quoting, and also trim trailing whitespace\n\t\t\t\t$search = $this->getTable()->getDatabase()->quoteValue('%'.strtoupper($search).'%');\n\t\t\t\t$name \t= '';\n\n\t\t\t\tif (JFactory::getApplication()->isAdmin())\n\t\t\t\t\t\t$name = 'tbl.name LIKE '.$search.' OR';\n\t\t\t\t$query\n\t\t\t\t\t ->where(\"($name tbl.username LIKE $search OR tbl.email LIKE $search OR person.alias LIKE $search)\")\n\t\t\t\t\t /*->where('tbl.name', 'LIKE', '%'.$search.'%', 'or')\n\t\t\t\t\t ->where('tbl.username', 'LIKE', '%'.$search.'%', 'or')\n\t\t\t\t\t ->where('tbl.email', 'LIKE', '%'.$search.'%', 'or')*/;\n\t\t\t}\n\t\t}\n\t\t\n\t\t$group = $this->_state->usergroup;\n\t\tif($group)\n\t\t{\n\t\t\t$column = version_compare(JVERSION,'1.6.0','ge') ? 'group_id' : 'gid';\n\t\t\t$query->where($column, '=', (int)$group);\n\t\t}\n\t\t\n\t\tif(!$this->_state->me)\n\t\t{\n\t\t $me = $this->getService('com://admin/ninjaboard.model.people')->getMe();\n\t\t\t$query->where('tbl.id', '!=', $me->id);\n\t\t}\n\t\t\n\t\t//Don't show blocked users\n\t\t$query->where('tbl.block', '=', 0);\n\n\t\tparent::_buildQueryWhere($query);\n\t}", "private function makeQuery(){\n\t\t\n\t\t$this->searchQ['select'] = array('l.name','l.summary','l.sum_approach','l.sum_problems','l.address_line_1','l.address_line_2','l.town','l.county','l.postcode','l.country','l.phone','l.latitude','l.longitude','l.publish_address','l.publish_phone','l.approved','p.uri','p.urlname','e.level','y.listing_type');\n\t\t$this->searchQ['select'][] = '(SELECT i.image FROM listing_images i WHERE l.listing_id=i.listing_id ORDER BY i.sort_order ASC LIMIT 1) AS image';\n\t\t$this->searchQ['from'] = 'listing_level e, listing_type y, pages p, listing l '; //should always be the same...\n\t\t$this->searchQ['where'] = array('e.level_id = l.level_id','y.listing_type_id = l.listing_type_id','l.page_id = p.page_id','l.publish = 1');//,'p.publish = 1');\n\t\t\n\t\t// set up the initial search variables\t\t\n\t\t//! location\n\t\tif( strlen($this->vars['location']) ){\n\t\t\n\t\t\t$this->Geocode = new Geolocation( $this->vars['location']. ', UK' );\n\t\t\t$this->Geocode->lookup();\n\t\t\t// using the OS grid as makes calculation simpler than using lng/lat - can use simple pythag rather than calculus functions\n\t\t\t// we shorten the list of rows needing the calculation by the greater / less than in the where\n\t\t\t\n\t\t\t$calculation = ' SQRT(POW(( l.easting - ' . round($this->Geocode->getOSEast()) . '),2) + POW((l.northing - ' . round($this->Geocode->getOSNorth()) . '),2)) ';\n\t\t\t$this->searchQ['select'][] = $calculation . \" AS distance\";\n\t\t\t$this->searchQ['where'][] = \"northing < \" . round( $this->Geocode->getOSNorth() + $this->searchDistance ) ; \n\t\t\t$this->searchQ['where'][] = \"northing > \" . round( $this->Geocode->getOSNorth() - $this->searchDistance ) ;\n\t\t\t$this->searchQ['where'][] = \"easting < \" . round( $this->Geocode->getOSEast() + $this->searchDistance ) ;\n\t\t\t$this->searchQ['where'][] = \"easting > \" . round( $this->Geocode->getOSEast() - $this->searchDistance ) ;\n\t\t//\t$this->searchQ['where'][] = \"(\" . $calculation . \") <= \" . $this->searchDistance ;\n\t\t// use having rather than where\n\t\t\t$this->searchQ['having'][] = \"distance <= \" . $this->searchDistance;\n\t\t\t//$this->searchQ['orderby'][] = '(distance - ((l.level_id-1)*16000)) ASC'; // (x^3 -400^3)^(1/3)\n\t\t\t\n\t\t\t// using a exponential function to order distances based on the listing level and multiplying by 16000 m = 16km = 10 miles\n\t\t\t// then raising to power 3, deleteing the distance cubed and then 1/3 (cube root), so only makes a diffenrce within that area\n\t\t\t\n\t\t\t$this->searchQ['orderby'][] = ' POW( (POW( distance ,3) - POW(((l.level_id-1)*' . $this->levelMultiplier. '),3)),(1/3)) ASC ';\n\t\t\t$this->searchQ['orderby'][] = 'l.level_id DESC';\n\t\t\t$this->doSearch = true;\n\t\t}else{\n\t\t\t$this->searchQ['orderby'][] = 'l.level_id DESC';\n\t\t}\n\t\t\n\t\t//! freetext\n\t\tif( strlen($this->vars['term']) ){\n\t\t\t$this->searchQ['select'][] = \"MATCH(\" . $this->ftfields . \") AGAINST ('\" . $this->booleanAndTerm($this->vars['term']) . \"' IN BOOLEAN MODE) AS score\";\n\t\t\t//$this->searchQ['where'][] = \"MATCH(\" . $ftfields . \") AGAINST ('\" . $this->booleanAndTerm($this->vars['term']) . \"' IN BOOLEAN MODE)\";\n\t\t\t// use having rather than where\n\t\t\t$this->searchQ['having'][] = \"score > 0\";\n\t\t\t$this->searchQ['orderby'][] = 'score DESC';\n\t\t\t$this->doSearch = true;\n\t\t}\n\t\t\n\t\t\n\t\t//! **** FILTERS ****\n\t\t//! profession\n\t\tif( isset($this->vars['profession']) && strlen($this->vars['profession']) ){\n\t\t\n\t\t\t//$this->searchQ['where'][] = \" l.listing_type_id IN (\" . implode(',', $this->vars['profession']) . \") \";\n\t\t\t$this->searchQ['where'][] = \" l.listing_type_id = \" . (int)$this->vars['profession'] . \" \";\n\t\t\t$this->doSearch = true;\n\t\t}\n\t\t//! max price\n\t\tif( isset($this->vars['maxprice']) && is_numeric($this->vars['maxprice']) ){\n\t\t\n\t\t\t$this->searchQ['where'][] = \" l.hourly_rate <= \" . (int)$this->vars['maxprice'] . \" \";\n\t\t\t$this->doSearch = true;\n\t\t}\n\t\t\n\t\t//! gender\n\t\tif( isset($this->vars['gender']) && in_array($this->vars['gender'] , array('M','F')) ){\n\t\t\n\t\t\t$this->searchQ['from'] .= ', listing_to_gender ltg';\n\t\t\t$this->searchQ['where'][] = \" ltg.listing_id = l.listing_id \";\n\t\t\t$this->searchQ['where'][] = \" ltg.gender = '\" . $this->vars['gender'] . \"' \";\n\t\t\t$this->doSearch = true;\n\t\t}\n\t\n\t\t//! speciality\n\t\tif( isset($this->vars['speciality']) && is_numeric($this->vars['speciality']) ){\n\t\t\n\t\t\t$this->searchQ['from'] .= ', listing_to_age ltag';\n\t\t\t$this->searchQ['where'][] = \" ltag.listing_id = l.listing_id \";\n\t\t\t$this->searchQ['where'][] = \" ltag.age_id = \" . (int)$this->vars['speciality'] . \" \";\n\t\t\t$this->doSearch = true;\n\t\t}\n\t\t\n\t\t//! ** build the query **\n\t\t$q = \"SELECT \" . (($this->numRows)?' SQL_CALC_FOUND_ROWS ':'') . implode(',', $this->searchQ['select']). \"\n\t\t\t\tFROM \" . $this->searchQ['from'] . \"\n\t\t\t\tWHERE\n\t\t\t\t\t\" . implode(' AND ', $this->searchQ['where']) ;\n\n\t\tif( isset($this->searchQ['having']) && count($this->searchQ['having']) ){\n\t\t\t$q .= \" HAVING \" . implode(' AND ' , $this->searchQ['having']);\n\t\t}\n\t\t\n\t\t$q .= \"\tORDER BY \" . implode(',', $this->searchQ['orderby']) . \" \";\n\t\t\n\t\t$q .= \"\tLIMIT \" . ( ($this->page-1)* $this->limit) . \",\" . $this->limit . \" \"; \n\t\n\t\treturn $q;\n\t\t\n\t}", "public function build()\n {\n if(empty($this->query)) return array(\"\", array());\n return array(\n \" {$this->phrase} \" . join(\" AND \", $this->query),\n $this->bind\n );\n }", "private function buildQuery()\n {\n $params = JComponentHelper::getParams('com_easybookreloaded');\n\n // If type is feed, then the order has to be DESC to get the latest entries in the feed reader\n $document = JFactory::getDocument();\n\n if($document->getType() == 'feed')\n {\n $order = 'DESC';\n }\n else\n {\n $order = $params->get('entries_order', 'DESC');\n }\n\n // Check whether limit is already set - e.g. from feed function\n $limit = JFactory::getApplication()->input->getInt('limit', 0);\n\n if(empty($limit))\n {\n $limit = (int)$params->get('entries_perpage', 5);\n }\n\n $start = JFactory::getApplication()->input->getInt('limitstart', 0);\n\n if(_EASYBOOK_CANEDIT)\n {\n $query = \"SELECT * FROM \".$this->_db->quoteName('#__easybook').\" ORDER BY \".$this->_db->quoteName('gbdate').\" \".$order.\" LIMIT \".$start.\", \".$limit;\n }\n else\n {\n $query = \"SELECT * FROM \".$this->_db->quoteName('#__easybook').\" WHERE \".$this->_db->quoteName('published').\" = 1 ORDER BY \".$this->_db->quoteName('gbdate').\" \".$order.\" LIMIT \".$start.\", \".$limit;\n }\n\n return $query;\n }", "function build_query($user_search, $sort) {\n // Generate search query\n $query = \"SELECT * FROM riskyjobs\";\n $where_list = array();\n\n // Replace commas in entered search phrase\n $user_search = str_replace(',', ' ', $user_search);\n\n $search_words = explode(' ', $user_search);\n $final_search_words = array();\n\n // Confirm that search words were entered\n if (count($search_words) > 0) {\n foreach ($search_words as $word) {\n if (!empty($word)) {\n $final_search_words[] = $word;\n }\n }\n }\n\n // Generate where clause of search query if search words exist\n if (count($final_search_words) > 0) {\n foreach ($final_search_words as $word) {\n $where_list[] = \"description LIKE '%$word%'\";\n }\n }\n\n // Add OR keywords in-between where list\n $where_clause = implode(' OR ', $where_list);\n\n // Combine where clause with rest of search query\n if (!empty($where_clause)) {\n $query .= \" WHERE $where_clause\";\n }\n\n // Append sorting to query based on sort mode\n switch ($sort) {\n // Ascending job title\n case 1:\n $query .= ' ORDER BY title';\n break;\n // Descending job title\n case 2:\n $query .= ' ORDER BY title DESC';\n break;\n // Ascending state\n case 3:\n $query .= ' ORDER BY state';\n break;\n // Descending state\n case 4:\n $query .= ' ORDER BY state DESC';\n break;\n // Ascending date posted\n case 5:\n $query .= ' ORDER BY date_posted';\n break;\n // Descending date posted\n case 6:\n $query .= ' ORDER BY date_posted DESC';\n break;\n // No sorting mode selected\n default:\n break;\n }\n\n return $query;\n }", "public function createSearchQuery()\n {\n $query = new SearchQuery($this->elastic);\n $query->listeners = $this->listeners;\n return $query;\n }", "abstract protected function buildQuery(): string;", "public function build()\n {\n $query = $this->qb;\n if ($this->getWhereExpression()) {\n $query->where($this->getWhereExpression());\n }\n foreach ($this->getWhereParameters() as $key => $param) {\n $query->setParameter($key, $param, is_array($param) ? Connection::PARAM_STR_ARRAY : null);\n }\n\n return $query;\n }", "private function buildWhere()\n {\n $query = array();\n\n // Make sure there's something to do\n if (isset($this->query['where']) and count($this->query['where'])) {\n foreach ($this->query['where'] as $group => $conditions) {\n $group = array(); // Yes, because the $group above is not used, get over it.\n foreach ($conditions as $condition => $value) {\n // Get column name\n $cond = explode(\" \", $condition);\n $column = str_replace('`', '', $cond[0]);\n $safeColumn = $this->columnName($column);\n\n // Make the column name safe\n $condition = str_replace($column, $safeColumn, $condition);\n\n // Add value to the bind queue\n $valueBindKey = str_replace(array('.', '`'), array('_', ''), $safeColumn);\n\n if (!empty($value) or $value !== null) {\n $this->valuesToBind[$valueBindKey] = $value;\n }\n\n // Add condition to group\n $group[] = str_replace(\"?\", \":{$valueBindKey}\", $condition);\n }\n\n // Add the group\n $query[] = \"(\" . implode(\" AND \", $group) . \")\";\n }\n\n // Return\n return \"WHERE \" . implode(\" OR \", $query);\n }\n }", "public function buildQueryString();", "public function buildQuery() {\n\t\t$where = (sizeof($this->wheres) > 0) ? ' WHERE '.implode(\" \\n AND \\n\\t\", $this->wheres) : '';\n\t\t$order = (sizeof($this->orders) > 0) ? ' ORDER BY '.implode(\", \", $this->orders) : '' ;\n\t\t$group = (sizeof($this->groups) > 0) ? ' GROUP BY '.implode(\", \", $this->groups) : '' ;\n\t\t$query = 'SELECT '.implode(\", \\n\\t\", $this->fields).\"\\n FROM \\n\\t\".$this->class->table.\"\\n \".implode(\"\\n \", $this->joins).$where.' '.$group.' '.$order.' '.$this->limit;\n\t\treturn($query);\n\t}", "protected function getSearchQuery()\n {\n $searchQuery = \"\";\n if (isset($_POST['searchName'])) {\n $searchQuery = Convert::slugify($_POST['searchName']);\n }\n return (string) str_replace(\"-\", \"+\", $searchQuery);\n }", "private function _getBaseSearchQuery()\n {\n $store = Mage::app()->getStore($this->getStoreId());\n $collection = Mage::helper('catalogsearch')\n ->getEngine()\n ->getResultCollection()\n ->addSearchFilter($this->getFulltextQuery());\n\n $allowedVisibilities = Mage::getSingleton('catalog/product_visibility')->getVisibleInSearchIds();\n $allowedStatuses = Mage::getSingleton('catalog/product_status')->getVisibleStatusIds();\n\n $query = $collection->getSearchEngineQuery()\n ->addFilter('terms', array('store_id' => $this->getStoreId()))\n ->addFilter('terms', array('visibility' => $allowedVisibilities))\n ->addFilter('terms', array('status' => $allowedStatuses))\n ->setLanguageCode(Mage::helper('smile_elasticsearch')->getLanguageCodeByStore($store))\n ->setPageParams(0, self::PREVIEW_SIZE)\n ->getRawQuery();\n\n return $this->_applyOptimizers($query);\n }", "public function compile()\n {\n // set every condition in the query array\n $this->query['body']['query'] = [];\n foreach ($this->constraints as $constraint) {\n $this->query['body']['query'] = array_merge($this->query['body']['query'], $this->compileConstraint($constraint));\n }\n\n foreach ($this->bools as $bool) {\n if (array_key_exists('constraint', $bool)) {\n $this->query['body']['query']['bool'][$bool['type']][] = $this->compileConstraint($bool['constraint']);\n }\n if (array_key_exists('query_string', $bool)) {\n $this->query['body']['query']['bool'][$bool['type']][] = $bool['query_string'];\n }\n if (array_key_exists('script', $bool)) {\n $this->query['body']['query']['bool'][$bool['type']][] = $bool['script'];\n }\n if (array_key_exists('bool', $bool)) {\n $this->query['body']['query']['bool'][$bool['type']][] = array('bool' => $bool['bool']);\n }\n }\n if (!empty($this->aggs)) {\n $this->query['body']['aggs'] = $this->aggs;\n }\n if ($this->sort) {\n $this->query['body']['sort'] = $this->sort;\n }\n if ($this->scroll_param) {\n $this->query['scroll'] = $this->scroll_param;\n }\n if ($this->highlight) {\n $this->query['body']['highlight'] = $this->highlight;\n }\n if ($this->filter) {\n $this->query['body']['query']['bool']['filter'] = $this->filter;\n }\n if ($this->query_string) {\n $this->query['body']['query']['query_string'] = $this->query_string;\n }\n if ($this->script) {\n $this->query['body']['query']['script']['script'] = $this->script;\n }\n if ($this->fromType) {\n $this->query['type'] = $this->fromType;\n }\n if ($this->fromIndex) {\n $this->query['index'] = $this->fromIndex;\n } elseif (isset($this->model) && $this->model) {\n $this->query[\"index\"] = $this->model->getIndex();\n }\n return $this->query;\n }", "private function build_query(){\n if(!isset($this->keyword)){\n throw new Exception('Missing keyword search: http://.../github/search/<keyword>');\n }\n $this->query = $this->url.'?q='.$this->keyword;\n $this->query .= '&page='.intval($this->page_number);\n $this->query .= '&per_page='.intval($this->results_per_page);\n if($this->sort_by[0]) $this->query .= '&sort='.$this->sort_by; //TODO: sanitize a mozna lepsi podminka\n return $this;\n }", "public function actionSearchConstructor()\n\t{\n\t\t\n\t\t/*\n\t\t * Constructor for the SQL query. The query is created on multiple passes on the for loop,\n\t\t * each iteration of the loop adds more to the query. The $haystack array contains\n\t\t * names of every column that should be available for search.\n\t\t */\n\t\t\n\t\t// creates the database criteria object\n\t\t$searchCriteria = new CDbCriteria;\n\t\t// another object, will be later on merged with the first object to create\n\t\t// x AND x AND (x OR x OR x OR) structure, the OR part coming from the textSearchCriteria\n\t\t$textSearchCriteria = new CDbCriteria;\n\t\t\n\t\t/*\n\t\t * Constructs the portion of the query which combines the 'kohteet' table and the 'diat' table.\n\t\t */\n\t\tif(strlen($_POST['kohde'])>0)\n\t\t{\n\t\t\t$parseThis = $_POST['kohde'];\n\t\t\t$parseThis = str_replace(' ','',$parseThis);\n\t\t\t// getting rid of capital letters\n\t\t\t$parsedKohde = strtolower($parseThis);\n\t\t\t// the textField is a single field which reads building value which is stored in two fields\n\t\t\t// so we need to parse the input\n\t\t\t$saari = substr($parsedKohde,0,1);\n\t\t\tif(count($_POST['kohde'])==2) {\n\t\t\t\t$rakennus = substr($parsedKohde,1,1); }\n\t\t\telse {\n\t\t\t\t$rakennus = substr($parsedKohde,1,3); }\n\t\t\t$searchCriteria->join = 'JOIN kohteet ON kohteet.cdno = t.cd AND kohteet.idno = t.id';\n\t\t\t$searchCriteria->addCondition('kohteet.saari=:saari');\n\t\t\t$searchCriteria->params[':saari'] = $saari;\n\t\t\t// if there is no building information, only the island code eg 'a'\n\t\t\tif($rakennus!='')\n\t\t\t{\n\t\t\t\t$searchCriteria->params[':rakennus'] = $rakennus;\n\t\t\t\t$searchCriteria->addCondition('kohteet.rakennus=:rakennus');\n\t\t\t}\n\t\t}\n\t\t\n\t\t$searchCriteria->distinct = true;\n\t\t\n\t\t$haystack = Image::model()->searchableFields();\n\t\t\t// array of column names in the tables database\n\t\t\n\t\tfor($i=0;$i<count($haystack);$i++) // the for loop is repeated for every field in the\n\t\t\t// ->searchableFields array, so every form element is included in the search\n\t\t{\n\t\t\t\n\t\t\t// if an field is left empty at the search form, nothing from it will be added to the query\n\t\t\tif (!empty($_POST['Image'][$haystack[$i]]))\n\t\t\t{\n\t\t\t\t// adds padding to the cd and id fields, searching in input for '4' pads it with zeroes so images from cd '0004' are returned\n\t\t\t\tif ($haystack[$i] == 'cd' || $haystack[$i] == 'id')\n\t\t\t\t{\n\t\t\t\t\t$searchCriteria->addCondition($haystack[$i] . '=:' . $haystack[$i]);\n\t\t\t\t\t$searchCriteria->params[':' . $haystack[$i]] = str_pad($_POST['Image'][$haystack[$i]],4,'0',STR_PAD_LEFT);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t// 'valokuvaaja' is searched as a exact string\n\t\t\t\tif ( $haystack[$i] == 'valokuvaaja')\n\t\t\t\t{\n\t\t\t\t\t$searchCriteria ->addSearchCondition('valokuvaaja',$_POST['Image']['valokuvaaja'],true,'AND','ILIKE');\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// individual fields such as kuvateksti are set in a different way in this if structure\n\t\t\t\tif( $haystack[$i] == 'kuvateksti' )\n\t\t\t\t{\n\t\t\t\t\t// running the user input to $textwords, while replacing commas and equivalent with spaces\n\t\t\t\t\t$textwords = str_replace(array(',',';',':'), ' ',$_POST['Image'][$haystack[$i]]);\n\t\t\t\t\t// splitting the search words to array, with individual words in it\n\t\t\t\t\t$textwords = explode(' ',$textwords);\n\t\t\t\t\t\n\t\t\t\t\tfor($w=0;$w<count($textwords);$w++)\n\t\t\t\t\t{\n\t\t\t\t\t\t// getting rid of commas and dots, in case someone decides to use them\n\t\t\t\t\t\t$textwords[$w] = str_replace(array(',',';',':'), '', $textwords[$w]);\n\t\t\t\t\t\t// adds in a search condition\n\t\t\t\t\t\t$textSearchCriteria->addSearchCondition(\n\t\t\t\t\t\t\t'kuvateksti', // the column name (or a valid SQL expression)\n\t\t\t\t\t\t\t$textwords[$w], // the search keyword, affected by next parameter\n\t\t\t\t\t\t\ttrue, // whether the keyword should be escaped if it contains % or _ , when this parameter\n\t\t\t\t\t\t\t\t // is true the special characters % or _ will be escaped and the keyword will be surrounded\n\t\t\t\t\t\t\t\t // by % character on both ends.\n\t\t\t\t\t\t\t'AND', // pick AND or OR SQL operator\n\t\t\t\t\t\t\t'ILIKE' // case insensitive LIKE\n\t\t\t\t\t\t);\n\t\t\t\t\t\t// same as before, except in place of 'kuvateksti' is 'diateksti' , so both colums are searched based on the text search input\n\t\t\t\t\t\t// $textSearchCriteria->addSearchCondition('diateksti', $textwords[$w], true, 'OR', 'ILIKE' );\n\t\t\t\t\t}\n\t\t\t\t\tcontinue; // skips the addCondition and params below, so the SQL is not doubled\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// this is done for all the 'tag' type values such as 'valokuva'\n\t\t\t\t$searchCriteria->addCondition($haystack[$i] . '=:' . $haystack[$i]);\n\t\t\t\t\t// adds condition such as 'valokuva=:valokuva'\n\t\t\t\t$searchCriteria->params[':' . $haystack[$i]] = $_POST['Image'][$haystack[$i]];\n\t\t\t\t\t// adds the parameter to the parameter array, params array(':valokuva'=>'valokuva')\n\t\t\t\t\t\t\n\t\t\t} // the if(!empty($_POST['Image'])) -statement ends\n\t\t\t\n\t\t} // the for loop ends\n\t\t\n\t\t// adds a query condition which filters out deleted images\n\t\t$searchCriteria->addCondition('deleted=false');\n\t\t\n\t\t// how the images are sorted\n\t\t// $searchCriteria->order = 'imageid ASC';\n\t\t$searchCriteria->order = $_POST['searchsort'];\n\t\t\n\t\t/*\n\t\t * Criteria for the date values. If the 'aikavali' checkbox is checked, both fields are used\n\t\t * and the query is made for dates between the two inserterd date. If the 'aikavali' is unchecked\n\t\t * only the exact date will be searched. Uninserted date, month and year values are treated as wildcards '_'.\n\t\t */\n\t\tif(isset($_POST['aikavali']))\n\t\t{\t\n\t\t\t// if the between criteria is used, the '00' values are added instead of the wildcard '_' values\t\t\t\t\n\t\t\t$dateOne = $this->parseDateInput($_POST['dayOne'], $_POST['monthOne'], $_POST['yearOne']);\n\t\t\t$dateTwo = $this->parseDateInput($_POST['dayTwo'], $_POST['monthTwo'], $_POST['yearTwo'],true);\n\t\t\t$searchCriteria->addBetweenCondition('pvm',$dateOne,$dateTwo);\t\n\t\t}\n\t\telse if(isset($_POST['tarkkaaika']))\n\t\t{\n\t\t\t$searchDate = $this->parseDateInput($_POST['dayOne'], $_POST['monthOne'], $_POST['yearOne'],true);\n\t\t\t$searchCriteria->addSearchCondition('pvm',$searchDate,false);\n\t\t}\n\t\t\n\t\t// merges the two criterias\n\t\t$searchCriteria->mergeWith($textSearchCriteria);\n\t\t\n\t\t// stores the searchCriteria so that the dataprovider can be created again\n\t\tYii::app()->user->setState('imagesearchcriteria', $searchCriteria);\t\t\n\t\t\n\t\t$this->redirect(array('results'));\n\t\t\n\t}", "private function _getBaseSearchQuery()\n {\n $store = Mage::app()->getStore($this->getStoreId());\n $collection = Mage::helper('catalogsearch')\n ->getEngine()\n ->getResultCollection();\n\n $allowedVisibilities = Mage::getSingleton('catalog/product_visibility')->getVisibleInCatalogIds();\n $allowedStatuses = Mage::getSingleton('catalog/product_status')->getVisibleStatusIds();\n\n $query = $collection->getSearchEngineQuery()\n ->addFilter('terms', array('visibility' => $allowedVisibilities))\n ->addFilter('terms', array('status' => $allowedStatuses));\n\n if ($this->getStoreId() != Mage_Core_Model_App::ADMIN_STORE_ID) {\n $query->addFilter('terms', array('store_id' => $this->getStoreId()));\n }\n\n // Append the query string for the virtual categories\n if ($rule = $this->getCategory()->getVirtualRulePreview()) {\n $queryString = $this->_getQueryStringFromRule($rule);\n $query->addFilter('query', array('query_string' => $queryString));\n }\n\n $query = $query->setLanguageCode(Mage::helper('smile_elasticsearch')->getLanguageCodeByStore($store));\n\n $query->setQueryType(\"category_products_layer\");\n\n // Mimic query assembling, because ->search() is never really called on it\n $eventData = new Varien_Object(\n array('query' => $query->getRawQuery(), 'query_type' => $query->getQueryType(), 'store_id' => $this->getStoreId())\n );\n Mage::dispatchEvent('smile_elasticsearch_query_assembled', array('query_data' => $eventData));\n\n $query = $eventData->getQuery();\n\n return $query;\n }", "protected function _getQueryStringFromRule(Smile_VirtualCategories_Model_Rule $rule)\n {\n // Do not call directly getSearchQuery() on rule because it would load from cache instead of recalculate\n $rule->addUsedCategoryIds($this->getCategory()->getId());\n $rule->getConditions()->setRule($rule);\n $queryString = $rule->getConditions()->getSearchQuery();\n\n // Append the root category query string if needed\n if ($rootCategory = $this->_getVirtualRootCategory($this->getCategory())) {\n $rootCategoryQuery = $this->_getVirtualRule($rootCategory)->getSearchQuery($this->getCategory()->getId());\n if ($queryString) {\n $queryString = \"(\" . $queryString . \" AND (\" . $rootCategoryQuery . \"))\";\n } else {\n $queryString = \"(\" . $rootCategoryQuery . \")\";\n }\n }\n\n return $queryString;\n }", "public function buildWhereClause()\n {\n $criterias = $this->bean->ownCriteria;\n if (empty($criterias)) {\n return '1';\n }// find all because there are no criterias\n $where = array();\n $this->filter_values = array();\n //$mask = \" %s %s %s\"; // login, field, op (with masked value)\n $n = 0;\n foreach ($criterias as $id=>$criteria) {\n if (! $criteria->op) {\n continue;\n } // skip all entries that say any!\n if ($criteria->value === null || $criteria->value === '') {\n continue;\n } // skip all empty\n $n++;\n $logic = 'AND ';//$criteria->logic;\n if ($n == 1) {\n $logic = '';\n }\n $where[] = $logic.$criteria->makeWherePart($this);\n }\n\n if (empty($where)) {\n return '1';\n }// find all because there was no active criteria\n\n $where = implode(' ', $where);\n return $where;\n }", "function buildQueryString($q) {\r\n\t\t$i=0;\r\n\t\tforeach($q['RuleValuePair'] as $rule_id=>$value) {\r\n\t\t\t#Sintax for \"AND\", empty logical means \"AND\" as well, by default\r\n\t\t\tif(eregi('and',$q['logical'][$i]) || $q['logical'][$i]=='') {\r\n\t\t\t\t$AND[$i] = TRUE;\r\n\t\t\t} elseif(eregi('or',$q['logical'][$i])) {\r\n\t\t\t\t$OR[$i] = TRUE;\r\n\t\t\t} elseif(eregi('not', $q['logical'][$i])) {\r\n\t\t\t\t$NOT[$i] = TRUE;\r\n\t\t\t}\r\n\t\t\t#There is a small difference in MySQL and Postgres\r\n\t\t\t$regex = $GLOBALS['regexp'];\r\n\r\n\t\t\t#Basic query string\r\n\t\t\t$sql[$i] = \"select resource_id from s3db_statement where rule_id='\".$rule_id.\"' and value \".$logical.$regex.\"'\".$value.\"'\";\r\n\t\r\n\t\t\t#Increment the queries\r\n\t\t\t#Case when only one thing is queried\r\n\t\t\tif(count($q['RuleValuePair'])==1) {\r\n\t\t\t\t$sqlComplete .= \"\".$sql[$i].\"\";\r\n\t\t\t} else {\r\n\t\t\t\tif($i==0) {\r\n\t\t\t\t\tif($AND[$i]) { $sqlComplete = \"\".$sql[0].\"\"; }\r\n\t\t\t\t\telseif($NOT[$i]) { $sqlComplete = \"\".$sql[0].\"\"; }\r\n\t\t\t\t\telseif($OR[$i]) { $sqlComplete = \"(\".$sql[0].\")\"; }\r\n\t\t\t\t} else {\r\n\t\t\t\t\tif($AND[$i-1]) { $sqlComplete = \"\".$sql[$i].\" and resource_id in (\".$sqlComplete.\")\"; }\r\n\t\t\t\t\telseif($OR[$i-1]) { $sqlComplete = \"(\".$sql[$i].\") union \".$sqlComplete.\"\"; }\r\n\t\t\t\t\telseif($NOT[$i-1]) { $sqlComplete = \"\".$sql[$i].\" and resource_id not in (\".$sqlComplete.\")\"; }\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t$i++;\r\n\t\t}\r\n\t\treturn $sqlComplete;\r\n\t}", "protected function buildSearchQuery($searchPhrase){\n\t\t\n\t\t$searchParts = explode(' ',trim($searchPhrase));\n\t\t$str = '';\n\t\tforeach($searchParts as $part) {\n\t\t\t$str .= \"iL.title LIKE '%\".$part.\"%' or iLT.title like '%\".$part.\"%' OR \";\n\t\t\t\n\t\t} \n\t\treturn substr($str, 0, -3);\n\t}", "private function makeQueryNoSplit(){\n\t\t\n\t\t$this->searchQ['select'] = array('l.name','l.summary','l.sum_approach','l.sum_problems','l.address_line_1','l.address_line_2','l.town','l.county','l.postcode','l.country','l.phone','l.image','l.latitude','l.longitude','l.publish_address','l.publish_phone','l.approved','p.uri','p.urlname','e.level','y.listing_type');\n\t\t$this->searchQ['orderby'][] = 'l.level_id DESC';\n\t\t$this->searchQ['from'] = 'listing l, listing_level e, listing_type y, pages p'; //should always be the same...\n\t\t$this->searchQ['where'] = array('e.level_id = l.level_id','y.listing_type_id = l.listing_type_id','l.page_id = p.page_id','l.publish = 1');//,'p.publish = 1');\n\t\t\n\t\t// set up the initial search variables\t\t\n\t\t//! location\n\t\tif( strlen($this->vars['location']) ){\n\t\t\n\t\t\t$this->Geocode = new Geolocation( $this->vars['location']. ', UK' );\n\t\t\t$this->Geocode->lookup();\n\t\t\t// using the OS grid as makes calculation simpler than using lng/lat - can use simple pythag rather than calculus functions\n\t\t\t// we shorten the list of rows needing the calculation by the greater / less than in the where\n\t\t\t\n\t\t\t$calculation = ' SQRT(POW(( l.easting - ' . round($this->Geocode->getOSEast()) . '),2) + POW((l.northing - ' . round($this->Geocode->getOSNorth()) . '),2)) ';\n\t\t\t$this->searchQ['select'][] = $calculation . \" AS distance\";\n\t\t\t$this->searchQ['where'][] = \"northing < \" . round( $this->Geocode->getOSNorth() + $this->searchDistance ) ; \n\t\t\t$this->searchQ['where'][] = \"northing > \" . round( $this->Geocode->getOSNorth() - $this->searchDistance ) ;\n\t\t\t$this->searchQ['where'][] = \"easting < \" . round( $this->Geocode->getOSEast() + $this->searchDistance ) ;\n\t\t\t$this->searchQ['where'][] = \"easting > \" . round( $this->Geocode->getOSEast() - $this->searchDistance ) ;\n\t\t//\t$this->searchQ['where'][] = \"(\" . $calculation . \") <= \" . $this->searchDistance ;\n\t\t// use having rather than where\n\t\t\t$this->searchQ['having'][] = \"distance <= \" . $this->searchDistance;\n\t\t\t$this->searchQ['orderby'][] = 'distance ASC';\n\t\t\t$this->doSearch = true;\n\t\t}\n\t\t//! freetext\n\t\tif( strlen($this->vars['term']) ){\n\t\t\t$this->searchQ['select'][] = \"MATCH(\" . $this->ftfields . \") AGAINST ('\" . $this->booleanAndTerm($this->vars['term']) . \"' IN BOOLEAN MODE) AS score\";\n\t\t\t//$this->searchQ['where'][] = \"MATCH(\" . $ftfields . \") AGAINST ('\" . $this->booleanAndTerm($this->vars['term']) . \"' IN BOOLEAN MODE)\";\n\t\t\t// use having rather than where\n\t\t\t$this->searchQ['having'][] = \"score > 0\";\n\t\t\t$this->searchQ['orderby'][] = 'score DESC';\n\t\t\t$this->doSearch = true;\n\t\t}\n\t\t\n\t\t\n\t\t//! **** FILTERS ****\n\t\t//! profession\n\t\tif( isset($this->vars['profession']) && strlen($this->vars['profession']) ){\n\t\t\n\t\t\t//$this->searchQ['where'][] = \" l.listing_type_id IN (\" . implode(',', $this->vars['profession']) . \") \";\n\t\t\t$this->searchQ['where'][] = \" l.listing_type_id = \" . (int)$this->vars['profession'] . \" \";\n\t\t\t$this->doSearch = true;\n\t\t}\n\t\t//! max price\n\t\tif( isset($this->vars['maxprice']) && is_numeric($this->vars['maxprice']) ){\n\t\t\n\t\t\t$this->searchQ['where'][] = \" l.hourly_rate <= \" . (int)$this->vars['maxprice'] . \" \";\n\t\t\t$this->doSearch = true;\n\t\t}\n\t\t\n\t\t//! gender\n\t\tif( isset($this->vars['gender']) && in_array($this->vars['gender'] , array('M','F')) ){\n\t\t\n\t\t\t$this->searchQ['from'] .= ', listing_to_gender ltg';\n\t\t\t$this->searchQ['where'][] = \" ltg.listing_id = l.listing_id \";\n\t\t\t$this->searchQ['where'][] = \" ltg.gender = '\" . $this->vars['gender'] . \"' \";\n\t\t\t$this->doSearch = true;\n\t\t}\n\t\n\t\t//! speciality\n\t\tif( isset($this->vars['speciality']) && is_numeric($this->vars['speciality']) ){\n\t\t\n\t\t\t$this->searchQ['from'] .= ', listing_to_age ltag';\n\t\t\t$this->searchQ['where'][] = \" ltag.listing_id = l.listing_id \";\n\t\t\t$this->searchQ['where'][] = \" ltag.age_id = \" . (int)$this->vars['speciality'] . \" \";\n\t\t\t$this->doSearch = true;\n\t\t}\n\t\t\n\t\t//! ** build the query **\n\t\t$q = \"SELECT \" . (($this->numRows)?' SQL_CALC_FOUND_ROWS ':'') . implode(',', $this->searchQ['select']). \"\n\t\t\t\tFROM \" . $this->searchQ['from'] . \"\n\t\t\t\tWHERE\n\t\t\t\t\t\" . implode(' AND ', $this->searchQ['where']) ;\n\t\t\t\t\t\n\t\tif( isset($this->searchQ['having']) && count($this->searchQ['having']) ){\n\t\t\t$q .= \" HAVING \" . implode(' AND ' , $this->searchQ['having']);\n\t\t}\n\t\t\n\t\t$q .= \"\tORDER BY \" . implode(',', $this->searchQ['orderby']) . \" \";\n\n\t\t$q .= \"\tLIMIT \" . ( ($this->page-1)* $this->limit) . \",\" . $this->limit . \" \"; \n\t\t\t\n\t\treturn $q;\n\t\t\n\t}", "function search() {\n\n /* Start building the query object. We hope to end up with something like:\n $reqeust = '{\n \"from\" : 0,\n \"size\": 10,\n \"query\" : {\n \"terms\" : {\n \"creator\" : [ \"card\" ]\n }\n },\n sort: {\n title: {\n order: \"desc\"\n }\n }\n }';\n */\n $request = array();\n\n // Users can query by specifying an url param like &filter=title:ender\n // TODO: We should allow for multiple filters.\n $key_and_val = explode(\":\", $this->get('GET.filter'));\n if (count($key_and_val) == 2 and !empty($key_and_val[0]) and !empty($key_and_val[1])) {\n $request['query']['query_string']['fields'] = array($key_and_val[0]);\n $request['query']['query_string']['query'] = '*' . $key_and_val[1] . '*';\n $request['query']['query_string']['default_operator'] = 'AND';\n } else {\n $request['query'] = array(\"match_all\" => new stdClass);\n }\n //$request['query']['query_string']['query'] = 'American FactFinder';\n // start parameter (elasticsearch calls this 'from')\n $incoming_start = $this->get('GET.start');\n if (!empty($incoming_start)) {\n $request['from'] = $this->get('GET.start');\n }\n \n // limit parameter (elasticsearch calls this 'size')\n $incoming_limit = $this->get('GET.limit');\n if (!empty($incoming_limit)) {\n $request['size'] = $this->get('GET.limit');\n }\n \n // sort parameter\n $incoming_sort = $this->get('GET.sort');\n $sort_field_and_dir = explode(\" \", $this->get('GET.sort'));\n if (count($sort_field_and_dir) == 2) {\n $request['sort'] = array($sort_field_and_dir[0] => array('order' => $sort_field_and_dir[1]));\n }\n \n // We now have our built request, let's jsonify it and send it to ES\n $jsoned_request = json_encode($request);\n \n $url = $this->get('ELASTICSEARCH_URL') . '_search';\n $ch = curl_init();\n $method = \"GET\";\n\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_CUSTOMREQUEST, strtoupper($method));\n curl_setopt($ch, CURLOPT_POSTFIELDS, $jsoned_request);\n\n $results = curl_exec($ch);\n curl_close($ch);\n\n // We should have a response. Let's pull the docs out of it\n $cleaned_results = $this->get_docs_from_es_response(json_decode($results, True));\n // callback for jsonp requests\n $incoming_callback = $this->get('GET.callback');\n if (!empty($incoming_callback)) {\n $this->set('callback', $this->get('GET.callback'));\n }\n \n // We don't want dupes. Dedupe based on hollis_id\n //$deduped_docs = $this->dedupe_using_hollis_id($cleaned_results);\n \n // Hopefully we're deduping on intake\n $deduped_docs = $cleaned_results;\n \n $this->set('results', $deduped_docs);\n //$this->set('results', $cleaned_results);\n $path_to_template = 'api/templates/search_json.php';\n echo $this->render($path_to_template);\n }", "private function makeQuerySplit(){\n\t\t\n\t\t$this->searchQ['select'] = array('l.name','l.level_id AS levelId','l.summary','l.sum_approach','l.sum_problems','l.address_line_1','l.address_line_2','l.town','l.county','l.postcode','l.country','l.phone','l.image','l.latitude','l.longitude','l.publish_address','l.publish_phone','l.approved','p.uri','p.urlname','e.level','y.listing_type');\n\t\t$this->searchQ['orderby'][] = 'levelId DESC';\n\t\t$this->searchQ['from'] = 'listing l, listing_level e, listing_type y, pages p'; //should always be the same...\n\t\t$this->searchQ['where'] = array('e.level_id = l.level_id','y.listing_type_id = l.listing_type_id','l.page_id = p.page_id','l.publish = 1');//,'p.publish = 1');\n\t\t\n\t\t\n\t\t//! freetext\n\t\tif( strlen($this->vars['term']) ){\n\t\t\t$this->searchQ['select'][] = \"MATCH(\" . $this->ftfields . \") AGAINST ('\" . $this->booleanAndTerm($this->vars['term']) . \"' IN BOOLEAN MODE) AS score\";\n\t\t\t//$this->searchQ['where'][] = \"MATCH(\" . $ftfields . \") AGAINST ('\" . $this->booleanAndTerm($this->vars['term']) . \"' IN BOOLEAN MODE)\";\n\t\t\t// use having rather than where\n\t\t\t$this->searchQ['having'][] = \"score > 0\";\n\t\t\t$this->searchQ['orderby'][] = 'score DESC';\n\t\t\t$this->doSearch = true;\n\t\t}\n\t\t\n\t\t\n\t\t//! **** FILTERS ****\n\t\t//! profession\n\t\tif( isset($this->vars['profession']) && strlen($this->vars['profession']) ){\n\t\t\n\t\t\t//$this->searchQ['where'][] = \" l.listing_type_id IN (\" . implode(',', $this->vars['profession']) . \") \";\n\t\t\t$this->searchQ['where'][] = \" l.listing_type_id = \" . (int)$this->vars['profession'] . \" \";\n\t\t\t$this->doSearch = true;\n\t\t}\n\t\t//! max price\n\t\tif( isset($this->vars['maxprice']) && is_numeric($this->vars['maxprice']) ){\n\t\t\n\t\t\t$this->searchQ['where'][] = \" l.hourly_rate <= \" . (int)$this->vars['maxprice'] . \" \";\n\t\t\t$this->doSearch = true;\n\t\t}\n\t\t\n\t\t//! gender\n\t\tif( isset($this->vars['gender']) && in_array($this->vars['gender'] , array('M','F')) ){\n\t\t\n\t\t\t$this->searchQ['from'] .= ', listing_to_gender ltg';\n\t\t\t$this->searchQ['where'][] = \" ltg.listing_id = l.listing_id \";\n\t\t\t$this->searchQ['where'][] = \" ltg.gender = '\" . $this->vars['gender'] . \"' \";\n\t\t\t$this->doSearch = true;\n\t\t}\n\t\n\t\t//! speciality\n\t\tif( isset($this->vars['speciality']) && is_numeric($this->vars['speciality']) ){\n\t\t\n\t\t\t$this->searchQ['from'] .= ', listing_to_age ltag';\n\t\t\t$this->searchQ['where'][] = \" ltag.listing_id = l.listing_id \";\n\t\t\t$this->searchQ['where'][] = \" ltag.age_id = \" . (int)$this->vars['speciality'] . \" \";\n\t\t\t$this->doSearch = true;\n\t\t}\n\t\t\n\t\tif( strlen($this->vars['location']) ){\n\t\t\t//! ** build the location query **\n\t\t\t\n\t\t\t$this->Geocode = new Geolocation( $this->vars['location']. ', UK' );\n\t\t\t$this->Geocode->lookup();\n\t\t\t$union = array();\n\t\t\t\n\t\t\t$this->doSearch = true;\n\t\t\t$this->searchQ['orderby'][] = 'distance ASC';\n\t\t\t$c = 1;\t\n\t\t\tforeach($this->searchLevels as $level_id => $distance){\n\t\t\t// set up the initial search variables\t\t\n\t\t\t//! location\n\t\t\t\t\n\t\t\t\t//load in current other query info for this level\n\t\t\t\t$l_select = $this->searchQ['select'];\n\t\t\t\t$l_where = $this->searchQ['where'];\n\t\t\t\t$l_having = $this->searchQ['having'];\n\t\t\t\t\n\t\t\t\t// using the OS grid as makes calculation simpler than using lng/lat - can use simple pythag rather than calculus functions\n\t\t\t\t// we shorten the list of rows needing the calculation by the greater / less than in the where\n\t\t\t\t\n\t\t\t\t$calculation = ' SQRT(POW(( l.easting - ' . round($this->Geocode->getOSEast()) . '),2) + POW((l.northing - ' . round($this->Geocode->getOSNorth()) . '),2)) ';\n\t\t\t\t$l_select[] = $calculation . \" AS distance\";\n\t\t\t\t$l_where[] = \"l.level_id = \" . $level_id;\n\t\t\t\t$l_where[] = \"northing < \" . round( $this->Geocode->getOSNorth() + $distance ) ; \n\t\t\t\t$l_where[] = \"northing > \" . round( $this->Geocode->getOSNorth() - $distance ) ;\n\t\t\t\t$l_where[] = \"easting < \" . round( $this->Geocode->getOSEast() + $distance ) ;\n\t\t\t\t$l_where[] = \"easting > \" . round( $this->Geocode->getOSEast() - $distance ) ;\n\t\t\t//\t$this->searchQ['where'][] = \"(\" . $calculation . \") <= \" . $this->searchDistance ;\n\t\t\t// use having rather than where\n\t\t\t\t$l_having[] = \"distance <= \" . $distance;\n\t\t\t\t//$this->searchQ['orderby'][] = 'distance ASC';\n\t\t\t\t\n\t\t\t\t$l_q = \"SELECT \" . (($this->numRows) && 1 == $c ?' SQL_CALC_FOUND_ROWS ':'') . implode(',', $l_select). \"\n\t\t\t\t\tFROM \" . $this->searchQ['from'] . \"\n\t\t\t\t\tWHERE\n\t\t\t\t\t\t\" . implode(' AND ', $l_where) ;\n\t\n\t\t\t\tif( count($l_having) ){\n\t\t\t\t\t$l_q .= \" HAVING \" . implode(' AND ' , $l_having);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$union[] = $l_q;\n\t\t\t\t$c++;\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t$q = '(' . implode(' ) UNION ALL (', $union) . ') ';\n\t\t\t\n\t\t\t$q .= \"\tORDER BY \" . implode(',', $this->searchQ['orderby']) . \" \";\n\t\t\t$q .= \"\tLIMIT \" . ( ($this->page-1)* $this->limit) . \",\" . $this->limit . \" \";\n\t\t\n\t\t\n\t\t}else{\n\t\t\n\t\t\n\t\t\t//! ** build the non-location query **\n\t\t\t$q = \"SELECT \" . (($this->numRows)?' SQL_CALC_FOUND_ROWS ':'') . implode(',', $this->searchQ['select']). \"\n\t\t\t\t\tFROM \" . $this->searchQ['from'] . \"\n\t\t\t\t\tWHERE\n\t\t\t\t\t\t\" . implode(' AND ', $this->searchQ['where']) ;\n\t\t\t\t\t\t\n\t\t\tif( isset($this->searchQ['having']) && count($this->searchQ['having']) ){\n\t\t\t\t$q .= \" HAVING \" . implode(' AND ' , $this->searchQ['having']);\n\t\t\t}\n\t\t\t\n\t\t\t$q .= \"\tORDER BY \" . implode(',', $this->searchQ['orderby']) . \" \";\n\t\n\t\t\t$q .= \"\tLIMIT \" . ( ($this->page-1)* $this->limit) . \",\" . $this->limit . \" \"; \n\t\t}\n\t\t//echo $q;\t\t\n\t\treturn $q;\n\t\t\n\t}", "public function prepareQuery()\n {\n //prepare where conditions\n foreach ($this->where as $where) {\n $this->prepareWhereCondition($where);\n }\n\n //prepare where not conditions\n foreach ($this->whereNot as $whereNot) {\n $this->prepareWhereNotCondition($whereNot);\n }\n\n // Add a basic range clause to the query\n foreach ($this->inRange as $inRange) {\n $this->prepareInRangeCondition($inRange);\n }\n\n // Add a basic not in range clause to the query\n foreach ($this->notInRange as $notInRange) {\n $this->prepareNotInRangeCondition($notInRange);\n }\n\n // add Terms to main query\n foreach ($this->whereTerms as $term) {\n $this->prepareWhereTermsCondition($term);\n }\n\n // add exists constrains to the query\n foreach ($this->exist as $exist) {\n $this->prepareExistCondition($exist);\n }\n\n // add matcher queries\n foreach ($this->match as $match) {\n $this->prepareMatchQueries($match);\n }\n\n $this->query->addFilter($this->filter);\n\n return $this->query;\n }", "function _admin_search_query()\n {\n }", "function _generateSearchSQL($status = null, $searchField = null, $searchMatch = null, $search = null, $dateField = null, $dateFrom = null, $dateTo = null, &$params) {\n\n\t\t$searchSql = '';\n\n\t\tif (!empty($search)) switch ($searchField) {\n\t\t\tcase SUBSCRIPTION_USER:\n\t\t\t\t$searchSql = $this->_generateUserNameSearchSQL($search, $searchMatch, 'u.', $params);\n\t\t\t\tbreak;\n\t\t\tcase SUBSCRIPTION_MEMBERSHIP:\n\t\t\t\tif ($searchMatch === 'is') {\n\t\t\t\t\t$searchSql = ' AND LOWER(s.membership) = LOWER(?)';\n\t\t\t\t} elseif ($searchMatch === 'contains') {\n\t\t\t\t\t$searchSql = ' AND LOWER(s.membership) LIKE LOWER(?)';\n\t\t\t\t\t$search = '%' . $search . '%';\n\t\t\t\t} else { // $searchMatch === 'startsWith'\n\t\t\t\t\t$searchSql = ' AND LOWER(s.membership) LIKE LOWER(?)';\n\t\t\t\t\t$search = $search . '%';\n\t\t\t\t}\n\t\t\t\t$params[] = $search;\n\t\t\t\tbreak;\n\t\t\tcase SUBSCRIPTION_REFERENCE_NUMBER:\n\t\t\t\tif ($searchMatch === 'is') {\n\t\t\t\t\t$searchSql = ' AND LOWER(s.reference_number) = LOWER(?)';\n\t\t\t\t} elseif ($searchMatch === 'contains') {\n\t\t\t\t\t$searchSql = ' AND LOWER(s.reference_number) LIKE LOWER(?)';\n\t\t\t\t\t$search = '%' . $search . '%';\n\t\t\t\t} else { // $searchMatch === 'startsWith'\n\t\t\t\t\t$searchSql = ' AND LOWER(s.reference_number) LIKE LOWER(?)';\n\t\t\t\t\t$search = $search . '%';\n\t\t\t\t}\n\t\t\t\t$params[] = $search;\n\t\t\t\tbreak;\n\t\t\tcase SUBSCRIPTION_NOTES:\n\t\t\t\tif ($searchMatch === 'is') {\n\t\t\t\t\t$searchSql = ' AND LOWER(s.notes) = LOWER(?)';\n\t\t\t\t} elseif ($searchMatch === 'contains') {\n\t\t\t\t\t$searchSql = ' AND LOWER(s.notes) LIKE LOWER(?)';\n\t\t\t\t\t$search = '%' . $search . '%';\n\t\t\t\t} else { // $searchMatch === 'startsWith'\n\t\t\t\t\t$searchSql = ' AND LOWER(s.notes) LIKE LOWER(?)';\n\t\t\t\t\t$search = $search . '%';\n\t\t\t\t}\n\t\t\t\t$params[] = $search;\n\t\t\t\tbreak;\n\t\t}\n\n\t\tif (!empty($dateFrom) || !empty($dateTo)) switch($dateField) {\n\t\t\tcase SUBSCRIPTION_DATE_START:\n\t\t\t\tif (!empty($dateFrom)) {\n\t\t\t\t\t$searchSql .= ' AND s.date_start >= ' . $this->datetimeToDB($dateFrom);\n\t\t\t\t}\n\t\t\t\tif (!empty($dateTo)) {\n\t\t\t\t\t$searchSql .= ' AND s.date_start <= ' . $this->datetimeToDB($dateTo);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase SUBSCRIPTION_DATE_END:\n\t\t\t\tif (!empty($dateFrom)) {\n\t\t\t\t\t$searchSql .= ' AND s.date_end >= ' . $this->datetimeToDB($dateFrom);\n\t\t\t\t}\n\t\t\t\tif (!empty($dateTo)) {\n\t\t\t\t\t$searchSql .= ' AND s.date_end <= ' . $this->datetimeToDB($dateTo);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t}\n\n\t\tif (!empty($status)) {\n\t\t\t$searchSql .= ' AND s.status = ' . (int) $status;\n\t\t}\n\n\t\treturn $searchSql;\n\t}", "protected function getQueryCondition()\n {\n $parts = [];\n foreach ($this->fields as $field) {\n $parts[] = \"{$field} LIKE :pattern\";\n }\n return implode(' AND ', $parts);\n }", "public function getQuery()\n {\n // if it's a simple query/filter there is no need to create a bool query\n if ((count($this->must) + count($this->should)) === 1) {\n $a = array_merge($this->must, $this->should);\n return array_shift($a);\n }\n\n // required conditions (AND)\n if (!empty($this->must)) {\n $this->query['bool']['must'] = $this->must;\n }\n\n // optional conditions (OR)\n if (!empty($this->should)) {\n $this->query['bool']['should'] = $this->should;\n $this->query['bool']['minimum_should_match'] = $this->minimumShouldMatch;\n }\n\n return $this->query;\n }", "public function query() {\n $this->field_alias = $this->real_field;\n if (isset($this->definition['trovequery'])) {\n $this->query->add_where('', $this->definition['trovequery']['arg'], $this->definition['trovequery']['value']);\n }\n }", "public function search() {\n\n $this->entity = $this->name;\n $this->conditions = $this->_getSearchConditions();\n $this->joins = $this->_getSearchJoins();\n $this->orders = $this->_getSearchOrder();\n $this->limit = $this->_getSearchLimit();\n $this->maxLimit = $this->_getSearchMaxLimit();\n $this->offset = $this->_getSearchOffset();\n $this->fields = $this->_getSearchFields();\n $this->group = $this->_getSearchGroup();\n\n// $this->setVar('entity', $this->name);\n// $this->setVar('conditions', $this->_getSearchConditions());\n// $this->setVar('joins', $this->_getSearchJoins());\n// $this->setVar('orders', $this->_getSearchOrder());\n// $this->setVar('limit', $this->_getSearchLimit());\n// $this->setVar('maxLimit', $this->_getSearchMaxLimit());\n// $this->setVar('offset', $this->_getSearchOffset());\n// $this->setVar('fields', $this->_getSearchFields());\n// $this->setVar('group', $this->_getSearchGroup());\n//\n// $this->setVar('baseAdditionalElements', $this->additionalElements);\n $this->getFieldsForSearchFunction = '_extractSearchFields';\n\n return $this->baseSearch();\n }", "public function searchWithCriteria(){\n\n\n //change default message for required rule\n $this->unsetSessionData();\n $this->setSessionData();\n\n\n if(isset($_SESSION['searchKeyword']) && isset($_SESSION['timecon'])){\n $this->searchByLocationAndDay();\n }else if(isset($_SESSION['searchKeyword']) && isset($_SESSION['timecon'])==FALSE){\n $this->searchByLocation();\n }else if(isset($_SESSION['searchKeyword'])==FALSE && isset($_SESSION['timecon'])){\n $this->searchByCalendar();\n }\n }", "private function _getSearchStringQuery()\n {\n $words = [];\n //split string depend on quote\n preg_match_all('/\"(?:\\\\\\\\.|[^\\\\\\\\\"])*\"|\\S+/', Input::get('search.value'), $matches);\n if (!empty($matches[0])) {\n //remove quote in each part\n foreach ($matches[0] as $key => $word) {\n $words[$key] = preg_replace('/\"|\\'/', '', $word);\n if (empty($words[$key])) {\n unset($words[$key]);\n }\n }\n //create query with each search column\n foreach ($this->column_search as $item) {\n // create query with each part of search string\n $this->query->where( function($q) use($item, $words) {\n $q->where($item, 'like', '%'.$words[0].'%');\n $wordNumb = count($words);\n for ($i = 1; $i < $wordNumb; $i++) {\n $q->orWhere($item, 'like', '%'.$words[$i].'%');\n }\n });\n }\n }\n // store to hightligh matching word in title of document\n $this->sSearch = $words;\n }", "function AdvancedSearchWhere() {\n\t\tglobal $Security, $t_tinbai_mainsite;\n\t\t$sWhere = \"\";\n\t\tif (!$Security->CanSearch()) return \"\";\n\t\t$this->BuildSearchSql($sWhere, $t_tinbai_mainsite->PK_TINBAI_ID, FALSE); // PK_TINBAI_ID\n\t\t$this->BuildSearchSql($sWhere, $t_tinbai_mainsite->FK_CONGTY_ID, FALSE); // FK_CONGTY_ID\n\t\t$this->BuildSearchSql($sWhere, $t_tinbai_mainsite->FK_DMGIOITHIEU_ID, FALSE); // FK_DMGIOITHIEU_ID\n\t\t$this->BuildSearchSql($sWhere, $t_tinbai_mainsite->FK_DMTUYENSINH_ID, FALSE); // FK_DMTUYENSINH_ID\n\t\t$this->BuildSearchSql($sWhere, $t_tinbai_mainsite->FK_DTSVTUONGLAI_ID, FALSE); // FK_DTSVTUONGLAI_ID\n\t\t$this->BuildSearchSql($sWhere, $t_tinbai_mainsite->FK_DTSVDANGHOC_ID, FALSE); // FK_DTSVDANGHOC_ID\n\t\t$this->BuildSearchSql($sWhere, $t_tinbai_mainsite->FK_DTCUUSV_ID, FALSE); // FK_DTCUUSV_ID\n\t\t$this->BuildSearchSql($sWhere, $t_tinbai_mainsite->FK_DTDOANHNGHIEP_ID, FALSE); // FK_DTDOANHNGHIEP_ID\n\t\t$this->BuildSearchSql($sWhere, $t_tinbai_mainsite->C_TITLE, FALSE); // C_TITLE\n\t\t$this->BuildSearchSql($sWhere, $t_tinbai_mainsite->C_SUMARY, FALSE); // C_SUMARY\n\t\t$this->BuildSearchSql($sWhere, $t_tinbai_mainsite->C_CONTENTS, FALSE); // C_CONTENTS\n\t\t$this->BuildSearchSql($sWhere, $t_tinbai_mainsite->C_HIT_MAINSITE, FALSE); // C_HIT_MAINSITE\n\t\t$this->BuildSearchSql($sWhere, $t_tinbai_mainsite->C_NEW_MYSEFLT, FALSE); // C_NEW_MYSEFLT\n\t\t$this->BuildSearchSql($sWhere, $t_tinbai_mainsite->C_COMMENT_MAINSITE, FALSE); // C_COMMENT_MAINSITE\n\t\t$this->BuildSearchSql($sWhere, $t_tinbai_mainsite->C_ORDER_MAINSITE, FALSE); // C_ORDER_MAINSITE\n\t\t$this->BuildSearchSql($sWhere, $t_tinbai_mainsite->C_STATUS_MAINSITE, FALSE); // C_STATUS_MAINSITE\n\t\t$this->BuildSearchSql($sWhere, $t_tinbai_mainsite->C_VISITOR_MAINSITE, FALSE); // C_VISITOR_MAINSITE\n\t\t$this->BuildSearchSql($sWhere, $t_tinbai_mainsite->C_ACTIVE_MAINSITE, FALSE); // C_ACTIVE_MAINSITE\n\t\t$this->BuildSearchSql($sWhere, $t_tinbai_mainsite->C_TIME_ACTIVE_MAINSITE, FALSE); // C_TIME_ACTIVE_MAINSITE\n\t\t$this->BuildSearchSql($sWhere, $t_tinbai_mainsite->FK_NGUOIDUNGID_MAINSITE, FALSE); // FK_NGUOIDUNGID_MAINSITE\n\t\t$this->BuildSearchSql($sWhere, $t_tinbai_mainsite->C_NOTE, FALSE); // C_NOTE\n\t\t$this->BuildSearchSql($sWhere, $t_tinbai_mainsite->C_USER_ADD, FALSE); // C_USER_ADD\n\t\t$this->BuildSearchSql($sWhere, $t_tinbai_mainsite->C_ADD_TIME, FALSE); // C_ADD_TIME\n\t\t$this->BuildSearchSql($sWhere, $t_tinbai_mainsite->C_USER_EDIT, FALSE); // C_USER_EDIT\n\t\t$this->BuildSearchSql($sWhere, $t_tinbai_mainsite->C_EDIT_TIME, FALSE); // C_EDIT_TIME\n\t\t$this->BuildSearchSql($sWhere, $t_tinbai_mainsite->FK_EDITOR_ID, FALSE); // FK_EDITOR_ID\n\n\t\t// Set up search parm\n\t\tif ($sWhere <> \"\") {\n\t\t\t$this->SetSearchParm($t_tinbai_mainsite->PK_TINBAI_ID); // PK_TINBAI_ID\n\t\t\t$this->SetSearchParm($t_tinbai_mainsite->FK_CONGTY_ID); // FK_CONGTY_ID\n\t\t\t$this->SetSearchParm($t_tinbai_mainsite->FK_DMGIOITHIEU_ID); // FK_DMGIOITHIEU_ID\n\t\t\t$this->SetSearchParm($t_tinbai_mainsite->FK_DMTUYENSINH_ID); // FK_DMTUYENSINH_ID\n\t\t\t$this->SetSearchParm($t_tinbai_mainsite->FK_DTSVTUONGLAI_ID); // FK_DTSVTUONGLAI_ID\n\t\t\t$this->SetSearchParm($t_tinbai_mainsite->FK_DTSVDANGHOC_ID); // FK_DTSVDANGHOC_ID\n\t\t\t$this->SetSearchParm($t_tinbai_mainsite->FK_DTCUUSV_ID); // FK_DTCUUSV_ID\n\t\t\t$this->SetSearchParm($t_tinbai_mainsite->FK_DTDOANHNGHIEP_ID); // FK_DTDOANHNGHIEP_ID\n\t\t\t$this->SetSearchParm($t_tinbai_mainsite->C_TITLE); // C_TITLE\n\t\t\t$this->SetSearchParm($t_tinbai_mainsite->C_SUMARY); // C_SUMARY\n\t\t\t$this->SetSearchParm($t_tinbai_mainsite->C_CONTENTS); // C_CONTENTS\n\t\t\t$this->SetSearchParm($t_tinbai_mainsite->C_HIT_MAINSITE); // C_HIT_MAINSITE\n\t\t\t$this->SetSearchParm($t_tinbai_mainsite->C_NEW_MYSEFLT); // C_NEW_MYSEFLT\n\t\t\t$this->SetSearchParm($t_tinbai_mainsite->C_COMMENT_MAINSITE); // C_COMMENT_MAINSITE\n\t\t\t$this->SetSearchParm($t_tinbai_mainsite->C_ORDER_MAINSITE); // C_ORDER_MAINSITE\n\t\t\t$this->SetSearchParm($t_tinbai_mainsite->C_STATUS_MAINSITE); // C_STATUS_MAINSITE\n\t\t\t$this->SetSearchParm($t_tinbai_mainsite->C_VISITOR_MAINSITE); // C_VISITOR_MAINSITE\n\t\t\t$this->SetSearchParm($t_tinbai_mainsite->C_ACTIVE_MAINSITE); // C_ACTIVE_MAINSITE\n\t\t\t$this->SetSearchParm($t_tinbai_mainsite->C_TIME_ACTIVE_MAINSITE); // C_TIME_ACTIVE_MAINSITE\n\t\t\t$this->SetSearchParm($t_tinbai_mainsite->FK_NGUOIDUNGID_MAINSITE); // FK_NGUOIDUNGID_MAINSITE\n\t\t\t$this->SetSearchParm($t_tinbai_mainsite->C_NOTE); // C_NOTE\n\t\t\t$this->SetSearchParm($t_tinbai_mainsite->C_USER_ADD); // C_USER_ADD\n\t\t\t$this->SetSearchParm($t_tinbai_mainsite->C_ADD_TIME); // C_ADD_TIME\n\t\t\t$this->SetSearchParm($t_tinbai_mainsite->C_USER_EDIT); // C_USER_EDIT\n\t\t\t$this->SetSearchParm($t_tinbai_mainsite->C_EDIT_TIME); // C_EDIT_TIME\n\t\t\t$this->SetSearchParm($t_tinbai_mainsite->FK_EDITOR_ID); // FK_EDITOR_ID\n\t\t}\n\t\treturn $sWhere;\n\t}", "function BasicSearchWhere() {\n\t\tglobal $Security;\n\t\t$sSearchStr = \"\";\n\t\tif (!$Security->CanSearch()) return \"\";\n\t\t$sSearchKeyword = $this->BasicSearch->Keyword;\n\t\t$sSearchType = $this->BasicSearch->Type;\n\t\tif ($sSearchKeyword <> \"\") {\n\t\t\t$sSearch = trim($sSearchKeyword);\n\t\t\tif ($sSearchType <> \"=\") {\n\t\t\t\twhile (strpos($sSearch, \" \") !== FALSE)\n\t\t\t\t\t$sSearch = str_replace(\" \", \" \", $sSearch);\n\t\t\t\t$arKeyword = explode(\" \", trim($sSearch));\n\t\t\t\tforeach ($arKeyword as $sKeyword) {\n\t\t\t\t\tif ($sSearchStr <> \"\") $sSearchStr .= \" \" . $sSearchType . \" \";\n\t\t\t\t\t$sSearchStr .= \"(\" . $this->BasicSearchSQL($sKeyword) . \")\";\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$sSearchStr = $this->BasicSearchSQL($sSearch);\n\t\t\t}\n\t\t\t$this->Command = \"search\";\n\t\t}\n\t\tif ($this->Command == \"search\") {\n\t\t\t$this->BasicSearch->setKeyword($sSearchKeyword);\n\t\t\t$this->BasicSearch->setType($sSearchType);\n\t\t}\n\t\treturn $sSearchStr;\n\t}", "protected function _buildCondition(){\n \t$aryCondition = array();\n \t\n \tif(!empty($this->postData)){\n \t\t //search\n\t\t\t \t\t\t\n\t\t\tif($this->postData['title']!=''){\n \t\t \t$aryCondition['like'][] = array(\"mt.title\"=>$this->postData['title']);\n \t\t }\t\t\t\n\t\t\tif($this->postData['page']!=''){\n \t\t \t$aryCondition['and'][] = array(\"mt.page\"=>$this->postData['page']);\n \t\t }\t\t\t\n\t\t\tif($this->postData['code']!=''){\n \t\t \t$aryCondition['like'][] = array(\"mt.code\"=>$this->postData['code']);\n \t\t }\t\t\t\n\t\t\tif($this->postData['status']!=''){\n \t\t \t$aryCondition['and'][] = array(\"mt.status\"=>$this->postData['status']);\n \t\t }\t\t\t\n\n \t}\n \treturn $aryCondition;\n }", "public function build()\n {\n return empty($this->conditions) ? '' : ' WHERE '.implode(' AND ', $this->conditions);\n }", "function criteria(&$query){\n $id = $this->input->post('id', true);\n $k = $this->input->post('k', true);/*kind*/\n $t = $this->input->post('t', true);/*title*/\n $s = $this->input->post('s', true);/*sub*/\n $b = $this->input->post('b', true);/*background*/\n $so = $this->input->post('so', true);/*sort*/\n if(!empty($id)){/*where like include: before(%pattern), after(pattern%) and both(%pattern%)*/\n $query = $query->like('id', $id, 'both');\n }\n if(!empty($k)){\n $query = $query->like('kind', $k, 'both');\n }\n if(!empty($t)){\n $query = $query->like('title', $t, 'both');\n }\n if(!empty($s)){\n $query = $query->like('sub', $s, 'both');\n }\n if(!empty($b)){\n $query = $query->like('background', $b, 'both');\n }\n if(!empty($so)){\n $query = $query->like('sort', $so, 'both');\n }\n }", "public function buildQuery($typeSearch = 'must', $typeQuery, $query = [], $filters = [], $qSort = [], $aggregates = [], $from = 0, $size = 20): array \n {\n if (!in_array($typeSearch, ['must', 'should', 'should_not'])) {\n return null;\n }\n if (!in_array($typeQuery, ['term', 'match', 'match_all', 'prefix'])) {\n return null;\n }\n\n // Add query\n $finalQuery = $queryClauses = $filterClauses = [];\n if (isset($typeQuery) && 'match_all' == $typeQuery) {\n $finalQuery['query'] = [$typeQuery => (object)$query];\n\n } else {\n if (isset($query) && 0 < count($query)) {\n\n // 1 field\n if (1 == count($query)) {\n $queryClauses[$typeQuery] = $query;\n } else {\n /**\n * 2 cases :\n * field: [value1, value 2]\n * => terms: [field: [$value1, $value 2]\n *\n * [field:value1, field2: value 2]\n * => [term :[field:value], term: [field2: value2]...]\n */\n foreach ($query as $field => $value) {\n if (is_array($value)) {\n array_push($queryClauses, ['terms' => [$field=>$value]]);\n } else {\n $queryClauses[][$typeQuery] = [$field=>$value];\n }\n }\n }\n\n if (0 < count($queryClauses)) {\n $queryClauses = [\n 'bool' => [\n $typeSearch => $queryClauses\n ]\n ];\n $finalQuery['query'] = $queryClauses;\n }\n }\n }\n\n // Filters\n if (isset($filters) && 0 < count($filters)) {\n $filtersQuery = [];\n if ('AND' == key($filters)) {\n $filterAnd = [];\n foreach ($filters['AND'] as $type => $filter) {\n foreach ($filter as $field=>$value) {\n $filterAnd[][$type] = [$field=>$value];\n }\n }\n $filtersQuery['bool']['must'] = $filterAnd;\n\n } elseif ('OR' == key($filters)) {\n $filterOr = [];\n// foreach ($filters['OR'] as $type => $filter) {\n// $field = key($filter);\n// $value = $filter[$field];\n// $FilterAndLoop[] = [$field => $value];\n// $filterAnd[$type] = $FilterAndLoop;\n// }\n $filtersQuery['bool']['should'] = $filterOr;\n }\n\n if (0 < count($filtersQuery)) {\n $finalQuery['query']['bool']['filter'] = $filtersQuery;\n }\n }\n\n // Add sort\n if (isset($qSort) && 0 < count($qSort)) {\n foreach ($qSort as $field=>$type) {\n $fieldSort[$field] = [];\n if (in_array($type, self::LIST_ORDER)) {\n array_push($fieldSort[$field], ['order' => $type]);\n }\n }\n $finalQuery['sort'] = $fieldSort;\n }\n\n // Add aggregates\n if (isset($aggregates) && 0 < count($aggregates)) {\n $aggregatesFields = $aggregateFilter = [];\n if (array_key_exists('aggregates', $aggregates)) {\n $aggregatesFields = $aggregates['aggregates'];\n $finalQuery['aggregations'] = [\n 'allfacets' => [\n 'aggregations' => $aggregatesFields\n ]\n ];\n } elseif (array_key_exists('raw', $aggregates)) {\n // Aggregations RAW\n $finalQuery['aggregations'] = $aggregates['raw'];\n }\n\n // Add filter/global\n if (array_key_exists('filter', $aggregates)) {\n $aggFilter = [];\n // TODO : améliorer ?\n foreach ($aggregates['filter'] as $type => $tabFieldValues) {\n $aggFilter[$type] = $tabFieldValues;\n }\n $aggregateFilter['filter'] = $aggFilter;\n // FIN TODO\n } elseif (array_key_exists('global', $aggregates)) {\n $aggregateFilter['global'] = new \\stdClass();\n }\n\n\n\n if (0 < count($aggregateFilter)) {\n $finalQuery['aggregations']['allfacets'] += $aggregateFilter;\n }\n }\n\n $finalQuery['from'] = $from;\n $finalQuery['size'] = $size;\n dump(json_encode($finalQuery));\n return $finalQuery;\n }", "function _buildQuery()\n\t{\t\t\n\t\t// Get the WHERE and ORDER BY clauses for the query\n\t\t$where\t\t= $this->_buildContentWhere();\n\t\t$orderby\t= $this->_buildContentOrderBy();\n\t\t$query = 'SELECT a.*, DATEDIFF(a.early_bird_discount_date, NOW()) AS date_diff, c.name AS location_name, IFNULL(SUM(b.number_registrants), 0) AS total_registrants FROM #__eb_events AS a '\n\t\t\t. ' LEFT JOIN #__eb_registrants AS b '\n\t\t\t. ' ON (a.id = b.event_id AND b.group_id=0 AND (b.published = 1 OR (b.payment_method=\"os_offline\" AND b.published != 2))) '\n\t\t\t. ' LEFT JOIN #__eb_locations AS c '\n\t\t\t. ' ON a.location_id = c.id '\t\t\t\t\t\n\t\t\t. $where\t\t\n\t\t\t. ' GROUP BY a.id '\n\t\t\t. $orderby\n\t\t;\n\t\treturn $query;\n\t}", "function buildQuery () {\n $select = array();\n $from = array();\n $where = array();\n $join = '';\n $rowLimit = '';\n\n if (!empty ($this->checkTables)) {\n foreach ($this->checkTables as $table) {\n $columns = self::getCheckTableColumns( $table );\n //go through each column\n if (!empty ($columns)) {\n //try to join tables\n if ( count ($this->checkTables) > 1 && $this->checkTables[0] != $table) {\n // Add JOIN condition\n $join .= self::buildQueryJoin( $this->checkTables[0], $table );\n }\n\n // Assign select and where clauses\n foreach ($columns as $column) {\n //Add is column to constraint if selected\n if (!empty( $this->formTableColumnFilterHash[$table][$column]['checkColumn'] )) {\n $select[] = self::getTableAlias ($table).\".\".$column.\" AS \".self::getTableAlias ($table).\"_\".$column;\n }\n\n self::getColumnFilter ( $where,\n $table,\n $column,\n $this->formTableColumnFilterHash[$table][$column]['selectColumnLogicOper'],\n $this->formTableColumnFilterHash[$table][$column]['selectMinOper'],\n $this->formTableColumnFilterHash[$table][$column]['textMinValue'],\n $this->formTableColumnFilterHash[$table][$column]['selectRangeLogicOper'],\n $this->formTableColumnFilterHash[$table][$column]['selectMaxOper'],\n $this->formTableColumnFilterHash[$table][$column]['textMaxValue']);\n\n } // foreach $column\n } //if (!empty ($columns))\n } // foreach $table\n // If there is only one table add from cluase to that else just the join table\n\t $from[] = \" FROM \".$this->checkTables[0].\" AS \".self::getTableAlias($this->checkTables[0]).\" \\n\"; //assign single table\n } //if (!empty ($this->checkTables))\n\n\n\n if ( $this->radioSpacialConstraint == 'Cone') {\n $join .= self::getConeSearch ($this->textConeRa,\n $this->textConeDec,\n $this->textConeRadius,\n $this->selectConeUnits);\n } //if\n\n else if ($this->radioSpacialConstraint == 'Box') {\n $join .= self::getBoxSearch ($this->textBoxRa,\n $this->textBoxDec,\n $this->textBoxSize,\n $this->selectBoxUnits);\n } // if\n\n // Assign survey filter\n if ( isset( $this->selectSurvey ) && $this->selectSurvey > 0 ) {\n $surveyFilter = self::getSurveyFilter();\n if ( !empty( $surveyFilter ) )\n $where[] = self::getSurveyFilter();\n }\n // Figure out the Astro Filter join\n if (!empty( $this->checkAstroFilterIDs ) ) {\n $astroFilter = self::getAstroFilterJoin();\n if ( !empty( $astroFilter ) )\n $where[] = $astroFilter;\n }\n\n // Add Row Limit\n if ( !empty( $this->selectRowLimit ) ) {\n $rowLimit = \"TOP \".$this->selectRowLimit.\" \";\n }\n // Add something if there are no columns selected\n if ( count( $select ) == 0 ) {\n $select[] = '42==42';\n }\n\n // Let's combine all the factors into one big query\n $query = \"SELECT \".$rowLimit.join(', ',$select).\"\\n\".join(', ', $from).$join;\n\n # Case non-empty where clause\n if ( count( $where ) > 0 ) {\n #Get rid of the first columns that starts with a logical operator of AND/OR\n $where[0] = preg_replace('/^\\s*(AND)|(OR)|(\\^)/', '', $where[0]);\n $query .= ' WHERE '.join( \"\\n \",$where );\n }\n return $query;\n }", "public function getQuery()\n {\n $query = self::find();\n $query->andFilterWhere([\n 'id' => $this->id,\n 'main_book_id' => $this->main_book_id,\n ]);\n\n $stringFields = [\n 'name',\n 'surname',\n 'image_name',\n 'image_extension',\n 'image_md5',\n 'image_mime_type'\n ];\n\n foreach ($stringFields as $stringField) {\n $query->andFilterWhere([\n 'ILIKE',\n $stringField,\n $this->$stringField,\n ]);\n }\n\n return $query;\n }", "protected function buildWhereClause() {\r\n\t\t$sql='';\r\n\t\tif (count($this->_salt_wheres)>0) {\r\n\t\t\t$sql.=' WHERE '.implode(' ', $this->_salt_wheres);\r\n\t\t}\r\n\t\treturn $sql;\r\n\r\n\t}", "protected function _buildWhere(&$query)\n {\n\n return $query;\n }", "public function build_query(/* ... */)\n {\n $query = [\"SELECT\"];\n $model = $this->get_model();\n // Field selection\n $fields = [];\n foreach ($this->_fields as $_field) {\n $fields[] = $this->_build_select_field($_field);\n }\n $query[] = implode(', ', $fields);\n // Table Selection\n $query[] = 'FROM';\n $query[] = '`' . $model->get_table() . '`';\n // WHERE lookup\n $query[] = $this->build_where();\n if (null !== $this->_orderby) {\n $query[] = $this->_orderby;\n }\n if (null !== $this->_limit) {\n $query[] = $this->_limit;\n }\n return $model->get_connection()->prepare(implode(\" \", $query));\n }", "private function _search_where($search = array(), $prefix = '')\n\t{\n\t\t// --------------------------------------\n\t\t// Initiate where array\n\t\t// --------------------------------------\n\n\t\t$where = array();\n\n\t\t// --------------------------------------\n\t\t// Loop through search filters and create where clause accordingly\n\t\t// --------------------------------------\n\n\t\tforeach ($search AS $key => $val)\n\t\t{\n\t\t\t// Skip non-existent fields\n\t\t\tif ( ! ($field_id = $this->_get_field_id($key))) continue;\n\n\t\t\t// Initiate some vars\n\t\t\t$exact = $all = FALSE;\n\t\t\t$field = $prefix.'field_id_'.$field_id;\n\n\t\t\t// Exact matches\n\t\t\tif (substr($val, 0, 1) == '=')\n\t\t\t{\n\t\t\t\t$val = substr($terms, 1);\n\t\t\t\t$exact = TRUE;\n\t\t\t}\n\n\t\t\t// All items? -> && instead of |\n\t\t\tif (strpos($val, '&&') !== FALSE)\n\t\t\t{\n\t\t\t\t$all = TRUE;\n\t\t\t\t$val = str_replace('&&', '|', $val);\n\t\t\t}\n\n\t\t\t// Convert parameter to bool and array\n\t\t\tlist($items, $in) = low_explode_param($val);\n\n\t\t\t// Init sql for where clause\n\t\t\t$sql = array();\n\n\t\t\t// Loop through each sub-item of the filter an create sub-clause\n\t\t\tforeach ($items AS $item)\n\t\t\t{\n\t\t\t\t// Convert IS_EMPTY constant to empty string\n\t\t\t\t$empty = ($item == 'IS_EMPTY');\n\t\t\t\t$item = str_replace('IS_EMPTY', '', $item);\n\n\t\t\t\t// whole word? Regexp search\n\t\t\t\tif (substr($item, -2) == '\\W')\n\t\t\t\t{\n\t\t\t\t\t$operand = $in ? 'REGEXP' : 'NOT REGEXP';\n\t\t\t\t\t$item = '[[:<:]]'.preg_quote(substr($item, 0, -2)).'[[:>:]]';\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t// Not a whole word\n\t\t\t\t\tif ($exact || $empty)\n\t\t\t\t\t{\n\t\t\t\t\t\t// Use exact operand if empty or = was the first char in param\n\t\t\t\t\t\t$operand = $in ? '=' : '!=';\n\t\t\t\t\t\t$item = \"'\".$this->EE->db->escape_str($item).\"'\";\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t// Use like operand in all other cases\n\t\t\t\t\t\t$operand = $in ? 'LIKE' : 'NOT LIKE';\n\t\t\t\t\t\t$item = \"'%\".$this->EE->db->escape_str($item).\"%'\";\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Add sub-clause to this statement\n\t\t\t\t$sql[] = sprintf(\"(%s %s %s)\", $field, $operand, $item);\n\t\t\t}\n\n\t\t\t// Inclusive or exclusive\n\t\t\t$andor = $all ? ' AND ' : ' OR ';\n\n\t\t\t// Add complete clause to where array\n\t\t\t$where[] = (count($sql) == 1) ? $sql[0] : '('.implode($andor, $sql).')';\n\t\t}\n\n\t\t// --------------------------------------\n\t\t// Where now contains a list of clauses\n\t\t// --------------------------------------\n\n\t\treturn $where;\n\t}", "function BasicSearchWhere() {\r\n\t\tglobal $Security;\r\n\t\t$sSearchStr = \"\";\r\n\t\t$sSearchKeyword = $this->BasicSearch->Keyword;\r\n\t\t$sSearchType = $this->BasicSearch->Type;\r\n\t\tif ($sSearchKeyword <> \"\") {\r\n\t\t\t$sSearch = trim($sSearchKeyword);\r\n\t\t\tif ($sSearchType <> \"=\") {\r\n\t\t\t\twhile (strpos($sSearch, \" \") !== FALSE)\r\n\t\t\t\t\t$sSearch = str_replace(\" \", \" \", $sSearch);\r\n\t\t\t\t$arKeyword = explode(\" \", trim($sSearch));\r\n\t\t\t\tforeach ($arKeyword as $sKeyword) {\r\n\t\t\t\t\tif ($sSearchStr <> \"\") $sSearchStr .= \" \" . $sSearchType . \" \";\r\n\t\t\t\t\t$sSearchStr .= \"(\" . $this->BasicSearchSQL($sKeyword) . \")\";\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\t$sSearchStr = $this->BasicSearchSQL($sSearch);\r\n\t\t\t}\r\n\t\t\t$this->Command = \"search\";\r\n\t\t}\r\n\t\tif ($this->Command == \"search\") {\r\n\t\t\t$this->BasicSearch->setKeyword($sSearchKeyword);\r\n\t\t\t$this->BasicSearch->setType($sSearchType);\r\n\t\t}\r\n\t\treturn $sSearchStr;\r\n\t}", "private function setSearchstring(){\n $search_req = $this->main->getArrayFromSearchString($_GET['content_search']);\n\n $searchstring = '';\n\n foreach($search_req as $key => $val){\n if(strlen($val) > 0){\n $searchstring .= \"`name` LIKE '%\".DB::quote($val).\"%' OR \";\n };\n };\n\n $searchstring .= \"`name` LIKE '%\".DB::quote($_GET['content_search']).\"%'\";\n\n return $searchstring;\n }", "public function search() {\n\t\tif(!isset($_REQUEST['searchType']) || $_REQUEST['searchType'] != \"AND\") $_REQUEST['searchType'] = \"OR\";\n\t\t$searchType = $_REQUEST['searchType'];\n\t\tif(!isset($_REQUEST['start']) || !is_numeric($_REQUEST['start']) || (int)$_REQUEST['start'] < 1) $_REQUEST['start'] = 0;\n\t\t$SQL_start = (int)$_REQUEST['start'];\n\t\tunset($_REQUEST['start']);\n\t\tif(!isset($_REQUEST['limit']) || !is_numeric($_REQUEST['limit']) || (int)$_REQUEST['limit'] < 1) $_REQUEST['limit'] = 20;\n\t\t$SQL_limit = (int)$_REQUEST['limit'];\n\t\tunset($_REQUEST['limit']);\n\t\tif(!isset($_REQUEST['startDate'])) $_REQUEST['startDate'] = null;\n\t\t$startDate = $_REQUEST['startDate'];\n\t\tif(!isset($_REQUEST['endDate'])) $_REQUEST['endDate'] = null;\n\t\t$endDate = $_REQUEST['endDate'];\n\t\tif(!isset($_REQUEST['columns'])) $_REQUEST['columns'] = null;\n\t\t$Columns = $_REQUEST['columns'];\n\t\tif(!isset($_REQUEST['query'])) $_REQUEST['query'] = null;\n\t\t$metadata = isset($_REQUEST['meta']) ? true : false;\n\t\t$columnModel = isset($_REQUEST['columnModel']) ? true : false;\n\t\t$treeModel = isset($_REQUEST['treeModel']) ? true : true; //Hack for the old modules, fix when upgraded.\n\t\t$QueryData = $_REQUEST['query'];\n\t\t$extraParams = isset($_REQUEST['extraParams']) ? explode(',',$_REQUEST['extraParams']) : array();\t\t\n\t\t$sudoParams = array();\n\t\t$columnModelParams = isset($_REQUEST['columnModelParams']) ? explode(',',$_REQUEST['columnModelParams']) : array();\n\t\t$Object = $this->urlParams['ID'];\n\t\tif(!isset($_REQUEST['orderBy'])) $_REQUEST['orderBy'] = null;\n\t\tif(!isset($_REQUEST['orderByDirection'])) $_REQUEST['orderByDirection'] = 'DESC';\n\t\tif(count(explode('.',$_REQUEST['orderBy']))>1){\n\t\t\t$OrderByTmpArr = explode('.',$_REQUEST['orderBy']);\n\t\t\t$OrderByTmp = $OrderByTmpArr[0].'ID';\n\t\t} else {\n\t\t\t$OrderByTmp = $_REQUEST['orderBy'];\n\t\t}\n\t\t$OrderBy = $_REQUEST['orderBy'] ? \"{$Object}.{$OrderByTmp} {$_REQUEST['orderByDirection']}\" : \"{$Object}.ID DESC\";\n\t\t$Query = '';\n\t\t$Join = '';\n\t\tif($Columns != null && $QueryData != null) {\n\t\t\t$Columns = explode(',', $Columns);\t\n\t\t\t$subObjArray = array();\n\t\t\tforeach ($Columns as $Column) {\n\t\t\t\tif($Column == 'ID') {\n\t\t\t\t\t$ID = (int)$QueryData;\n\t\t\t\t\t$Query .= \"$Object.ID='{$ID}' {$searchType} \";\n\t\t\t\t} else {\n\t\t\t\t\tif(count(explode('.',$Column))>1){\n\t\t\t\t\t\t$relation = explode('.',$Column);\n\t\t\t\t\t\t$tmpObj = Object::create($Object);\n\t\t\t\t\t\t$has_one = $tmpObj->has_one();\n\t\t\t\t\t\t$subObj = '';\n\t\t\t\t\t\tforeach($has_one as $key=>$value) {\n\t\t\t\t\t\t\tif($key == $relation[0]) {\n\t\t\t\t\t\t\t\t$subObj = $value;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(!in_array($subObj, $subObjArray)) {\n\t\t\t\t\t\t\t$Join .= \"LEFT JOIN $subObj ON $subObj.ID = $Object.{$relation[0]}ID \";\n\t\t\t\t\t\t\t$subObjArray[] = $subObj;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$Query .= \"$subObj.{$relation[1]} LIKE '%$QueryData%' {$searchType} \";\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$parentClass = get_parent_class($Object);\n\t\t\t\t\t\tif($parentClass != 'Object' && $parentClass != 'DataObject') {\n\t\t\t\t\t\t\t//$Join .= \"LEFT JOIN {$parentClass} ON {$parentClass}.ID = {$Object}.ID \";\n\t\t\t\t\t\t\t$pTmpObj = Object::create($parentClass);\n\t\t\t\t\t\t\t$arr = $pTmpObj->stat('db');\n\t\t\t\t\t\t\tif(isset($arr[$Column])) {\n\t\t\t\t\t\t\t\t$Query .= \"$parentClass.$Column LIKE '%$QueryData%' {$searchType} \";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$tmpObj = Object::create($Object);\n\t\t\t\t\t\t$arr = $tmpObj->stat('db');\n\t\t\t\t\t\t//print_r($arr);\n\t\t\t\t\t\tif(isset($arr[$Column])) {\n\t\t\t\t\t\t\t$Query .= \"$Object.$Column LIKE '%$QueryData%' {$searchType} \";\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t$Query = ($searchType == \"AND\") ? substr($Query, 0, strlen($Query)-5) : substr($Query, 0, strlen($Query)-4);\n\t\t\tif($startDate != null && $endDate != null) {\n\t\t\t\t$Query .= \" AND (DATE(TreeObject.Created) >= DATE('$startDate') AND DATE(TreeObject.Created) <= DATE('$endDate'))\";\n\t\t\t}\n\t\t} elseif ($startDate != null && $endDate != null) {\n\t\t\t$Query .= \"(DATE(TreeObject.Created) >= DATE('$startDate') AND DATE(TreeObject.Created) <= DATE('$endDate'))\";\n\t\t}\n\t\tif (count($extraParams) > 0) {\n\t\t\tforeach ($extraParams as $param) {\n\t\t\t\t$split = explode(':',$param);\n\t\t\t\tif (count($split) == 2) {\n\t\t\t\t\tif (strpos($split[0], \"[sudo]\") === false) {\n\t\t\t\t\t\tif ($Query == null || $Query == \"\") {\n\t\t\t\t\t\t\t$Query .= \"(`{$split[0]}` = '{$split[1]}')\";\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$Query .= \" AND (`{$split[0]}` = '{$split[1]}')\";\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$split[0] = substr($split[0], 6);\n\t\t\t\t\t\t$sudoParams[] = $split;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t//echo $Query;\n\t\tif($results = DataObject::get($Object, $Query, $OrderBy, $Join, \"{$SQL_start},{$SQL_limit}\")) {\n\t\t\tif (count($sudoParams) > 0) {\n\t\t\t\tforeach ($sudoParams as $sudo) {\n\t\t\t\t\tforeach($results as $result) {\n\t\t\t\t\t\tif ($result->$sudo[0] != $sudo[1]) $results->remove($result);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t$f = new JSONDataFormatter(); \n\t\t\tif($metadata == true) {\n\t\t\t\t$json = $f->convertDataObjectSet($results, null, $this->generateMetaData($Object));\n\t\t\t} else {\n\t\t\t\t$json = $f->convertDataObjectSet($results, null, '');\n\t\t\t}\n\t\t\tif($treeModel == true){\n\t\t\t\t$json = $this->update_with_tree_data($results, $json);\n\t\t\t}\n\t\t\tif($columnModel == true) {\n\t\t\t\t$json = $this->update_with_column_model($Object, $json, $columnModelParams);\n\t\t\t}\n\t\t\treturn $json;\n\t\t} else {\n\t\t\treturn $this->update_with_column_model($Object, '{\"results\": 0, \"rows\":[], \"query\":\"'.$Query.'\", \"join\":\"'.$Join.'\", '.$this->generateMetaData($Object).' \"tree\":[] }', $columnModelParams);\n\t\t}\n\t}", "public function query() {\n if (isset($this->value, $this->definition['trovequery'])) {\n $this->query->args['method'] = $this->definition['trovequery']['method'];\n if (is_array($this->value)) {\n $this->query->add_where($this->options['group'], $this->definition['trovequery']['arg'], implode($this->value, ','));\n }\n else {\n $this->query->add_where($this->options['group'], $this->definition['trovequery']['arg'], $this->value);\n }\n }\n }", "public function buildSearchCondition($query, $options = array()) {\n if (is_string($query)) {\n App::import('Model', 'SearchTerm');\n $query = new SearchTerm($query);\n }\n\n $dbo = $this->getDatasource();\n $to_search = '%' . $query->text . '%';\n $escaped_string = $dbo->value($to_search);\n\n //initial options\n $conditions = $fields = $order = array();\n\n //default search options\n $conditions['OR'] = array(\n 'LOWER(Question.title) LIKE' => strtolower($to_search),\n 'Question.body LIKE' => $to_search\n );\n $order = array(\n 'Question.modified' => 'DESC'\n );\n\n /**\n * Build find conditions\n *\n * For complex phrase (scopes > 1) -> use fulltext search\n * For simple phrase (scopes < 2) -> use normal search\n * Tags will be added as additional condition\n */\n $scope_lenght = count($query->scopes);\n if ($scope_lenght > 1) {\n\n /**\n * @see http://www.slideshare.net/billkarwin/full-text-search-in-postgresql\n * @todo override search options\n * @author\n * @since\n *\n * // Example:\n *\n * $fields = array(\n * 'ts_rank_cd(title, query) AS Question__title_rank',\n * 'ts_rank_cd(body, query) AS Question__body_rank'\n * );\n *\n * $conditions = array(\n * \"to_tsvector(title || ' ' || body) @@ to_tsquery({$escaped_string})\"\n * );\n *\n * $order = array(\n * '(Question__title_rank + Question__title_rank)' => 'DESC'\n * );\n */\n }\n\n //extract tag filter\n if (count($query->tags) > 0) {\n //get tag id list\n $this->QuestionTag->Tag->displayField = 'id';\n $tag_filter = $this->QuestionTag->Tag->find('list', array(\n 'conditions' => array(\n 'Tag.name' => array_map('strtolower', $query->tags)\n )\n ));\n //get question id with provided tags\n $this->QuestionTag->displayField = 'question_id';\n $question_filter = $this->QuestionTag->find('list', array(\n 'conditions' => array(\n 'tag_id' => $tag_filter\n )\n ));\n\n //push filter\n if (empty($question_filter)) {\n $conditions['Question.id'] = -1;\n } else if (isset($conditions['Question.id'])) {\n $conditions['Question.id'] = array_merge((array) $conditions['Question.id'], $question_filter);\n } else {\n $conditions['Question.id'] = $question_filter;\n }\n }\n\n $options = array_merge_recursive(compact('conditions', 'fields', 'order'), $options);\n\n return $options;\n }", "function _buildQuery()\n\t{\n\t\t$where\t\t= $this->_buildContentWhere();\n\t\t$orderby\t= $this->_buildContentOrderBy();\n\n\t\t$query = 'SELECT c.*, g.name AS groupname, cc.title as name, u.name AS editor, f.ordering AS fpordering, v.name AS author'\n\t\t\t. ' FROM #__content AS c'\n\t\t\t. ' LEFT JOIN #__categories AS cc ON cc.id = c.catid'\n\t\t\t. ' INNER JOIN #__content_frontpage AS f ON f.content_id = c.id'\n\t\t\t. ' LEFT JOIN #__users AS u ON u.id = c.checked_out'\n\t\t\t. ' LEFT JOIN #__users AS v ON v.id = c.created_by'\n\t\t\t. $where\n\t\t\t. $orderby\n\t\t;\n\n\t\treturn $query;\n\t}", "public function build()\n {\n return new QueryConfiguration(\n $this->drawCall,\n $this->start,\n $this->length,\n $this->searchValue,\n $this->searchRegex,\n $this->columSearches,\n $this->columnOrders\n );\n }", "function build_query($user_search, $sort) {\n $search_query = \"SELECT * FROM stocktypes\";\n\n // Extract the search keywords into an array\n $clean_search = str_replace(',', ' ', $user_search);\n $search_words = explode(' ', $clean_search);\n $final_search_words = array();\n if (count($search_words) > 0) {\n foreach ($search_words as $word) {\n if (!empty($word)) {\n $final_search_words[] = $word;\n }\n }\n }\n\n // Generate a WHERE clause using all of the search keywords\n $where_list = array();\n if (count($final_search_words) > 0) {\n foreach($final_search_words as $word) {\n $where_list[] = \"description LIKE '%$word%' OR stockname LIKE '%$word%'\";\n }\n }\n $where_clause = implode(' OR ', $where_list);\n\n // Add the keyword WHERE clause to the search query\n if (!empty($where_clause)) {\n $search_query .= \" WHERE $where_clause\";\n }\n\n // Sort the search query using the sort setting\n switch ($sort) {\n // Ascending by Stock Name\n case 1:\n $search_query .= \" ORDER BY stockname\";\n break;\n // Descending by Stock Name\n case 2:\n $search_query .= \" ORDER BY stockname DESC\";\n break;\n // Ascending by Category\n case 2.5:\n $search_query .= \" ORDER BY category\";\n break;\n // Ascending by Category\n case 2.6:\n $search_query .= \" ORDER BY category DESc\";\n break;\n // Ascending by Subcategory\n case 3:\n $search_query .= \" ORDER BY subcategory\";\n break;\n // Descending by Subcategory\n case 4:\n $search_query .= \" ORDER BY subcategory DESC\";\n break;\n // Ascending by date posted (oldest first)\n case 5:\n $search_query .= \" ORDER BY creationdate\";\n break;\n // Descending by date posted (newest first)\n case 6:\n $search_query .= \" ORDER BY creationdate DESC\";\n break;\n default:\n // No sort setting provided, so don't sort the query\n }\n\n return $search_query;\n }", "public function createDefaultSearchQuery()\n {\n $qB = SearchEngine::getElasticaQueryBuilder();\n\n $keyword = Utility::convertArrayToString($this->searchEvent->getKeyword());\n $where = $this->searchEvent->getWhere();\n\n $keywordQuery = null;\n $whereQuery = null;\n $content = 0;\n if ($where) {\n if ($geoDistance = $this->container->get(\"nearby.handler\")->getGeoDistanceInfoByWhere()) {\n $whereQuery = $qB->query()->bool();\n $whereQuery->addShould(\n $qB->query()->match()->setFieldQuery(\"searchInfo.location\",$where)\n ->setFieldType(\"searchInfo.location\", \"phrase\")\n ->setFieldBoost(\"searchInfo.location\", 2)\n ->setFieldParam('searchInfo.location', 'slop', 30)\n );\n $whereQuery->addShould(\n $qB->query()->geo_distance(\n 'geoLocation',\n [\n 'lat' => $geoDistance['latitude'],\n 'lon' => $geoDistance['longitude'],\n ],\n $geoDistance['radius'])\n );\n $content |= 1;\n } else {\n $whereQuery = $qB->query()->match()->setFieldQuery('searchInfo.location',$where)\n ->setFieldType('searchInfo.location', 'phrase')\n ->setFieldParam('searchInfo.location', 'slop', 30);\n $content |= 1;\n }\n }\n\n if ($keyword) {\n $keywordQuery = $qB->query()->multi_match();\n\n $keywordQuery->setQuery($keyword)\n ->setTieBreaker(0.3)\n ->setOperator(\"and\")\n ->setFields([\n 'friendlyUrl^500',\n 'title.raw^200',\n 'title.analyzed^10',\n 'description^5',\n 'searchInfo.keyword^1',\n 'searchInfo.location^1',\n ]);\n\n $content |= 2;\n }\n\n /* ModStores Hooks */\n HookFire(\"baseconfiguration_before_setup_query\", [\n \"content\" => &$content,\n \"whereQuery\" => &$whereQuery,\n \"keywordQuery\" => &$keywordQuery\n ]);\n\n switch ($content) {\n case 1:\n $query = $whereQuery;\n break;\n case 2:\n $query = $keywordQuery;\n break;\n case 3:\n $query = $qB->query()->bool();\n $query->addMust($keywordQuery);\n $query->addMust($whereQuery);\n break;\n default:\n $query = $qB->query()->match_all();\n break;\n }\n\n /* ModStores Hooks */\n HookFire(\"baseconfiguration_before_return_query\", [\n \"query\" => &$query,\n ]);\n\n return $query;\n }", "function BasicSearchWhere() {\r\n\t\tglobal $Security, $fs_multijoin_v;\r\n\t\t$sSearchStr = \"\";\r\n\t\t$sSearchKeyword = $fs_multijoin_v->BasicSearchKeyword;\r\n\t\t$sSearchType = $fs_multijoin_v->BasicSearchType;\r\n\t\tif ($sSearchKeyword <> \"\") {\r\n\t\t\t$sSearch = trim($sSearchKeyword);\r\n\t\t\tif ($sSearchType <> \"\") {\r\n\t\t\t\twhile (strpos($sSearch, \" \") !== FALSE)\r\n\t\t\t\t\t$sSearch = str_replace(\" \", \" \", $sSearch);\r\n\t\t\t\t$arKeyword = explode(\" \", trim($sSearch));\r\n\t\t\t\tforeach ($arKeyword as $sKeyword) {\r\n\t\t\t\t\tif ($sSearchStr <> \"\") $sSearchStr .= \" \" . $sSearchType . \" \";\r\n\t\t\t\t\t$sSearchStr .= \"(\" . $this->BasicSearchSQL($sKeyword) . \")\";\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\t$sSearchStr = $this->BasicSearchSQL($sSearch);\r\n\t\t\t}\r\n\t\t}\r\n\t\tif ($sSearchKeyword <> \"\") {\r\n\t\t\t$fs_multijoin_v->setSessionBasicSearchKeyword($sSearchKeyword);\r\n\t\t\t$fs_multijoin_v->setSessionBasicSearchType($sSearchType);\r\n\t\t}\r\n\t\treturn $sSearchStr;\r\n\t}", "public function getWhereSQL()\n {\n return \" AND \" . $this->field_where_name . \" LIKE '%\" . $this->field_row->criteria . \"%' \";\n \n }", "protected function buildQuery(Request $request)\n {\n $query = $this->model->selectRaw('id, name, count, rank');\n\n if ($name = $request->input('name')) {\n $query->where('name', 'like', \"%{$name}%\");\n }\n\n if ($rank = $request->input('rank')) {\n $query->where('rank', $rank + 0);\n }\n\n return $query;\n }", "public function buildQueryLimits()\n\t{\n\t\tglobal $modSettings;\n\n\t\t$extra_where = [];\n\n\t\tif (!empty($this->_searchParams->_minMsgID) || !empty($this->_searchParams->_maxMsgID))\n\t\t{\n\t\t\t$extra_where[] = 'id >= ' . $this->_searchParams->_minMsgID . ' AND id <= ' . (empty($this->_searchParams->_maxMsgID) ? (int) $modSettings['maxMsgID'] : $this->_searchParams->_maxMsgID);\n\t\t}\n\n\t\tif (!empty($this->_searchParams->topic))\n\t\t{\n\t\t\t$extra_where[] = 'id_topic = ' . (int) $this->_searchParams->topic;\n\t\t}\n\n\t\tif (!empty($this->_searchParams->brd))\n\t\t{\n\t\t\t$extra_where[] = 'id_board IN (' . implode(',', $this->_searchParams->brd) . ')';\n\t\t}\n\n\t\tif (!empty($this->_searchParams->_memberlist))\n\t\t{\n\t\t\t$extra_where[] = 'id_member IN (' . implode(',', $this->_searchParams->_memberlist) . ')';\n\t\t}\n\n\t\treturn $extra_where;\n\t}", "protected function _list_items_query()\n\t{\n\t\t$this->filters = (array) $this->filters;\n\t\t$where_or = array();\n\t\t$where_and = array();\n\t\tforeach($this->filters as $key => $val)\n\t\t{\n\t\t\tif (is_int($key))\n\t\t\t{\n\t\t\t\tif (isset($this->filters[$val])) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t$key = $val;\n\t\t\t\t$val = $this->filter_value;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// used for separating table names and fields since periods get translated to underscores\n\t\t\t\t$key = str_replace(':', '.', $key);\n\t\t\t}\n\t\t\t\n\t\t\t$joiner = $this->filter_join;\n\t\t\t\n\t\t\tif (is_array($joiner))\n\t\t\t{\n\t\t\t\tif (isset($joiner[$key]))\n\t\t\t\t{\n\t\t\t\t\t$joiner = $joiner[$key];\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$joiner = 'or';\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (!empty($val)) \n\t\t\t{\n\t\t\t\t$joiner_arr = 'where_'.$joiner;\n\t\t\t\t\n\t\t\t\tif (strpos($key, '.') === FALSE AND strpos($key, '(') === FALSE) $key = $this->table_name.'.'.$key;\n\t\t\t\t\n\t\t\t\t//$method = ($joiner == 'or') ? 'or_where' : 'where';\n\t\t\t\t\n\t\t\t\t// do a direct match if the values are integers and have _id in them\n\t\t\t\tif (preg_match('#_id$#', $key) AND is_numeric($val))\n\t\t\t\t{\n\t\t\t\t\t//$this->db->where(array($key => $val));\n\t\t\t\t\tarray_push($$joiner_arr, $key.'='.$val);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// from imknight https://github.com/daylightstudio/FUEL-CMS/pull/113#commits-pushed-57c156f\n\t\t\t\t//else if (preg_match('#_from#', $key) OR preg_match('#_to#', $key))\n\t\t\t\telse if (preg_match('#_from$#', $key) OR preg_match('#_fromequal$#', $key) OR preg_match('#_to$#', $key) OR preg_match('#_toequal$#', $key) OR preg_match('#_equal$#', $key))\n\t\t\t\t{\n\t\t\t\t\t//$key = strtr($key, array('_from' => ' >', '_fromequal' => ' >=', '_to' => ' <', '_toequal' => ' <='));\n\t\t\t\t\t$key_with_comparison_operator = preg_replace(array('#_from$#', '#_fromequal$#', '#_to$#', '#_toequal$#', '#_equal$#'), array(' >', ' >=', ' <', ' <=', ' ='), $key);\n\t\t\t\t\t//$this->db->where(array($key => $val));\n\t\t\t\t\t//$where_or[] = $key.'='.$this->db->escape($val);\n\t\t\t\t\tarray_push($$joiner_arr, $key_with_comparison_operator.$this->db->escape($val));\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t//$method = ($joiner == 'or') ? 'or_like' : 'like';\n\t\t\t\t\t//$this->db->$method('LOWER('.$key.')', strtolower($val), 'both');\n\t\t\t\t\tarray_push($$joiner_arr, 'LOWER('.$key.') LIKE \"%'.strtolower($val).'%\"');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t// here we will group the AND and OR separately which should handle most cases me thinks... but if not, you can always overwrite\n\t\t$where = array();\n\t\tif (!empty($where_or))\n\t\t{\n\t\t\t$where[] = '('.implode(' OR ', $where_or).')';\n\t\t}\n\t\tif (!empty($where_and))\n\t\t{\n\t\t\t$where[] = '('.implode(' AND ', $where_and).')';\n\t\t}\n\t\tif (!empty($where))\n\t\t{\n\t\t\t$where_sql = implode(' AND ', $where);\n\t\t\t$this->db->where($where_sql);\n\t\t}\n\t\t\n\t\t\n\t\t// set the table here so that items total will work\n\t\t$this->db->from($this->table_name);\n\t}", "function BuildBasicSearchSQL(&$Where, &$Fld, $arKeywords, $type) {\n\t\tglobal $EW_BASIC_SEARCH_IGNORE_PATTERN;\n\t\t$sDefCond = ($type == \"OR\") ? \"OR\" : \"AND\";\n\t\t$arSQL = array(); // Array for SQL parts\n\t\t$arCond = array(); // Array for search conditions\n\t\t$cnt = count($arKeywords);\n\t\t$j = 0; // Number of SQL parts\n\t\tfor ($i = 0; $i < $cnt; $i++) {\n\t\t\t$Keyword = $arKeywords[$i];\n\t\t\t$Keyword = trim($Keyword);\n\t\t\tif ($EW_BASIC_SEARCH_IGNORE_PATTERN <> \"\") {\n\t\t\t\t$Keyword = preg_replace($EW_BASIC_SEARCH_IGNORE_PATTERN, \"\\\\\", $Keyword);\n\t\t\t\t$ar = explode(\"\\\\\", $Keyword);\n\t\t\t} else {\n\t\t\t\t$ar = array($Keyword);\n\t\t\t}\n\t\t\tforeach ($ar as $Keyword) {\n\t\t\t\tif ($Keyword <> \"\") {\n\t\t\t\t\t$sWrk = \"\";\n\t\t\t\t\tif ($Keyword == \"OR\" && $type == \"\") {\n\t\t\t\t\t\tif ($j > 0)\n\t\t\t\t\t\t\t$arCond[$j-1] = \"OR\";\n\t\t\t\t\t} elseif ($Keyword == EW_NULL_VALUE) {\n\t\t\t\t\t\t$sWrk = $Fld->FldExpression . \" IS NULL\";\n\t\t\t\t\t} elseif ($Keyword == EW_NOT_NULL_VALUE) {\n\t\t\t\t\t\t$sWrk = $Fld->FldExpression . \" IS NOT NULL\";\n\t\t\t\t\t} elseif ($Fld->FldIsVirtual) {\n\t\t\t\t\t\t$sWrk = $Fld->FldVirtualExpression . ew_Like(ew_QuotedValue(\"%\" . $Keyword . \"%\", EW_DATATYPE_STRING, $this->DBID), $this->DBID);\n\t\t\t\t\t} elseif ($Fld->FldDataType != EW_DATATYPE_NUMBER || is_numeric($Keyword)) {\n\t\t\t\t\t\t$sWrk = $Fld->FldBasicSearchExpression . ew_Like(ew_QuotedValue(\"%\" . $Keyword . \"%\", EW_DATATYPE_STRING, $this->DBID), $this->DBID);\n\t\t\t\t\t}\n\t\t\t\t\tif ($sWrk <> \"\") {\n\t\t\t\t\t\t$arSQL[$j] = $sWrk;\n\t\t\t\t\t\t$arCond[$j] = $sDefCond;\n\t\t\t\t\t\t$j += 1;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$cnt = count($arSQL);\n\t\t$bQuoted = FALSE;\n\t\t$sSql = \"\";\n\t\tif ($cnt > 0) {\n\t\t\tfor ($i = 0; $i < $cnt-1; $i++) {\n\t\t\t\tif ($arCond[$i] == \"OR\") {\n\t\t\t\t\tif (!$bQuoted) $sSql .= \"(\";\n\t\t\t\t\t$bQuoted = TRUE;\n\t\t\t\t}\n\t\t\t\t$sSql .= $arSQL[$i];\n\t\t\t\tif ($bQuoted && $arCond[$i] <> \"OR\") {\n\t\t\t\t\t$sSql .= \")\";\n\t\t\t\t\t$bQuoted = FALSE;\n\t\t\t\t}\n\t\t\t\t$sSql .= \" \" . $arCond[$i] . \" \";\n\t\t\t}\n\t\t\t$sSql .= $arSQL[$cnt-1];\n\t\t\tif ($bQuoted)\n\t\t\t\t$sSql .= \")\";\n\t\t}\n\t\tif ($sSql <> \"\") {\n\t\t\tif ($Where <> \"\") $Where .= \" OR \";\n\t\t\t$Where .= \"(\" . $sSql . \")\";\n\t\t}\n\t}", "function BuildBasicSearchSQL(&$Where, &$Fld, $arKeywords, $type) {\n\t\tglobal $EW_BASIC_SEARCH_IGNORE_PATTERN;\n\t\t$sDefCond = ($type == \"OR\") ? \"OR\" : \"AND\";\n\t\t$arSQL = array(); // Array for SQL parts\n\t\t$arCond = array(); // Array for search conditions\n\t\t$cnt = count($arKeywords);\n\t\t$j = 0; // Number of SQL parts\n\t\tfor ($i = 0; $i < $cnt; $i++) {\n\t\t\t$Keyword = $arKeywords[$i];\n\t\t\t$Keyword = trim($Keyword);\n\t\t\tif ($EW_BASIC_SEARCH_IGNORE_PATTERN <> \"\") {\n\t\t\t\t$Keyword = preg_replace($EW_BASIC_SEARCH_IGNORE_PATTERN, \"\\\\\", $Keyword);\n\t\t\t\t$ar = explode(\"\\\\\", $Keyword);\n\t\t\t} else {\n\t\t\t\t$ar = array($Keyword);\n\t\t\t}\n\t\t\tforeach ($ar as $Keyword) {\n\t\t\t\tif ($Keyword <> \"\") {\n\t\t\t\t\t$sWrk = \"\";\n\t\t\t\t\tif ($Keyword == \"OR\" && $type == \"\") {\n\t\t\t\t\t\tif ($j > 0)\n\t\t\t\t\t\t\t$arCond[$j-1] = \"OR\";\n\t\t\t\t\t} elseif ($Keyword == EW_NULL_VALUE) {\n\t\t\t\t\t\t$sWrk = $Fld->FldExpression . \" IS NULL\";\n\t\t\t\t\t} elseif ($Keyword == EW_NOT_NULL_VALUE) {\n\t\t\t\t\t\t$sWrk = $Fld->FldExpression . \" IS NOT NULL\";\n\t\t\t\t\t} elseif ($Fld->FldIsVirtual) {\n\t\t\t\t\t\t$sWrk = $Fld->FldVirtualExpression . ew_Like(ew_QuotedValue(\"%\" . $Keyword . \"%\", EW_DATATYPE_STRING, $this->DBID), $this->DBID);\n\t\t\t\t\t} elseif ($Fld->FldDataType != EW_DATATYPE_NUMBER || is_numeric($Keyword)) {\n\t\t\t\t\t\t$sWrk = $Fld->FldBasicSearchExpression . ew_Like(ew_QuotedValue(\"%\" . $Keyword . \"%\", EW_DATATYPE_STRING, $this->DBID), $this->DBID);\n\t\t\t\t\t}\n\t\t\t\t\tif ($sWrk <> \"\") {\n\t\t\t\t\t\t$arSQL[$j] = $sWrk;\n\t\t\t\t\t\t$arCond[$j] = $sDefCond;\n\t\t\t\t\t\t$j += 1;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$cnt = count($arSQL);\n\t\t$bQuoted = FALSE;\n\t\t$sSql = \"\";\n\t\tif ($cnt > 0) {\n\t\t\tfor ($i = 0; $i < $cnt-1; $i++) {\n\t\t\t\tif ($arCond[$i] == \"OR\") {\n\t\t\t\t\tif (!$bQuoted) $sSql .= \"(\";\n\t\t\t\t\t$bQuoted = TRUE;\n\t\t\t\t}\n\t\t\t\t$sSql .= $arSQL[$i];\n\t\t\t\tif ($bQuoted && $arCond[$i] <> \"OR\") {\n\t\t\t\t\t$sSql .= \")\";\n\t\t\t\t\t$bQuoted = FALSE;\n\t\t\t\t}\n\t\t\t\t$sSql .= \" \" . $arCond[$i] . \" \";\n\t\t\t}\n\t\t\t$sSql .= $arSQL[$cnt-1];\n\t\t\tif ($bQuoted)\n\t\t\t\t$sSql .= \")\";\n\t\t}\n\t\tif ($sSql <> \"\") {\n\t\t\tif ($Where <> \"\") $Where .= \" OR \";\n\t\t\t$Where .= \"(\" . $sSql . \")\";\n\t\t}\n\t}", "function BuildBasicSearchSQL(&$Where, &$Fld, $arKeywords, $type) {\n\t\tglobal $EW_BASIC_SEARCH_IGNORE_PATTERN;\n\t\t$sDefCond = ($type == \"OR\") ? \"OR\" : \"AND\";\n\t\t$arSQL = array(); // Array for SQL parts\n\t\t$arCond = array(); // Array for search conditions\n\t\t$cnt = count($arKeywords);\n\t\t$j = 0; // Number of SQL parts\n\t\tfor ($i = 0; $i < $cnt; $i++) {\n\t\t\t$Keyword = $arKeywords[$i];\n\t\t\t$Keyword = trim($Keyword);\n\t\t\tif ($EW_BASIC_SEARCH_IGNORE_PATTERN <> \"\") {\n\t\t\t\t$Keyword = preg_replace($EW_BASIC_SEARCH_IGNORE_PATTERN, \"\\\\\", $Keyword);\n\t\t\t\t$ar = explode(\"\\\\\", $Keyword);\n\t\t\t} else {\n\t\t\t\t$ar = array($Keyword);\n\t\t\t}\n\t\t\tforeach ($ar as $Keyword) {\n\t\t\t\tif ($Keyword <> \"\") {\n\t\t\t\t\t$sWrk = \"\";\n\t\t\t\t\tif ($Keyword == \"OR\" && $type == \"\") {\n\t\t\t\t\t\tif ($j > 0)\n\t\t\t\t\t\t\t$arCond[$j-1] = \"OR\";\n\t\t\t\t\t} elseif ($Keyword == EW_NULL_VALUE) {\n\t\t\t\t\t\t$sWrk = $Fld->FldExpression . \" IS NULL\";\n\t\t\t\t\t} elseif ($Keyword == EW_NOT_NULL_VALUE) {\n\t\t\t\t\t\t$sWrk = $Fld->FldExpression . \" IS NOT NULL\";\n\t\t\t\t\t} elseif ($Fld->FldIsVirtual) {\n\t\t\t\t\t\t$sWrk = $Fld->FldVirtualExpression . ew_Like(ew_QuotedValue(\"%\" . $Keyword . \"%\", EW_DATATYPE_STRING, $this->DBID), $this->DBID);\n\t\t\t\t\t} elseif ($Fld->FldDataType != EW_DATATYPE_NUMBER || is_numeric($Keyword)) {\n\t\t\t\t\t\t$sWrk = $Fld->FldBasicSearchExpression . ew_Like(ew_QuotedValue(\"%\" . $Keyword . \"%\", EW_DATATYPE_STRING, $this->DBID), $this->DBID);\n\t\t\t\t\t}\n\t\t\t\t\tif ($sWrk <> \"\") {\n\t\t\t\t\t\t$arSQL[$j] = $sWrk;\n\t\t\t\t\t\t$arCond[$j] = $sDefCond;\n\t\t\t\t\t\t$j += 1;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$cnt = count($arSQL);\n\t\t$bQuoted = FALSE;\n\t\t$sSql = \"\";\n\t\tif ($cnt > 0) {\n\t\t\tfor ($i = 0; $i < $cnt-1; $i++) {\n\t\t\t\tif ($arCond[$i] == \"OR\") {\n\t\t\t\t\tif (!$bQuoted) $sSql .= \"(\";\n\t\t\t\t\t$bQuoted = TRUE;\n\t\t\t\t}\n\t\t\t\t$sSql .= $arSQL[$i];\n\t\t\t\tif ($bQuoted && $arCond[$i] <> \"OR\") {\n\t\t\t\t\t$sSql .= \")\";\n\t\t\t\t\t$bQuoted = FALSE;\n\t\t\t\t}\n\t\t\t\t$sSql .= \" \" . $arCond[$i] . \" \";\n\t\t\t}\n\t\t\t$sSql .= $arSQL[$cnt-1];\n\t\t\tif ($bQuoted)\n\t\t\t\t$sSql .= \")\";\n\t\t}\n\t\tif ($sSql <> \"\") {\n\t\t\tif ($Where <> \"\") $Where .= \" OR \";\n\t\t\t$Where .= \"(\" . $sSql . \")\";\n\t\t}\n\t}", "function BuildBasicSearchSQL(&$Where, &$Fld, $arKeywords, $type) {\n\t\tglobal $EW_BASIC_SEARCH_IGNORE_PATTERN;\n\t\t$sDefCond = ($type == \"OR\") ? \"OR\" : \"AND\";\n\t\t$arSQL = array(); // Array for SQL parts\n\t\t$arCond = array(); // Array for search conditions\n\t\t$cnt = count($arKeywords);\n\t\t$j = 0; // Number of SQL parts\n\t\tfor ($i = 0; $i < $cnt; $i++) {\n\t\t\t$Keyword = $arKeywords[$i];\n\t\t\t$Keyword = trim($Keyword);\n\t\t\tif ($EW_BASIC_SEARCH_IGNORE_PATTERN <> \"\") {\n\t\t\t\t$Keyword = preg_replace($EW_BASIC_SEARCH_IGNORE_PATTERN, \"\\\\\", $Keyword);\n\t\t\t\t$ar = explode(\"\\\\\", $Keyword);\n\t\t\t} else {\n\t\t\t\t$ar = array($Keyword);\n\t\t\t}\n\t\t\tforeach ($ar as $Keyword) {\n\t\t\t\tif ($Keyword <> \"\") {\n\t\t\t\t\t$sWrk = \"\";\n\t\t\t\t\tif ($Keyword == \"OR\" && $type == \"\") {\n\t\t\t\t\t\tif ($j > 0)\n\t\t\t\t\t\t\t$arCond[$j-1] = \"OR\";\n\t\t\t\t\t} elseif ($Keyword == EW_NULL_VALUE) {\n\t\t\t\t\t\t$sWrk = $Fld->FldExpression . \" IS NULL\";\n\t\t\t\t\t} elseif ($Keyword == EW_NOT_NULL_VALUE) {\n\t\t\t\t\t\t$sWrk = $Fld->FldExpression . \" IS NOT NULL\";\n\t\t\t\t\t} elseif ($Fld->FldIsVirtual) {\n\t\t\t\t\t\t$sWrk = $Fld->FldVirtualExpression . ew_Like(ew_QuotedValue(\"%\" . $Keyword . \"%\", EW_DATATYPE_STRING, $this->DBID), $this->DBID);\n\t\t\t\t\t} elseif ($Fld->FldDataType != EW_DATATYPE_NUMBER || is_numeric($Keyword)) {\n\t\t\t\t\t\t$sWrk = $Fld->FldBasicSearchExpression . ew_Like(ew_QuotedValue(\"%\" . $Keyword . \"%\", EW_DATATYPE_STRING, $this->DBID), $this->DBID);\n\t\t\t\t\t}\n\t\t\t\t\tif ($sWrk <> \"\") {\n\t\t\t\t\t\t$arSQL[$j] = $sWrk;\n\t\t\t\t\t\t$arCond[$j] = $sDefCond;\n\t\t\t\t\t\t$j += 1;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$cnt = count($arSQL);\n\t\t$bQuoted = FALSE;\n\t\t$sSql = \"\";\n\t\tif ($cnt > 0) {\n\t\t\tfor ($i = 0; $i < $cnt-1; $i++) {\n\t\t\t\tif ($arCond[$i] == \"OR\") {\n\t\t\t\t\tif (!$bQuoted) $sSql .= \"(\";\n\t\t\t\t\t$bQuoted = TRUE;\n\t\t\t\t}\n\t\t\t\t$sSql .= $arSQL[$i];\n\t\t\t\tif ($bQuoted && $arCond[$i] <> \"OR\") {\n\t\t\t\t\t$sSql .= \")\";\n\t\t\t\t\t$bQuoted = FALSE;\n\t\t\t\t}\n\t\t\t\t$sSql .= \" \" . $arCond[$i] . \" \";\n\t\t\t}\n\t\t\t$sSql .= $arSQL[$cnt-1];\n\t\t\tif ($bQuoted)\n\t\t\t\t$sSql .= \")\";\n\t\t}\n\t\tif ($sSql <> \"\") {\n\t\t\tif ($Where <> \"\") $Where .= \" OR \";\n\t\t\t$Where .= \"(\" . $sSql . \")\";\n\t\t}\n\t}", "protected function buildQuery(Request $request)\n {\n $query = $this->model->selectRaw('id, name, url, created_at');\n \n if ($name = $request->input('name')) {\n $query->where('name', 'like', \"%{$name}%\");\n }\n\n return $query;\n }", "public function buildSortQuery()\n\t\t\t{\n\t\t\t\t$this->sql_sort = '';\n\t\t\t\t$sort = $this->fields_arr['orderby_field'];\n\t\t\t\t$orderBy = $this->fields_arr['orderby'];\n\t\t\t\tif ($sort AND $orderBy)\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->sql_sort = ' '.$sort.' '.$orderBy;\n\t\t\t\t\t}\n\t\t\t}", "private function buildSearchURL($q){\n\t\t$this->searchURL = $this->baseURL;\n\t\t$this->searchURL .= \"?version=\".$this->version;\n\t\t$this->searchURL .= \"&recordSchema=\".$this->recordSchema;\n\t\t$this->searchURL .= \"&query=\".$q;\n\t\t$this->searchURL .= \"&operation=searchRetrieve\";\n\t\t// optinal parameters\n\t\tif(isset($this->recordPacking)) $this->searchURL .= \"&recordPacking=\".$this->recordPacking;\n\t\tif(isset($this->startRecord)) $this->searchURL .= \"&startRecord=\".$this->startRecord;\n\t\tif(isset($this->maximumRecords)) $this->searchURL .= \"&maximumRecords=\".$this->maximumRecords;\n\t}", "public function search()\n {\n $criteria = new CDbCriteria();\n\n if ($this->scenario == 'search_global') {\n $criteria->addColumnCondition(array('isGlobal' => 1));\n if ($this->relaxId == '1') {\n $criteria->addCondition('relaxId IS NOT NULL AND status = \"'.self::STATUS_APPROVED.'\"');\n } elseif ($this->relaxId == '0') {\n $criteria->addCondition('relaxId IS NULL AND status = \"'.self::STATUS_APPROVED.'\"');\n }\n } elseif ($this->scenario == 'search_users') {\n $criteria->addCondition('userId IS NOT NULL AND isGlobal = 0 AND (status = \"'.self::STATUS_APPROVED.'\" OR status = \"'.self::STATUS_DECLINED.'\")');\n } elseif ($this->scenario == 'search_on_validation') {\n $criteria->addCondition('userId IS NOT NULL AND isGlobal = 0 AND status = \"'.self::STATUS_WAITING.'\"');\n } elseif($this->scenario == 'search_from_relax') {\n $criteria->addCondition('relaxId IS NOT NULL AND isGlobal = 1 AND status = \"'.self::STATUS_WAITING.'\"');\n }\n\n $criteria->compare('eventId', $this->eventId, true);\n $criteria->compare('category', $this->category, true);\n $criteria->compare('publisherName', $this->publisherName, true);\n $criteria->compare('name', $this->name, true);\n $criteria->compare('cityObject.name', $this->searchCityObject->name, true);\n $criteria->compare('dateStart', strtotime($this->dateStart), true);\n $criteria->compare('timeStart', $this->timeStart, true);\n $criteria->compare('dateCreated', strtotime($this->dateCreated), true);\n\n return new CActiveDataProvider($this, array(\n 'criteria' => $criteria,\n 'sort'=>array(\n 'defaultOrder'=>'dateCreated DESC',\n )\n ));\n }", "public function buildQuery(Model $Model, $attribute) {\n\t\t$TemplateInstance = $this->templateInstance($Model, $attribute);\n\n\t\t$findOn = $TemplateInstance->findOn($Model);\n\t\t$findField = $TemplateInstance->findField($Model);\n\n\t\t$_filter = new AdvancedFiltersObject();\n\t\t$_filter->setModel($findOn);\n\t\t$_filter->setFilterValues([]);\n\t\t$parameters = $this->buildParams($Model, $attribute);\n\t\t$_filter->setConvertedValues($parameters);\n\t\t$conditions = $_filter->getConditions();\n\n\t\t$query = [\n\t\t\t'conditions' => $conditions,\n\t\t\t'fields' => [$findOn->escapeField($findField)]\n\t\t];\n\n\t\tif ($Model->alias !== $findOn->alias) {\n\t\t\t$query['recursive'] = -1;\n\t\t\t$primaryField = $Model->escapeField($Model->primaryKey);\n\n\t\t\t$query = $findOn->getQuery('all', $query);\n\t\t\t$query = [\n\t\t\t\t'conditions' => [\n\t\t\t\t\t\"{$primaryField} IN ({$query})\"\n\t\t\t\t],\n\t\t\t\t'fields' => [$primaryField]\n\t\t\t];\n\t\t}\n\n\t\treturn $query;\n\t}", "public function createQuery() {\n\t\treturn $this->luceneQueryFactory->create($this);\n\t}", "protected function _buildWhere(&$query)\r\n {\r\n\r\n\r\n \t//if($this->_checkin!=null)\r\n \t//{\r\n \t//\t$query->where('ltap.ltap_qdatu = \"'.$this->_confdate.'\"');\r\n \t//}\r\n return $query;\r\n }", "function query_parse_search_expression($input) {\n if (!isset($this->search_query)) {\n $this->parsed = TRUE;\n $this->search_query = db_select('search_index', 'i', array('target' => 'slave'))->extend('viewsSearchQuery');\n $this->search_query->searchExpression($input, $this->view->base_table);\n $this->search_query->publicParseSearchExpression();\n }\n }", "public function getSearchSql($params)\n {\n global $key, $previousItemNumber, $date, $expand;\n\n $sql = 'SELECT ' \n . $params['fields'] . ' '\n . 'FROM ' \n . $params['table'] . ' '\n . 'WHERE '\n . '(' . $params['draft'] . \" = '0') \" \n . (($date != 'all') ? 'AND (' : '');\n if ($key != '') {\n if (!strrchr($key, ' ')) {\n $keys = explode(',', $key);\n $and_or = 'OR';\n } else {\n $keys = explode(' ', $key);\n $and_or = 'AND';\n }\n $sql .= $params['title'] . \" LIKE '%\" . $keys[0] . \"%' OR \"\n . $params['comment'] . \" LIKE '%\" . $keys[0] . \"%')\";\n for ($i = 1; $max = sizeof($keys), $i < $max; $i++) {\n $sql .= $and_or . ' '\n . '(' \n . $params['title'] . \" LIKE '%\" . $keys[$i] . \"%'\"\n . ' OR ' \n . $params['comment'] . \" LIKE '%\" . $keys[$i] . \"%'\"\n . ')';\n }\n $sql .= ($date != 'all') \n ? ' AND (' . $params['date'] . \" LIKE '\" . $date . \"%')\" \n : '';\n } else if ($key == '') { // Monthly search\n $sql .= ($date != 'all') \n ? $params['date'] . \" LIKE '\" . $date . \"%')\" \n : '';\n }\n $sql .= (!empty($params['group_by'])) \n ? ' GROUP BY ' . $params['group_by'] \n : '';\n $sql .= ' ORDER BY ' . $params['date'] \n . ' DESC LIMIT ' . $previousItemNumber . ', ' . self::$config['page_max'];\n \n return $sql;\n }", "function build_query($user_search, $sort) {\n $search_query = \"SELECT * FROM tieba_content\";\n\n // Extract the search keywords into an array\n $clean_search = str_replace(',', ' ', $user_search);\n $search_words = explode(' ', $clean_search);\n $final_search_words = array();\n if (count($search_words) > 0) {\n foreach ($search_words as $word) {\n if (!empty($word)) {\n $final_search_words[] = $word;\n }\n }\n }\n\n // Generate a WHERE clause using all of the search keywords\n switch($sort){\n\t\t//search for the biaoti\n\t\tcase 1:\n\t\t\t\t\t$where_list = array();\n\t\t\tif (count($final_search_words) > 0) {\n\t\t\t foreach($final_search_words as $word) {\n\t\t\t\t$where_list[] = \"content_biaoti LIKE '%$word%'\";\n\t\t\t }\n\t\t\t}\n\t\t\t$where_clause = implode(' OR ', $where_list);\n\t\t\n\t\t\t// Add the keyword WHERE clause to the search query\n\t\t\tif (!empty($where_clause)) {\n\t\t\t $search_query .= \" WHERE $where_clause\";\n\t\t\t}\n\t\t\tbreak;\n\t\t//search for the neirong\n\t\tcase 2:\n\t\t\t\t\t\t\t\t$where_list = array();\n\t\t\tif (count($final_search_words) > 0) {\n\t\t\t foreach($final_search_words as $word) {\n\t\t\t\t$where_list[] = \"content_neirong LIKE '%$word%'\";\n\t\t\t }\n\t\t\t}\n\t\t\t$where_clause = implode(' OR ', $where_list);\n\t\t\n\t\t\t// Add the keyword WHERE clause to the search query\n\t\t\tif (!empty($where_clause)) {\n\t\t\t $search_query .= \" WHERE $where_clause\";\n\t\t\t}\n\t}\n\t$search_query .= ' ORDER BY content_fabiaoshijian DESC';\n\treturn $search_query;\n\t\n}", "function buildQuery () {\n $select = array();\n $from = array();\n $where = array();\n $join = '';\n $rowLimit = '';\n $tables = array();\n\n if (!empty ($this->checkTables)) {\n\n foreach ($this->checkTables as $table) {\n\n // only include tables that have selected columns\n $columns = self::getCheckTableColumns( $table );\n\n if (!empty ($columns)) {\n\n $tables[] = $this->removeQuotes($table);\n\n // Assign select and where clauses\n //go through each column\n foreach ($columns as $column) {\n //Add is column to constraint if selected\n if (!empty( $this->formTableColumnFilterHash[$table][$column]['checkColumn'] )) {\n $select[] = $this->removeQuotes($table) . \".\" . $this->removeQuotes($column);\n }\n\n self::getColumnFilter ( $where,\n $table,\n $column,\n $this->formTableColumnFilterHash[$table][$column]['selectMinOper'],\n $this->formTableColumnFilterHash[$table][$column]['textMinValue'],\n $this->formTableColumnFilterHash[$table][$column]['selectMaxOper'],\n $this->formTableColumnFilterHash[$table][$column]['textMaxValue']);\n } // foreach $column\n } //if (!empty ($columns))\n } // foreach $table\n } //if (!empty ($this->checkTables))\n\n // If there is only one table add from clause to that, otherwise only add the join table\n\n //Calculate joins before FROM\n $join = $this->joinTables($this->checkTables);\n\n $fromStatement = \"FROM \";\n $tblCounter = 0;\n $joinarray = array();\n $uniqueJoinArray= array_unique($this->JOINARRAY);\n $tblTotal = count($tables) - count($uniqueJoinArray);\n\n // build the FROM statement using all tables and not just tables that have selected columns\n foreach ($this->checkTables as $t) {\n $tblCounter++;\n\n # don't add a table to the FROM statement if it is used in a JOIN\n if(!(in_array($t, $this->JOINARRAY))){\n $fromStatement .= $t;\n\n //if($tblCounter < $tblTotal){\n $fromStatement .= \", \";\n //} // if\n\n } // if\n } // foreach tables\n\n $fromStatement = preg_replace(\"/\\,\\s*$/\",\"\",$fromStatement);\n $from[] = $fromStatement;\n\n // Add something if there are no columns selected\n if ( count( $select ) == 0 ) {\n $select[] = '42==42';\n }\n\n // Let's combine all the factors into one big query\n $query = \"SELECT \" . join(', ',$select) . \"\\n\" . join(', ', $from) . \"\\n\" . $join;\n\n # Case non-empty where clause\n if ( count( $where ) > 0 ) {\n $query .= 'WHERE ' . join( \" AND \", $where );\n $query .= \"\\n\";\n }\n\n // Add Row Limit\n if ( !empty( $this->selectRowLimit ) ) {\n $rowLimit = \"LIMIT \" . $this->selectRowLimit;\n $query .= $rowLimit;\n $query .= \"\\n\";\n }\n\n return $query;\n }", "protected function _buildQuery()\r\n {\r\n \t\r\n $db = JFactory::getDBO();\r\n $query = $db->getQuery(TRUE);\r\n\r\n $query->select('proptype.ddcbookit_proptype_id, proptype.proptype_title, proptype.proptype_description');\r\n $query->from('#__ddcbookit_proptypes as proptype');\r\n return $query;\r\n \r\n }", "function build_search_query_from_field_content_pairs(array $field_content_pairs, $query_method = 'query_string') {\n $queries = [];\n foreach ($field_content_pairs as $field => $content) {\n if (!empty($content)) {\n $queries[] = [\n $query_method => [\n \"default_field\" => $field,\n \"query\" => _remove_special_chars($content),\n \"default_operator\" => \"OR\",\n ],\n ];\n }\n }\n $query = [\n \"bool\" => [\n \"must\" => $queries,\n ],\n ];\n return $query;\n}", "function BuildBasicSearchSql(&$Where, &$Fld, $Keyword) {\n\t\t$sFldExpression = ($Fld->FldVirtualExpression <> \"\") ? $Fld->FldVirtualExpression : $Fld->FldExpression;\n\t\t$lFldDataType = ($Fld->FldIsVirtual) ? EW_DATATYPE_STRING : $Fld->FldDataType;\n\t\tif ($lFldDataType == EW_DATATYPE_NUMBER) {\n\t\t\t$sWrk = $sFldExpression . \" = \" . ew_QuotedValue($Keyword, $lFldDataType);\n\t\t} else {\n\t\t\t$sWrk = $sFldExpression . \" LIKE \" . ew_QuotedValue(\"%\" . $Keyword . \"%\", $lFldDataType);\n\t\t}\n\t\tif ($Where <> \"\") $Where .= \" OR \";\n\t\t$Where .= $sWrk;\n\t}", "function BuildBasicSearchSql(&$Where, &$Fld, $Keyword) {\n\t\t$sFldExpression = ($Fld->FldVirtualExpression <> \"\") ? $Fld->FldVirtualExpression : $Fld->FldExpression;\n\t\t$lFldDataType = ($Fld->FldIsVirtual) ? EW_DATATYPE_STRING : $Fld->FldDataType;\n\t\tif ($lFldDataType == EW_DATATYPE_NUMBER) {\n\t\t\t$sWrk = $sFldExpression . \" = \" . ew_QuotedValue($Keyword, $lFldDataType);\n\t\t} else {\n\t\t\t$sWrk = $sFldExpression . \" LIKE \" . ew_QuotedValue(\"%\" . $Keyword . \"%\", $lFldDataType);\n\t\t}\n\t\tif ($Where <> \"\") $Where .= \" OR \";\n\t\t$Where .= $sWrk;\n\t}", "public function search(){ \n\t\t$this->layout = false;\t \n\t\t$q = trim(Sanitize::escape($_GET['q']));\t\n\t\tif(!empty($q)){\n\t\t\t// execute only when the search keywork has value\t\t\n\t\t\t$this->set('keyword', $q);\n\t\t\t$data = $this->BdSpoc->find('all', array('fields' => array('HrEmployee.first_name'),\n\t\t\t'group' => array('first_name'), 'conditions' => \tarray(\"OR\" => array ('first_name like' => '%'.$q.'%'),\n\t\t\t'AND' => array('HrEmployee.status' => '1', 'HrEmployee.is_deleted' => 'N','BdSpoc.is_deleted' => 'N'))));\t\t\n\t\t\t$this->set('results', $data);\n\t\t}\n }", "function BuildBasicSearchSql(&$Where, &$Fld, $arKeywords, $type) {\n\t\t$sDefCond = ($type == \"OR\") ? \"OR\" : \"AND\";\n\t\t$arSQL = array(); // Array for SQL parts\n\t\t$arCond = array(); // Array for search conditions\n\t\t$cnt = count($arKeywords);\n\t\t$j = 0; // Number of SQL parts\n\t\tfor ($i = 0; $i < $cnt; $i++) {\n\t\t\t$Keyword = $arKeywords[$i];\n\t\t\t$Keyword = trim($Keyword);\n\t\t\tif (EW_BASIC_SEARCH_IGNORE_PATTERN <> \"\") {\n\t\t\t\t$Keyword = preg_replace(EW_BASIC_SEARCH_IGNORE_PATTERN, \"\\\\\", $Keyword);\n\t\t\t\t$ar = explode(\"\\\\\", $Keyword);\n\t\t\t} else {\n\t\t\t\t$ar = array($Keyword);\n\t\t\t}\n\t\t\tforeach ($ar as $Keyword) {\n\t\t\t\tif ($Keyword <> \"\") {\n\t\t\t\t\t$sWrk = \"\";\n\t\t\t\t\tif ($Keyword == \"OR\" && $type == \"\") {\n\t\t\t\t\t\tif ($j > 0)\n\t\t\t\t\t\t\t$arCond[$j-1] = \"OR\";\n\t\t\t\t\t} elseif ($Keyword == EW_NULL_VALUE) {\n\t\t\t\t\t\t$sWrk = $Fld->FldExpression . \" IS NULL\";\n\t\t\t\t\t} elseif ($Keyword == EW_NOT_NULL_VALUE) {\n\t\t\t\t\t\t$sWrk = $Fld->FldExpression . \" IS NOT NULL\";\n\t\t\t\t\t} elseif ($Fld->FldIsVirtual && $Fld->FldVirtualSearch) {\n\t\t\t\t\t\t$sWrk = $Fld->FldVirtualExpression . ew_Like(ew_QuotedValue(\"%\" . $Keyword . \"%\", EW_DATATYPE_STRING, $this->DBID), $this->DBID);\n\t\t\t\t\t} elseif ($Fld->FldDataType != EW_DATATYPE_NUMBER || is_numeric($Keyword)) {\n\t\t\t\t\t\t$sWrk = $Fld->FldBasicSearchExpression . ew_Like(ew_QuotedValue(\"%\" . $Keyword . \"%\", EW_DATATYPE_STRING, $this->DBID), $this->DBID);\n\t\t\t\t\t}\n\t\t\t\t\tif ($sWrk <> \"\") {\n\t\t\t\t\t\t$arSQL[$j] = $sWrk;\n\t\t\t\t\t\t$arCond[$j] = $sDefCond;\n\t\t\t\t\t\t$j += 1;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$cnt = count($arSQL);\n\t\t$bQuoted = FALSE;\n\t\t$sSql = \"\";\n\t\tif ($cnt > 0) {\n\t\t\tfor ($i = 0; $i < $cnt-1; $i++) {\n\t\t\t\tif ($arCond[$i] == \"OR\") {\n\t\t\t\t\tif (!$bQuoted) $sSql .= \"(\";\n\t\t\t\t\t$bQuoted = TRUE;\n\t\t\t\t}\n\t\t\t\t$sSql .= $arSQL[$i];\n\t\t\t\tif ($bQuoted && $arCond[$i] <> \"OR\") {\n\t\t\t\t\t$sSql .= \")\";\n\t\t\t\t\t$bQuoted = FALSE;\n\t\t\t\t}\n\t\t\t\t$sSql .= \" \" . $arCond[$i] . \" \";\n\t\t\t}\n\t\t\t$sSql .= $arSQL[$cnt-1];\n\t\t\tif ($bQuoted)\n\t\t\t\t$sSql .= \")\";\n\t\t}\n\t\tif ($sSql <> \"\") {\n\t\t\tif ($Where <> \"\") $Where .= \" OR \";\n\t\t\t$Where .= \"(\" . $sSql . \")\";\n\t\t}\n\t}", "public function getQuery()\n {\n $query = array(\n 'query' => $this->buildQueryTerm(),\n 'bases' => array_unique($this->collections),\n 'offset_start' => $this->offsetStart,\n 'per_page' => $this->recordsPerPage,\n 'search_type' => $this->searchType\n );\n\n $query = $this->appendRecordType($query);\n $query = $this->appendDates($query);\n $query = $this->appendStatuses($query);\n $query = $this->appendFields($query);\n $query = $this->appendSort($query);\n $query = $this->appendTruncature($query);\n\n return new RecordQuery($query, $this->searchType);\n }", "public function buildSortQuery()\n\t\t\t{\n\t\t\t\t$this->sql_sort = $this->fields_arr['orderby_field'].' '.$this->fields_arr['orderby'];\n\t\t\t}", "public function search($query);", "public function createQuery()\n\t{\n\t\t$this->tab[] = $this->action;\n\t\t$this->tab[] = !is_array($this->field) ? $this->field : join(', ',$this->field);\n\t\t$this->tab[] = ' FROM '.$this->from;\n\t\tif(!empty($this->where)){$this->tab[] = 'WHERE '.$this->where;}\n\t\tif(!empty($this->and)){$this->tab[] = 'AND '.$this->and;}\n\t\tif(!empty($this->or)){$this->tab[] = 'OR '.$this->or;}\n\t\tif(!empty($this->in)){$this->tab[] = 'IN '.$this->in;}\n\t\tif(!empty($this->beetween)){$this->tab[] = 'BEETWEEN '.$this->beetween;}\n\t\tif(!empty($this->not)){$this->tab[] = 'NOT '.$this->not;}\n\t\tif(!empty($this->like)){$this->tab[] = 'LIKE '.$this->like;}\n\t\tif(!empty($this->order)){$this->tab[] = 'ORDER BY '.$this->order;}\n\t\treturn join(\" \",$this->tab);\n\t}", "protected function getWhereClause() {}", "function BuildBasicSearchSql(&$Where, &$Fld, $Keyword) {\r\n\t\t$sFldExpression = ($Fld->FldVirtualExpression <> \"\") ? $Fld->FldVirtualExpression : $Fld->FldExpression;\r\n\t\t$lFldDataType = ($Fld->FldIsVirtual) ? EW_DATATYPE_STRING : $Fld->FldDataType;\r\n\t\tif ($lFldDataType == EW_DATATYPE_NUMBER) {\r\n\t\t\t$sWrk = $sFldExpression . \" = \" . ew_QuotedValue($Keyword, $lFldDataType);\r\n\t\t} else {\r\n\t\t\t$sWrk = $sFldExpression . \" LIKE \" . ew_QuotedValue(\"%\" . $Keyword . \"%\", $lFldDataType);\r\n\t\t}\r\n\t\tif ($Where <> \"\") $Where .= \" OR \";\r\n\t\t$Where .= $sWrk;\r\n\t}", "function _generateUserNameSearchSQL($search, $searchMatch, $prefix, &$params) {\n\t\t$first_last = $this->concat($prefix.'first_name', '\\' \\'', $prefix.'last_name');\n\t\t$first_middle_last = $this->concat($prefix.'first_name', '\\' \\'', $prefix.'middle_name', '\\' \\'', $prefix.'last_name');\n\t\t$last_comma_first = $this->concat($prefix.'last_name', '\\', \\'', $prefix.'first_name');\n\t\t$last_comma_first_middle = $this->concat($prefix.'last_name', '\\', \\'', $prefix.'first_name', '\\' \\'', $prefix.'middle_name');\n\t\tif ($searchMatch === 'is') {\n\t\t\t$searchSql = \" AND (LOWER({$prefix}last_name) = LOWER(?) OR LOWER($first_last) = LOWER(?) OR LOWER($first_middle_last) = LOWER(?) OR LOWER($last_comma_first) = LOWER(?) OR LOWER($last_comma_first_middle) = LOWER(?))\";\n\t\t} elseif ($searchMatch === 'contains') {\n\t\t\t$searchSql = \" AND (LOWER({$prefix}last_name) LIKE LOWER(?) OR LOWER($first_last) LIKE LOWER(?) OR LOWER($first_middle_last) LIKE LOWER(?) OR LOWER($last_comma_first) LIKE LOWER(?) OR LOWER($last_comma_first_middle) LIKE LOWER(?))\";\n\t\t\t$search = '%' . $search . '%';\n\t\t} else { // $searchMatch === 'startsWith'\n\t\t\t$searchSql = \" AND (LOWER({$prefix}last_name) LIKE LOWER(?) OR LOWER($first_last) LIKE LOWER(?) OR LOWER($first_middle_last) LIKE LOWER(?) OR LOWER($last_comma_first) LIKE LOWER(?) OR LOWER($last_comma_first_middle) LIKE LOWER(?))\";\n\t\t\t$search = $search . '%';\n\t\t}\n\t\t$params[] = $params[] = $params[] = $params[] = $params[] = $search;\n\t\treturn $searchSql;\n\t}", "function _generateUserNameSearchSQL($search, $searchMatch, $prefix, &$params) {\n\t\t$first_last = $this->concat($prefix.'first_name', '\\' \\'', $prefix.'last_name');\n\t\t$first_middle_last = $this->concat($prefix.'first_name', '\\' \\'', $prefix.'middle_name', '\\' \\'', $prefix.'last_name');\n\t\t$last_comma_first = $this->concat($prefix.'last_name', '\\', \\'', $prefix.'first_name');\n\t\t$last_comma_first_middle = $this->concat($prefix.'last_name', '\\', \\'', $prefix.'first_name', '\\' \\'', $prefix.'middle_name');\n\t\tif ($searchMatch === 'is') {\n\t\t\t$searchSql = \" AND (LOWER({$prefix}last_name) = LOWER(?) OR LOWER($first_last) = LOWER(?) OR LOWER($first_middle_last) = LOWER(?) OR LOWER($last_comma_first) = LOWER(?) OR LOWER($last_comma_first_middle) = LOWER(?))\";\n\t\t} elseif ($searchMatch === 'contains') {\n\t\t\t$searchSql = \" AND (LOWER({$prefix}last_name) LIKE LOWER(?) OR LOWER($first_last) LIKE LOWER(?) OR LOWER($first_middle_last) LIKE LOWER(?) OR LOWER($last_comma_first) LIKE LOWER(?) OR LOWER($last_comma_first_middle) LIKE LOWER(?))\";\n\t\t\t$search = '%' . $search . '%';\n\t\t} else { // $searchMatch === 'startsWith'\n\t\t\t$searchSql = \" AND (LOWER({$prefix}last_name) LIKE LOWER(?) OR LOWER($first_last) LIKE LOWER(?) OR LOWER($first_middle_last) LIKE LOWER(?) OR LOWER($last_comma_first) LIKE LOWER(?) OR LOWER($last_comma_first_middle) LIKE LOWER(?))\";\n\t\t\t$search = $search . '%';\n\t\t}\n\t\t$params[] = $params[] = $params[] = $params[] = $params[] = $search;\n\t\treturn $searchSql;\n\t}", "function ml_wpsearch_search_query($query, $params)\n{\n $driver = DriverRegistry::getInstance()->get('marklogic');\n $new_query = $query;\n\n if (is_string($query))\n {\n $new_query = trim($query);\n if (!$new_query)\n {\n return null;\n }\n $searchExcludeArr = explode(PHP_EOL, $options['search_exclude']);\n\n foreach ($searchExcludeArr as $searchExclude) {\n\n $exitLoop = false;\n\n if (preg_match('/(\\w+)\\s(.+)\\s({?{?.+}?}?)/', $searchExclude, $matches)) {\n\n $elem = $matches[1];\n $oper = $matches[2];\n $value = $matches[3];\n\n if (preg_match('/^{{(\\w+)}}?/', $value, $specialMatches)) {\n\n switch($specialMatches[1]) {\n case 'today':\n $value = '\"' . date(\"Y-m-d\\TH:i:s+00:00\") . '\"';\n break;\n default:\n $exitLoop = true;\n break;\n }\n }\n\n if ($exitLoop)\n break;\n\n switch(ord($oper)) {\n case 61:\n $oper = \":\";\n break;\n case 62:\n $oper = \"GT\";\n break;\n case 38:\n $oper = \"LT\";\n break;\n default:\n break;\n }\n\n $new_query .= \" AND -{$elem} {$oper} {$value}\";\n\n }\n }\n }\n elseif (is_array($query))\n {\n if (!$query)\n {\n return null;\n }\n $new_query = wp_json_encode($query);\n }\n\n $options = Options::getOptions();\n\n // Provides way for changing search query and parameters.\n $new_params = apply_filters('ml_wpsearch_search_query_params', wp_parse_args($params, array(\n 'start' => 1,\n 'pageLength' => 10,\n 'view' => 'all',\n 'options' => $options['rest_config_option'],\n 'transform' => $options['rest_transform'],\n )));\n\n $new_query = apply_filters('ml_wpsearch_search_query_value', $new_query, $params);\n\n $results = $driver->search(stripslashes(sanitize_text_field($new_query)), $new_params, is_array($query)); // Assume structured query for arrays.\n\n return $results;\n}", "function makeSearch($searchMode, $searchForWords, $inColumns)\n\n\t\t{\n\n\t\t\tif (!is_array($searchForWords))\n\n\t\t\t{\n\n\t\t\t\tif ($searchMode == EXACT_PHRASE) $searchForWords = array($searchForWords);\n\n\t\t\t\telse $searchForWords = preg_split(\"/\\s+/\", $searchForWords, -1, PREG_SPLIT_NO_EMPTY);\n\n\t\t\t}\n\n\t\t\telseif ($searchMode == EXACT_PHRASE && count($searchForWords) > 1)\n\n\t\t\t\t$searchForWords = array(implode(' ', $searchForWords));\n\n\t\t\tif (!is_array($inColumns))\n\n\t\t\t\t$inColumns = preg_split(\"/[\\s,]+/\", $inColumns, -1, PREG_SPLIT_NO_EMPTY);\n\n\t\t\t$where = '';\n\n\t\t\tforeach ($searchForWords as $searchForWord)\n\n\t\t\t{\n\n\t\t\t\tif (strlen($where)) $where .= ($searchMode == ALL_WORDS) ? ' AND ' : ' OR ';\n\n\t\t\t\t$sub = '';\n\n\t\t\t\tforeach ($inColumns as $inColumn)\n\n\t\t\t\t{\n\n\t\t\t\t\tif (strlen($sub)) $sub .= ' OR ';\n\n\t\t\t\t\t$sub .= \"$inColumn LIKE '%\" . $searchForWord . \"%'\"; //!! escaping?\n\n\t\t\t\t}\n\n\t\t\t\t$where .= \"($sub)\";\n\n\t\t\t}\n\n\t\t\treturn $where;\n\n\t\t}", "public function buildQuery(): string {\n if ($this->queryHasOption || strlen($this->finalQueryString) > 0) {\n throw new \\Exception('You can only use this instance of ODataQueryBuilder for a single query! Please create a new builder for a new query.', 500);\n }\n\n $this->appendServiceUrlToQuery();\n $this->appendEntitySetsToQuery();\n $this->appendFiltersToQuery();\n $this->appendSearchToQuery();\n $this->appendSelectsToQuery();\n $this->appendExpandsToQuery();\n $this->appendOrderByToQuery();\n $this->appendSkipToQuery();\n $this->appendTopToQuery();\n $this->appendCountToQuery();\n\n //remove the ? if the query has no query options.\n if (!$this->queryHasOption) {\n $this->finalQueryString = substr($this->finalQueryString, 0, -1);\n }\n\n return $this->finalQueryString;\n }", "public function getSearchLabelQuery()\n\t{\n\t\t$query = (new Db\\Query())->select(['csl.crmid', 'csl.setype', 'csl.searchlabel'])\n\t\t\t->from('u_#__crmentity_search_label csl')->innerJoin('vtiger_tab', 'csl.setype = vtiger_tab.name');\n\t\t$where = ['and', ['vtiger_tab.presence' => 0]];\n\t\tif ($this->moduleName) {\n\t\t\t$where[] = ['csl.setype' => $this->moduleName];\n\t\t\tif (\\is_string($this->moduleName) && isset($this->moduleConditions[$this->moduleName])) {\n\t\t\t\t$where[] = $this->moduleConditions[$this->moduleName]['where'];\n\t\t\t\tif (isset($this->moduleConditions[$this->moduleName]['innerJoin'])) {\n\t\t\t\t\tforeach ($this->moduleConditions[$this->moduleName]['innerJoin'] as $table => $on) {\n\t\t\t\t\t\t$query->innerJoin($table, $on);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} elseif ($this->entityName) {\n\t\t\t$where[] = ['vtiger_entityname.turn_off' => 1];\n\t\t\t$query->innerJoin('vtiger_entityname', 'csl.setype = vtiger_entityname.modulename');\n\t\t\tif (2 === \\App\\Config::search('GLOBAL_SEARCH_SORTING_RESULTS')) {\n\t\t\t\t$query->orderBy('vtiger_entityname.sequence');\n\t\t\t}\n\t\t}\n\t\tif ($this->checkPermissions) {\n\t\t\t$where[] = ['like', 'csl.userid', \",$this->userId,\"];\n\t\t}\n\t\tswitch ($this->operator) {\n\t\t\tcase 'Begin':\n\t\t\t\t$where[] = ['like', 'csl.searchlabel', \"$this->searchValue%\", false];\n\t\t\t\tbreak;\n\t\t\tcase 'End':\n\t\t\t\t$where[] = ['like', 'csl.searchlabel', \"%$this->searchValue\", false];\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\tcase 'Contain':\n\t\t\t\tif (false !== strpos($this->searchValue, '*') || false !== strpos($this->searchValue, '_')) {\n\t\t\t\t\t$where[] = ['like', 'csl.searchlabel', str_replace('*', '%', \"%{$this->searchValue}%\"), false];\n\t\t\t\t} else {\n\t\t\t\t\t$where[] = ['like', 'csl.searchlabel', $this->searchValue];\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'FulltextBegin':\n\t\t\t\t$query->addSelect(['matcher' => new \\yii\\db\\Expression('MATCH(csl.searchlabel) AGAINST(:searchValue IN BOOLEAN MODE)', [':searchValue' => $this->searchValue . '*'])]);\n\t\t\t\t$query->andWhere('MATCH(csl.searchlabel) AGAINST(:findvalue IN BOOLEAN MODE)', [':findvalue' => $this->searchValue . '*']);\n\t\t\t\t$query->addOrderBy(['matcher' => \\SORT_DESC]);\n\t\t\t\tbreak;\n\t\t\tcase 'FulltextWord':\n\t\t\t\t$query->addSelect(['matcher' => new \\yii\\db\\Expression('MATCH(csl.searchlabel) AGAINST(:searchValue IN BOOLEAN MODE)', [':searchValue' => $this->searchValue])]);\n\t\t\t\t$query->andWhere('MATCH(csl.searchlabel) AGAINST(:findvalue IN BOOLEAN MODE)', [':findvalue' => $this->searchValue]);\n\t\t\t\t$query->addOrderBy(['matcher' => \\SORT_DESC]);\n\t\t\t\tbreak;\n\t\t}\n\t\treturn $query->andWhere($where);\n\t}", "public function buildConditionQuery()\n\t\t\t{\n\t\t\t\t$this->sql_condition = ' user_id='.$this->CFG['user']['user_id'];\n\t\t\t}", "public function composeQuery()\n {\n $this->initQueryBody();\n if ($this->selectedFields) {\n array_set($this->queryBody, 'body._source', $this->selectedFields);\n $this->clearSelect();\n }\n if ($this->range) {\n $filter = array_get($this->queryBody, 'body.query.bool.filter');\n array_push($filter, $this->range);\n array_set($this->queryBody, 'body.query.bool.filter', $filter);\n\n }\n if ($this->terms) {\n foreach($this->terms as $condition => $conditionTerms) {\n $$condition = array_get($this->queryBody, \"body.query.bool.{$condition}\");\n $$condition = $$condition ?: [];\n foreach ($conditionTerms as $key => $value) {\n array_push($$condition, [\"term\" => [$key => $value]]);\n }\n array_set($this->queryBody, \"body.query.bool.{$condition}\", $$condition);\n }\n\n }\n if ($this->from) {\n array_set($this->queryBody, 'body.from', $this->from);\n }\n if ($this->size) {\n array_set($this->queryBody, 'body.size', $this->size);\n }\n if ($this->scrollSize) {\n array_set($this->queryBody, 'size', $this->scrollSize);\n }\n if ($this->scrollKeepTime) {\n array_set($this->queryBody, 'scroll', $this->scrollKeepTime);\n }\n if ($this->orders) {\n $orders = [];\n foreach($this->orders as $field => $value) {\n array_push($orders, [$field => [\"order\" => $value]]);\n }\n array_set($this->queryBody, 'body.sort', $orders);\n }\n }" ]
[ "0.74196637", "0.6953522", "0.68177515", "0.6811757", "0.6518597", "0.6490689", "0.6482609", "0.6451351", "0.63954353", "0.634606", "0.6340951", "0.6337514", "0.6307438", "0.63000625", "0.6275611", "0.6269626", "0.6259222", "0.6202787", "0.6153899", "0.6136232", "0.6122621", "0.61073196", "0.6105876", "0.6094835", "0.6080425", "0.60737365", "0.6072913", "0.6068379", "0.60608673", "0.60472983", "0.60468745", "0.6038513", "0.60305995", "0.59864664", "0.5948292", "0.5940567", "0.5937807", "0.5935309", "0.5914608", "0.5903908", "0.5900312", "0.58913535", "0.58857155", "0.5857118", "0.5855365", "0.5853244", "0.5842988", "0.5837485", "0.5831816", "0.5830585", "0.5828954", "0.58254004", "0.5821915", "0.58088887", "0.57920456", "0.5770548", "0.57658654", "0.5751737", "0.57514226", "0.5747914", "0.57395244", "0.5739282", "0.5737238", "0.5723431", "0.57077456", "0.57049215", "0.56931204", "0.56931204", "0.56931204", "0.56931204", "0.56851625", "0.5677938", "0.5670948", "0.5669432", "0.5662584", "0.56609374", "0.56595165", "0.5654216", "0.5654068", "0.56493145", "0.56322503", "0.5623178", "0.5620731", "0.5614081", "0.5614081", "0.5608489", "0.5602974", "0.55895734", "0.5583681", "0.5581427", "0.5580976", "0.5580962", "0.5571169", "0.55619705", "0.55619705", "0.5560606", "0.55535245", "0.55504686", "0.55459845", "0.5540135", "0.5539605" ]
0.0
-1
wait/sleep for $time seconds The $time value will be used as a timer for the loop so that it keeps running until the timeout triggers. This implies that if you pass a really small (or negative) value, it will still start a timer and will thus trigger at the earliest possible time in the future.
function sleep($time, LoopInterface $loop) { await(Timer\resolve($time, $loop), $loop); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function waitTime($time_Second=1){\n\t\tusleep($time_Second*1000000);\n\t}", "public function setSleepTime($time) {\n $this->sleepTime = $time;\n }", "function sleep(float|int $timeout): void\n {\n signal(fn (Closure $resume) => Timer::after(fn (): mixed => $resume(), (int) $timeout * 1000));\n }", "public function amWaiting($time = 1)\n {\n if (method_exists($this, 'wait')) {\n $this->wait($time);\n }\n }", "function delayTime($seconds) {\n\t$nano = time_nanosleep($seconds, 500000000);\n\n\tif ($nano === true) {\n\t\techo \"Slept for $seconds seconds, 0.5 microseconds.\\n\";\n\t} elseif ($nano === false) {\n\t\techo \"Sleeping failed.\\n\";\n\t} elseif (is_array($nano)) {\n\t\t$seconds = $nano['seconds'];\n\t\t$nanoseconds = $nano['nanoseconds'];\n\t\techo \"Interrupted by a signal.\\n\";\n\t\techo \"Time remaining: $seconds seconds, $nanoseconds nanoseconds.\";\n\t}\n}", "protected function waitUntilNextMillisecond($time)\n {\n $current = $time;\n\n while ($current < $time) {\n $current = $this->timestamp();\n }\n\n return $current;\n }", "public function iWaitForSeconds($seconds) {\n sleep($seconds);\n }", "public function iWaitForSeconds($arg1) {\n sleep($arg1);\n }", "public function timeout($timesecs);", "public function setTimeout($second, $milisecond = 0);", "public function sleep($seconds)\n {\n if ($seconds < 1) {\n usleep($seconds * 1000000);\n } else {\n sleep($seconds);\n }\n }", "public function sleep($seconds)\n {\n $this->checkLimits();\n parent::sleep($seconds);\n }", "public function sleep($seconds)\n {\n if ($seconds < 1) {\n usleep((int) $seconds * 1000000);\n } else {\n sleep((int) $seconds);\n }\n }", "function wait_for_change($time_min){\n\techo \"Waiting for $time_min minutes.\";\n\twhile(true){\n\t\tsleep(60);\n\t\t$time_min--;\n\t\tif($time_min == 0)\n\t\t\tbreak;\n\t\techo \".\";\n\t}\t\t\n\techo \"\\n\";\n}", "public function shouldWaitForProcessingTime(\\GalacticBot\\Time $time)\n\t{\n\t\treturn false;\n\t}", "public static function sleep();", "public function iPauseForSeconds($num_seconds)\n {\n sleep($num_seconds);\n }", "public function sleep();", "public function waitWithBackoff()\n {\n $waitTime = $this->calculateSleepTime();\n if ($waitTime > 1000000) {\n sleep((int) ($waitTime / 1000000));\n } else {\n usleep($waitTime);\n }\n }", "public function iSleepSeconds($seconds)\n {\n usleep($seconds*1000000);\n }", "function delay(float|int $timeout): void\n {\n signal(fn (Closure $resume) => after($resume, (int) $timeout * 1000));\n }", "public function sleep($seconds)\n {\n $this->raiseSleepingEvent($seconds);\n sleep($seconds);\n }", "public function iWait() {\n sleep(3);\n }", "public function sleep($seconds)\n {\n sleep($seconds);\n }", "private function _stepTimeout():void\n\t{\n\t\tif( $this->_timeout_queue[0]['call_at'] <= microtime( true ) )\n\t\t{\n\t\t\t[ 'task'=>$task, ]= array_shift( $this->_timeout_queue );\n\t\t\t\n\t\t\t$this->_runTask( $task );\n\t\t}\n\t\telse\n\t\t\tusleep( 1000 );\n\t}", "public function wait(int $timeout = 0) : bool{}", "public function sleep_time($number = \"\")\n\t{\n\t\tif (empty($number) || $number == \"?\")\n\t\t{\n\t\t\treturn $this->CLI->stringQuery($this->SqueezePlyrID.\" sleep ?\");\n\t\t}\n\t\treturn $this->CLI->pingQuery($this->SqueezePlyrID.\" sleep \".((string) $number));\n\t}", "public function wait($wait = -1) {}", "protected function sleep(): void\n\t{\n\t\tusleep(static::SLEEP_TIME);\n\t}", "protected function sleep(float $seconds): void\n {\n usleep($seconds * 1000000);\n }", "public function wait($name, $delay = 30);", "public function waitForSeconds($secs)\n {\n sleep($secs);\n return;\n }", "public function wait($timeout=null)\n {\n $delta = time();\n if ($timeout == null)\n $timeout = 60 * 2; // two minutes\n if (!($this->check(\"state\", \"started\")))\n Throw new \\CatapultApiException(\"Call already in non 'started' state'\");\n while (true) {\n if (!($this->check(\"state\", \"started\")))\n break;\n if ((time() - $delta) > $timeout)\n break;\n }\n }", "public function delay($time)\n {\n if (Event::fire(Event::JOB_DELAY, array($this, $time)) === false) {\n return false;\n }\n\n if(!$this->ensureUniqueness(false)) return false;\n\n if(method_exists($this->class, 'onQueue')) {\n $instance = $this->getInstance();\n if(!$instance->onQueue($this)) {\n return false;\n }\n }\n\n\n $this->redis->sadd(Queue::redisKey(), $this->queue);\n $status = $this->redis->zadd(Queue::redisKey($this->queue, 'delayed'), $time, $this->payload);\n\n if ($status < 1) {\n return false;\n }\n\n $this->setStatus(self::STATUS_DELAYED);\n $this->redis->hset(self::redisKey($this), 'delayed', $time);\n\n Stats::incr('delayed', 1);\n Stats::incr('delayed', 1, Queue::redisKey($this->queue, 'stats'));\n\n Event::fire(Event::JOB_DELAYED, array($this, $time));\n\n return true;\n }", "public function sleep() {}", "public static function Sleep($ms) {\n\t\t\\usleep($ms * 1000.0);\n\t}", "public function __sleep();", "final protected function sleep($duration)\n {\n $this->stillWorking();\n\n while($duration > 0) {\n sleep(min($duration, 60));\n $duration -= 60;\n $this->stillWorking();\n }\n }", "protected function sleep(float $seconds)\n {\n $secs = (int) $seconds;\n // the fraction part of the $seconds will always be less than 1 sec, extracting micro seconds\n $microSecs = (int) (($seconds - $secs) * 1000000);\n sleep($secs);\n usleep($microSecs);\n }", "public function setTime($time=0){\n\t\t\t$this->_time = $time;\n\t\t}", "private function __sleep() {}", "private function __sleep() {}", "private function __sleep() {}", "private function __sleep() {}", "public function withTimeout(int $seconds): void\n {\n $this->loopTimeoutSeconds = $seconds;\n }", "public function __sleep ();", "abstract public function sleep(Strand $strand, float $seconds);", "function sleep_20000_micro() {\n tusleep(20000);\n}", "function sleep_10000_micro() {\n tusleep(10000);\n}", "protected function waitFor($permits, $timeout) {\n $time= $this->clock->time();\n $slot= (int)$time;\n\n // If next slot is in the future, wait\n if ($this->next > $slot) {\n $sleep= $this->next - $time;\n if (null !== $timeout && $sleep > $timeout) return self::TIMED_OUT;\n\n $this->clock->wait($sleep + self::ONE_MICRO);\n $time= $this->clock->time();\n $slot= (int)$time;\n $this->next= null;\n } else {\n $sleep= 0.0;\n }\n\n // If next has passed in the meantime, reset counts\n if ($slot > $this->next) {\n $this->reset= $time + $this->rate->unit()->seconds();\n $this->permits= 0;\n $this->next= $slot;\n }\n\n $this->permits+= $permits;\n\n // If we reached (or exceeded) the rate, set next slot to the future\n $exceed= $this->permits - $this->rate->value();\n if (0 === $exceed) {\n $this->next= $time + $this->rate->unit()->seconds();\n } else if ($exceed > 0) {\n $slots= $exceed / $this->rate->value() + 1;\n $this->next= $time + $slots * $this->rate->unit()->seconds();\n }\n\n return $sleep;\n }", "public function sleep()\n {\n }", "protected function _waitAudioReinvite()\n {\n $this->_timer->reset();\n $this->_timer->setOptions( array( Streamwide_Engine_Timer_Timeout::OPT_DELAY => 1 ) );\n $this->_timer->addEventListener(\n Streamwide_Engine_Events_Event::TIMEOUT,\n array(\n 'callback' => array( $this, 'onAudioReinviteTimeout' ),\n 'options' => array( 'autoRemove' => 'before' )\n )\n );\n $this->_timer->arm();\n }", "public function timeout($ms);", "public function timeout();", "public function setTime($time);", "function sleep_50000_micro() {\n tusleep(50000);\n}", "private function waitForUnlocking()\n\t{\n\t\t$times = self::LOCK_TTL;\n\t\t$i = 0;\n\t\twhile ($this->isExecutionLocked() && $i < $times)\n\t\t{\n\t\t\tsleep(1);\n\t\t\t$i++;\n\t\t}\n\t}", "private function wait(int $minutes) {\n echo \"waiting $minutes minute(s) ...\\n\";\n }", "public function iWaitSecondsBeforeContinue($seconds)\n {\n #$this->getSession()->wait($seconds);\n sleep($seconds);\n }", "function retry($times, callable $callback, $sleep = 0)\n {\n $times--;\n beginning:\n try {\n return $callback();\n } catch (Exception $e) {\n if (!$times) {\n throw $e;\n }\n $times--;\n if ($sleep) {\n usleep($sleep * 1000);\n }\n goto beginning;\n }\n }", "public function sleepTime(int $sleepTime): ParallelInterface;", "protected function sleep(){\n flush();\n $s = ($this->throttleTime == 1) ? '' : 's';\n $this->log(\"Request was throttled, Sleeping for \".$this->throttleTime.\" second$s\",'Throttle');\n sleep($this->throttleTime);\n }", "public function setTimeout($timeout);", "final public function set_idle_time($time)\n {\n $this->_idle_time = $time;\n }", "public function iWaitSecondsForElement($count, $element): void\n {\n $found = false;\n $startTime = \\time();\n $e = null;\n\n do {\n try {\n \\usleep(1000);\n $node = $this->getSession()->getPage()->findAll('css', $element);\n $this->assertCount(1, $node);\n $found = true;\n } catch (ExpectationException $e) {\n /* Intentionally leave blank */\n }\n } while (!$found && (\\time() - $startTime < $count));\n\n if ($found === false) {\n $message = \"The element '$element' was not found after a $count seconds timeout\";\n throw new ResponseTextException($message, $this->getSession()->getDriver(), $e);\n }\n }", "public function set_time($time) {\n if (!is_integer($time)) { return false; }\n $this->_time = $time;\n return true;\n }", "public function iWaitForElement($element): void\n {\n $this->iWaitSecondsForElement($this->timeout, $element);\n }", "#[@test, @limit(time= 0.010)]\n public function timeouts() {\n $start= gettimeofday();\n $end= (1000000 * $start['sec']) + $start['usec'] + 1000 * 50; // 0.05 seconds\n do {\n $now= gettimeofday();\n } while ((1000000 * $now['sec']) + $now['usec'] < $end);\n }", "public static function timing($stats, $time) {\n\t\tStatsD::updateStats($stats, $time, 1, 'ms');\n\t}", "public function getNextRunTime($time = null) {\n if ($time === null) {\n if ($this->lastRunTime) {\n $time = $this->lastRunTime;\n } else {\n $time = time();\n }\n }\n\n $second = date('s', $time);\n $minute = date('i', $time);\n $hour = date('G', $time);\n $day = date('j', $time);\n $month = date('n', $time);\n $year = date('Y', $time);\n $dayOfWeek = date('w', $time);\n\n if ($this->second == self::ASTERIX && $this->minute == self::ASTERIX && $this->hour == self::ASTERIX && $this->day == self::ASTERIX && $this->month == self::ASTERIX && $this->dayOfWeek == self::ASTERIX) {\n $this->addSecond($second, $minute, $hour, $day, $month, $year);\n return mktime($hour, $minute, $second, $month, $day, $year);\n }\n\n $newMinute = $minute;\n $newHour = $hour;\n $newDay = $day;\n $newMonth = $month;\n $newYear = $year;\n $changed = false;\n\n $newSecond = $this->getNextRunIntervalValue($this->second, $second, null, false);\n if ($newSecond === null) {\n $newSecond = $second;\n $this->addSecond($newSecond, $newMinute, $newHour, $newDay, $newMonth, $newYear);\n }\n\n if ($newSecond != $second) {\n $changed = true;\n }\n\n $tmpMinute = $newMinute;\n if ($second < $newSecond) {\n $newMinute = $this->getNextRunIntervalValue($this->minute, $newMinute, $newMinute, true);\n } else {\n $newMinute = $this->getNextRunIntervalValue($this->minute, $newMinute, null, false);\n }\n if ($newMinute === null) {\n $newMinute = $tmpMinute;\n if ($newMinute == $minute) {\n $this->addMinute($newMinute, $newHour, $newDay, $newMonth, $newYear);\n }\n }\n\n if ($newMinute != $minute) {\n $changed = true;\n $newSecond = $this->getFirstRunIntervalValue($this->second, 0);\n }\n\n $tmpHour = $newHour;\n if ($newMinute < $minute || ($newMinute == $minute && $newSecond <= $second)) {\n $newHour = $this->getNextRunIntervalValue($this->hour, $newHour, null, false);\n } else {\n $newHour = $this->getNextRunIntervalValue($this->hour, $newHour, $newHour, true);\n }\n if ($newHour === null) {\n $newHour = $tmpHour;\n if ($newHour == $hour) {\n $this->addHour($newHour, $newDay, $newMonth, $newYear);\n }\n }\n\n if ($newHour != $hour) {\n $changed = true;\n $newSecond = $this->getFirstRunIntervalValue($this->second, 0);\n $newMinute = $this->getFirstRunIntervalValue($this->minute, 0);\n }\n\n $tmpDay = $newDay;\n if ($newHour < $hour || ($newHour == $hour && ($newMinute < $minute || ($newMinute == $minute && $newSecond <= $second)))) {\n $newDay = $this->getNextRunIntervalValue($this->day, $newDay, null, false);\n } else {\n $newDay = $this->getNextRunIntervalValue($this->day, $newDay, $newDay, true);\n }\n if ($newDay === null) {\n $newDay = $tmpDay;\n if ($newDay == $day) {\n $this->addDay($newDay, $newMonth, $newYear);\n }\n }\n\n if ($newDay != $day) {\n $changed = true;\n $newSecond = $this->getFirstRunIntervalValue($this->second, 0);\n $newMinute = $this->getFirstRunIntervalValue($this->minute, 0);\n $newHour = $this->getFirstRunIntervalValue($this->hour, 0);\n }\n\n $tmpMonth = $newMonth;\n if ($newDay < $day || ($newDay == $day && ($newHour < $hour || ($newHour == $hour && ($newMinute < $minute || ($newMinute == $minute && $newSecond <= $second)))))) {\n $newMonth = $this->getNextRunIntervalValue($this->month, $newMonth, null, false);\n } else {\n $newMonth = $this->getNextRunIntervalValue($this->month, $newMonth, $newMonth, true);\n }\n if ($newMonth == null) {\n $newMonth = $tmpMonth;\n if ($newMonth == $month) {\n $this->addMonth($newMonth, $newYear);\n }\n }\n\n if ($newMonth != $month) {\n $newSecond = $this->getFirstRunIntervalValue($this->second, 0);\n $newMinute = $this->getFirstRunIntervalValue($this->minute, 0);\n $newHour = $this->getFirstRunIntervalValue($this->hour, 0);\n $newDay = $this->getFirstRunIntervalValue($this->day, 1);\n }\n\n $nextRunTime = mktime($newHour, $newMinute, $newSecond, $newMonth, $newDay, $newYear);\n\n if ($this->dayOfWeek != self::ASTERIX && !isset($this->dayOfWeek[date('w', $nextRunTime)])) {\n $nextRunTime = DateTime::roundTimeToDay($nextRunTime) + DateTime::DAY - 1;\n return $this->getNextRunTime($nextRunTime);\n }\n\n return $nextRunTime;\n }", "function setStartTime($event, $time) {\n Timer::timers($event, array(\n 'start' => $time,\n 'stopped' => false\n ));\n }", "protected function delay()\n {\n sleep($this->transactionRestartDelay);\n }", "public function setTimeout(float $timeout): void\n {\n }", "protected function delay()\n {\n if (!isset($this->headers['x-rate-limit-reset'])) {\n exit('Rate limited, but no rate limit header found');\n }\n\n $delay = $this->headers['x-rate-limit-reset'] - time();\n\n if ($delay < 10) {\n $delay = 60 * 15; // 15 minute delay if the given delay seems unreasonably small (can be due to server time differences)\n }\n \n print \"\\n\";\n\n do {\n print \"\\r\\e[K\";\n printf('Sleeping for %d seconds', $delay--);\n sleep(1);\n } while ($delay);\n }", "public function setStepTime(int $time)\n {\n $this->stepTime = $time;\n }", "public function __sleep() {}", "public function setTimeout(int $timeout): void {}", "public function __sleep() {}", "public function __sleep() {}", "public function __sleep() {}", "public function __sleep() {}", "public function __sleep() {}", "public function __sleep() {}", "public function __sleep() {}", "public function __sleep() {}", "public function __sleep() {}", "public function __sleep() {}", "public function __sleep() {}", "public function __sleep() {}", "public function addTimer(float $timeout = -1): bool {}", "public function iWaitSecondsUntilISeeInTheElement($count, $text, $element): void\n {\n $startTime = time();\n $this->iWaitSecondsForElement($count, $element);\n\n $expected = str_replace('\\\\\"', '\"', $text);\n $message = \"The text '$expected' was not found after a $count seconds timeout\";\n\n $found = false;\n do {\n try {\n \\usleep(1000);\n $node = $this->getSession()->getPage()->find('css', $element);\n $this->assertContains($expected, $node->getText(), $message);\n\n return;\n } catch (ExpectationException) {\n /* Intentionally leave blank */\n } catch (StaleElementReference) {\n // assume page reloaded whilst we were still waiting\n }\n } while (!$found && (\\time() - $startTime < $count));\n\n // final assertion...\n $node = $this->getSession()->getPage()->find('css', $element);\n $this->assertContains($expected, $node->getText(), $message);\n }", "function __sleep()\n {\n }", "final public function __sleep() {}", "function __sleep(){\n\n\t\t}", "public function pause(Timer $timer);", "public function sleep($seconds)\n {\n return $this->chainWith(\n new \\CallbackFilterIterator($this->getIterator(),\n function () use ($seconds) {\n usleep($seconds * 1000000);\n\n return true;\n }));\n }", "public static function set_interval ($timeout, $callback) {\n $timeout = $timeout * 1000;\n while (true) {\n usleep($timeout);\n $callback();\n }\n }", "public function setTimeout(int $timeout): void;", "public function timeout($timeout);", "public function waitAndAllow($string,$timeOut=300)\n\t{\n\t\t$allow=$this->isLock($string);\n\t\tif($allow==1) {\n\t\t\t$this->getLock($string);\n\t\t\treturn $allow; }\n\t\telse{\n\t\t\tif($string) {\n\t\t\tset_time_limit(3600);\n\t\t\t$allow=0;\n\t\t\t$phase1_microSec=rand(100,200);\n\t\t\t$phase1_limit=rand(16000,17000);\n\t\t\tfor($i=0;$i<$phase1_limit;$i++){\n\t\t\t\t$allow=$this->isLock($string);\n\t\t\t\tif($allow==1){ $this->getLock($string,$timeOut);\n\t\t\t\t\treturn $allow;}\n\t\t\t\telse usleep($phase1_microSec);}\n\t\t\t$phase2_microSec=rand(10,50);\n\t\t\t$phase2_limit=rand(12000,13000);\n\t\t\tfor($i=0;$i<$phase2_limit;$i++){\n\t\t\t\t$allow=$this->isLock($string);\n\t\t\t\tif($allow==1){ $this->getLock($string,$timeOut);\n\t\t\t\t\treturn $allow;}\n\t\t\t\telse usleep($phase2_microSec);}\n\t\t\t$phase3_microSec=rand(1,10);\n\t\t\t$phase3_limit=rand(10000,11000);\n\t\t\tfor($i=0;$i<$phase3_limit;$i++){\n\t\t\t\t$allow=$this->isLock($string);\n\t\t\t\tif($allow==1){ $this->getLock($string,$timeOut);\n\t\t\t\treturn $allow;}\n\t\t\t\telse usleep($phase3_microSec);}\n\t\t\t}\n\t\t\telse\n\t\t\t\techo \"No String passed to check lock status\";\n\t\t}\n\t\treturn $allow;\n\t}" ]
[ "0.7172272", "0.6747571", "0.64765024", "0.6425168", "0.6327161", "0.63218033", "0.6133108", "0.60629874", "0.6023208", "0.59541845", "0.5923837", "0.5878564", "0.5868508", "0.58684343", "0.5831696", "0.5830075", "0.5767976", "0.57528687", "0.57438976", "0.5704672", "0.56479275", "0.5641064", "0.56307673", "0.56187576", "0.55725473", "0.55614305", "0.55262196", "0.552117", "0.5505286", "0.54270744", "0.5426461", "0.5422556", "0.5409247", "0.5408766", "0.53984976", "0.5394359", "0.53086156", "0.526285", "0.5224784", "0.5224166", "0.5195261", "0.5195261", "0.5195261", "0.5195261", "0.518496", "0.5160899", "0.515374", "0.50918627", "0.5085744", "0.5063363", "0.5006275", "0.4984407", "0.49841553", "0.49760962", "0.49759358", "0.49743667", "0.49718526", "0.49695498", "0.49607295", "0.49562687", "0.49528825", "0.49527806", "0.49490887", "0.4948289", "0.49211943", "0.49198696", "0.49153048", "0.49077445", "0.48932466", "0.48845577", "0.48825857", "0.48799363", "0.48755163", "0.48608664", "0.48525915", "0.48270833", "0.48262787", "0.48252302", "0.48252302", "0.48252302", "0.48252302", "0.48252302", "0.48252302", "0.48252302", "0.48252302", "0.4824277", "0.4824277", "0.4824277", "0.48237306", "0.48203513", "0.48086038", "0.4799996", "0.47892722", "0.4771999", "0.47607303", "0.47354347", "0.47255197", "0.47151348", "0.47109845", "0.47065806" ]
0.7398309
0
block waiting for the given $promise to resolve Once the promise is resolved, this will return whatever the promise resolves to. Once the promise is rejected, this will throw whatever the promise rejected with. If the promise did not reject with an `Exception`, then this function will throw an `UnexpectedValueException` instead. If no $timeout is given and the promise stays pending, then this will potentially wait/block forever until the promise is settled. If a $timeout is given and the promise is still pending once the timeout triggers, this will cancel() the promise and throw a `TimeoutException`. This implies that if you pass a really small (or negative) value, it will still start a timer and will thus trigger at the earliest possible time in the future.
function await(PromiseInterface $promise, LoopInterface $loop, $timeout = null) { $wait = true; $resolved = null; $exception = null; $rejected = false; if ($timeout !== null) { $promise = Timer\timeout($promise, $timeout, $loop); } $promise->then( function ($c) use (&$resolved, &$wait, $loop) { $resolved = $c; $wait = false; $loop->stop(); }, function ($error) use (&$exception, &$rejected, &$wait, $loop) { $exception = $error; $rejected = true; $wait = false; $loop->stop(); } ); while ($wait) { $loop->run(); } if ($rejected) { if (!$exception instanceof \Exception) { $exception = new \UnexpectedValueException( 'Promise rejected with unexpected value of type ' . (is_object(($exception) ? get_class($exception) : gettype($exception))), 0, $exception instanceof \Throwable ? $exception : null ); } throw $exception; } return $resolved; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function wait(Promise $promise, Reactor $reactor = null) {\n $isWaiting = true;\n $resolvedError = null;\n $resolvedResult = null;\n\n $promise->when(function($error, $result) use (&$isWaiting, &$resolvedError, &$resolvedResult) {\n $isWaiting = false;\n $resolvedError = $error;\n $resolvedResult = $result;\n });\n\n $reactor = $reactor ?: getReactor();\n while ($isWaiting) {\n $reactor->tick();\n }\n\n if ($resolvedError) {\n throw $resolvedError;\n }\n\n return $resolvedResult;\n}", "public function testDelayedRejection() {\n $promise = new \\React\\Promise\\Deferred();\n \n $task = new \\Async\\Task\\PromiseTask($promise->promise());\n \n // The task should not yet be complete\n $this->assertFalse($task->isComplete());\n \n // Reject the promise\n $promise->reject(new \\Exception(\"rejected\"));\n \n // The task should be complete with an error\n $this->assertTrue($task->isComplete());\n $this->assertTrue($task->isFaulted());\n \n // The message of the task's exception should be that given to the promise\n $this->assertEquals(\"rejected\", $task->getException()->getMessage());\n }", "public function wait(\\GraphQL\\Executor\\Promise\\Promise $promise)\n {\n }", "public static function await($promise = null, $unwrap = false);", "protected function onWait(\\GraphQL\\Executor\\Promise\\Promise $promise)\n {\n }", "public function then(\\GraphQL\\Executor\\Promise\\Promise $promise, ?callable $onFulfilled = null, ?callable $onRejected = null);", "public function testDelayedResolution() {\n $promise = new \\React\\Promise\\Deferred();\n \n $task = new \\Async\\Task\\PromiseTask($promise->promise());\n \n // The task should not yet be complete\n $this->assertFalse($task->isComplete());\n \n // Resolve the promise\n $promise->resolve(\"resolved\");\n \n // The task should be complete with no error\n $this->assertTrue($task->isComplete());\n $this->assertFalse($task->isFaulted());\n \n // The result of the task should be the promise result\n $this->assertEquals(\"resolved\", $task->getResult());\n }", "public function await($timeout = null, TimeUnit $unit = null)\n {\n if ($microTimeout == null) {\n $this->sync->acquireSharedInterruptibly(1);\n } else {\n return $this->sync->tryAcquireSharedNanos(1, $unit->toMicros($timeout));\n }\n }", "public function wait($timeout = null)\r\n {\r\n $this->futureExitCode->wait($timeout);\r\n \r\n return $this;\r\n }", "public function promise(Promise $promise, $result = null);", "protected function beforeWait(\\GraphQL\\Executor\\Promise\\Promise $promise)\n {\n }", "function awaitAny(array $promises, LoopInterface $loop, $timeout = null)\n{\n try {\n // Promise\\any() does not cope with an empty input array, so reject this here\n if (!$promises) {\n throw new UnderflowException('Empty input array');\n }\n\n $ret = await(Promise\\any($promises)->then(null, function () {\n // rejects with an array of rejection reasons => reject with Exception instead\n throw new Exception('All promises rejected');\n }), $loop, $timeout);\n } catch (TimeoutException $e) {\n // the timeout fired\n // => try to cancel all promises (rejected ones will be ignored anyway)\n _cancelAllPromises($promises);\n\n throw $e;\n } catch (Exception $e) {\n // if the above throws, then ALL promises are already rejected\n // => try to cancel all promises (rejected ones will be ignored anyway)\n _cancelAllPromises($promises);\n\n throw new UnderflowException('No promise could resolve', 0, $e);\n }\n\n // if we reach this, then ANY of the given promises resolved\n // => try to cancel all promises (settled ones will be ignored anyway)\n _cancelAllPromises($promises);\n\n return $ret;\n}", "public function expect(int $timeout = null): self {\n\t\treturn $this->acquire($timeout);\n\t}", "protected static function isResolved(Promise $promise): bool\n {\n $resolved = false;\n $promise->onResolve(static function ($e, $res) use (&$resolved) {\n if ($e) {\n throw $e;\n }\n $resolved = true;\n });\n return $resolved;\n }", "public function promise(): ?PromiseInterface;", "public static function createResolve($promiseOrValue = null);", "final public function watchPromise(ExtendedPromiseInterface $promise)\n {\n $promise->done(null, function (\\Exception $exception) {\n $this->exceptionQueue->enqueue($exception);\n });\n }", "public static function createReject($promiseOrValue);", "function first(array $promises) {\n if (empty($promises)) {\n return new Failure(new \\LogicException(\n 'No promises or values provided for resolution'\n ));\n }\n\n $remaining = count($promises);\n $isComplete = false;\n $promisor = new Future;\n\n foreach ($promises as $resolvable) {\n if (!$resolvable instanceof Promise) {\n $promisor->succeed($resolvable);\n break;\n }\n\n $promise->when(function($error, $result) use (&$remaining, &$isComplete, $promisor) {\n if ($isComplete) {\n // we don't care about Futures that resolve after the first\n return;\n } elseif ($error && --$remaining === 0) {\n $promisor->fail(new \\RuntimeException(\n 'All promises failed'\n ));\n } elseif (empty($error)) {\n $isComplete = true;\n $promisor->succeed($result);\n }\n });\n }\n\n // We can return $promisor directly because the Future Promisor implementation\n // also implements Promise for convenience\n return $promisor;\n}", "protected function waitFor($permits, $timeout) {\n $time= $this->clock->time();\n $slot= (int)$time;\n\n // If next slot is in the future, wait\n if ($this->next > $slot) {\n $sleep= $this->next - $time;\n if (null !== $timeout && $sleep > $timeout) return self::TIMED_OUT;\n\n $this->clock->wait($sleep + self::ONE_MICRO);\n $time= $this->clock->time();\n $slot= (int)$time;\n $this->next= null;\n } else {\n $sleep= 0.0;\n }\n\n // If next has passed in the meantime, reset counts\n if ($slot > $this->next) {\n $this->reset= $time + $this->rate->unit()->seconds();\n $this->permits= 0;\n $this->next= $slot;\n }\n\n $this->permits+= $permits;\n\n // If we reached (or exceeded) the rate, set next slot to the future\n $exceed= $this->permits - $this->rate->value();\n if (0 === $exceed) {\n $this->next= $time + $this->rate->unit()->seconds();\n } else if ($exceed > 0) {\n $slots= $exceed / $this->rate->value() + 1;\n $this->next= $time + $slots * $this->rate->unit()->seconds();\n }\n\n return $sleep;\n }", "public function ping(): PromiseInterface\n {\n // TODO: Implement ping() method.\n }", "function some(array $promises) {\n if (empty($promises)) {\n return new Failure(new \\LogicException(\n 'No promises or values provided for resolution'\n ));\n }\n\n $errors = [];\n $results = [];\n $remaining = count($promises);\n $promisor = new Future;\n\n foreach ($promises as $key => $resolvable) {\n if (!$resolvable instanceof Promise) {\n $resolvable = new Success($resolvable);\n }\n\n $resolvable->when(function($error, $result) use (&$remaining, &$results, &$errors, $key, $promisor) {\n if ($error) {\n $errors[$key] = $error;\n } else {\n $results[$key] = $result;\n }\n\n if (--$remaining > 0) {\n return;\n } elseif (empty($results)) {\n $promisor->fail(new \\RuntimeException(\n 'All promises failed'\n ));\n } else {\n $promisor->succeed([$errors, $results]);\n }\n });\n }\n\n // We can return $promisor directly because the Future Promisor implementation\n // also implements Promise for convenience\n return $promisor;\n}", "public function wait(int $timeout = 0) : bool{}", "public function promise(): Deferred\\Promise {\n if (NULL === $this->_promise) {\n $this->_promise = new Deferred\\Promise($this);\n }\n return $this->_promise;\n }", "private function getPromise($value) : ?\\GraphQL\\Executor\\Promise\\Promise\n {\n }", "function sleep(float|int $timeout): void\n {\n signal(fn (Closure $resume) => Timer::after(fn (): mixed => $resume(), (int) $timeout * 1000));\n }", "public function testPreRejected() {\n $promise = \\React\\Promise\\When::reject(new \\Exception(\"rejected\"));\n \n $task = new \\Async\\Task\\PromiseTask($promise);\n \n // The task should be complete with an error\n $this->assertTrue($task->isComplete());\n $this->assertTrue($task->isFaulted());\n \n // The message of the task's exception should be that given to the promise\n $this->assertEquals(\"rejected\", $task->getException()->getMessage());\n }", "public function timeout() {\n\t\treturn null;\n\t}", "function awaitAll(array $promises, LoopInterface $loop, $timeout = null)\n{\n try {\n return await(Promise\\all($promises), $loop, $timeout);\n } catch (Exception $e) {\n // ANY of the given promises rejected or the timeout fired\n // => try to cancel all promises (rejected ones will be ignored anyway)\n _cancelAllPromises($promises);\n\n throw $e;\n }\n}", "public function wait($timeout=null)\n {\n $delta = time();\n if ($timeout == null)\n $timeout = 60 * 2; // two minutes\n if (!($this->check(\"state\", \"started\")))\n Throw new \\CatapultApiException(\"Call already in non 'started' state'\");\n while (true) {\n if (!($this->check(\"state\", \"started\")))\n break;\n if ((time() - $delta) > $timeout)\n break;\n }\n }", "public static function when(...$arguments): PromiseLike {\n $counter = count($arguments);\n if ($counter === 1) {\n $argument = $arguments[0];\n if ($argument instanceOf self) {\n return $argument->promise();\n }\n if ($argument instanceOf PromiseLike) {\n return $argument;\n }\n $defer = new Deferred();\n $defer->resolve($argument);\n return $defer->promise();\n }\n if ($counter > 0) {\n $master = new Deferred();\n $resolveArguments = [];\n foreach ($arguments as $index => $argument) {\n if ($argument instanceOf PromiseLike) {\n $argument\n ->done(\n static function (...$arguments) use ($master, $index, &$counter, &$resolveArguments) {\n $resolveArguments[$index] = $arguments;\n if (--$counter === 0) {\n ksort($resolveArguments);\n $master->resolve(...$resolveArguments);\n }\n }\n )\n ->fail(\n static function (...$arguments) use ($master) {\n $master->reject(...$arguments);\n }\n );\n } else {\n $resolveArguments[$index] = [$argument];\n if (--$counter === 0) {\n ksort($resolveArguments);\n $master->resolve(...$resolveArguments);\n }\n }\n }\n return $master->promise();\n }\n $defer = new Deferred();\n $defer->resolve();\n return $defer->promise();\n }", "public function timeout($timeout);", "public function wait($timeout = null)\r\n {\r\n if ($this->queueSlot) {\r\n $this->queueSlot->wait($timeout);\r\n }\r\n \r\n return $this;\r\n }", "function sleep($time, LoopInterface $loop)\n{\n await(Timer\\resolve($time, $loop), $loop);\n}", "public function setTimeout($timeout);", "public function shouldRejectWithoutCreatingGarbageCyclesIfCancellerWithReferenceThrowsException(): void\n {\n gc_collect_cycles();\n /** @var Promise<never> $promise */\n $promise = new Promise(function () {}, function () use (&$promise) {\n assert($promise instanceof Promise);\n throw new \\Exception('foo');\n });\n $promise->cancel();\n unset($promise);\n\n $this->assertSame(0, gc_collect_cycles());\n }", "function async(callable $function)\n{\n // return a new promise\n return new Promise(function (callable $resolve, callable $reject, callable $progress) use ($function) {\n // get the generator\n $generator = $function();\n\n // function to step the generator to the next yield statement\n $step = function () use (&$step, $generator, $resolve, $reject, $progress) {\n $value = null;\n\n // try to execute the next block of code\n try {\n $value = $generator->current();\n } catch (\\Exception $exception) {\n // exception rejects the promise\n $reject($exception);\n\n return;\n }\n\n // if the generator is complete, resolve the promise\n if (!$generator->valid()) {\n $resolve($value);\n\n return;\n }\n\n // wrap the value in a promise if it isn't already one\n if (!($value instanceof PromiseInterface)) {\n $value = new FulfilledPromise($value);\n }\n\n // run the next step when the current one resolves\n $value->then(function ($value) use (&$step, $generator) {\n $generator->send($value);\n $step();\n }, function (\\Exception $reason) use ($generator) {\n $generator->throw($reason);\n });\n };\n\n // run the first step in the next tick\n DefaultLoop::instance()->nextTick($step);\n });\n}", "public function waitFor($timeout, $callback)\n {\n if (!is_callable($callback)) {\n throw new \\InvalidArgumentException('Given callback is not a valid callable');\n }\n\n $start = microtime(true);\n $end = $start + $timeout / 1000.0;\n\n do {\n $result = call_user_func($callback, $this);\n\n if ($result) {\n break;\n }\n\n usleep(100000);\n } while (microtime(true) < $end);\n\n return $result;\n }", "public function timeout();", "public static function spin($callable, $timeout = 0, $delay = 100000)\n {\n if (!is_callable($callable)) {\n throw new InvalidArgumentException();\n }\n\n $closure = function () use ($callable, $timeout, $delay) {\n $timeout = (float) $timeout;\n $start = microtime(true);\n\n do {\n if ($result = $callable()) {\n return $result;\n }\n usleep($delay);\n $current = microtime(true);\n } while ($current - $start < $timeout);\n\n throw new TimeoutException(\"Timeout reached, execution aborted after {$timeout} second(s).\");\n };\n\n if (!function_exists('pcntl_signal')) {\n return $closure();\n }\n return static::run($closure, $timeout);\n }", "public function await(string $lastSeenId, int $timeout = 0): ?array;", "public static function isPromise($value, $strict = false);", "private function _acquire(int $timeout): void {\n\t\t$timer = new Timer();\n\t\t// Defaults to 0.5 seconds\n\t\t$sleep = $this->optionFloat('sleep_seconds', 0.5);\n\t\tif ($timeout > 0 && $timeout < $sleep) {\n\t\t\t$sleep = $timeout;\n\t\t}\n\t\t$sleep = intval($sleep * 1000000);\n\t\t$delete_attempt = false;\n\t\twhile (true) {\n\t\t\tif (!$delete_attempt) {\n\t\t\t\tself::deleteDeadProcesses($this->application);\n\t\t\t\t$delete_attempt = true;\n\t\t\t} else {\n\t\t\t\tusleep($sleep);\n\t\t\t}\n\t\t\tif ($this->isFree()) {\n\t\t\t\tif ($this->_acquireOnce()) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (!$this->fetch()->_isLocked()) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($timeout > 0 && $timer->elapsed() > $timeout) {\n\t\t\t\tthrow new TimeoutExpired('Waiting for Lock \"{code}\" ({timeout} seconds)', [\n\t\t\t\t\t'method' => __METHOD__, 'timeout' => $timeout, 'code' => $this->code,\n\t\t\t\t]);\n\t\t\t}\n\t\t}\n\t}", "function any(array $promises) {\n if (empty($promises)) {\n return new Success([], []);\n }\n\n $results = [];\n $errors = [];\n $remaining = count($promises);\n $promisor = new Future;\n\n foreach ($promises as $key => $resolvable) {\n if (!$resolvable instanceof Promise) {\n $resolvable = new Success($resolvable);\n }\n\n $resolvable->when(function($error, $result) use (&$remaining, &$results, &$errors, $key, $promisor) {\n if ($error) {\n $errors[$key] = $error;\n } else {\n $results[$key] = $result;\n }\n\n if (--$remaining === 0) {\n $promisor->succeed([$errors, $results]);\n }\n });\n }\n\n // We can return $promisor directly because the Future Promisor implementation\n // also implements Promise for convenience\n return $promisor;\n}", "protected function waitForTransientNegativeCompletionReply($socket) {\r\n\t\ttry {\r\n\t\t\t$this->_serverRespondedAsExpected($socket, 4);\r\n\t\t} catch (Exception $e) {\r\n\t\t\tthrow $e;\r\n\t\t}\r\n\t}", "public function spin($callable, $message = null)\n {\n $timeout = self::getTimeout();\n $end = microtime(true) + ($timeout);\n $callableException = null;\n $result = false;\n $spin = false;\n\n do {\n if ($spin) {\n sleep(1);\n }\n try {\n $result = $callable($this);\n } catch (\\Exception $e) {\n $callableException = $e;\n }\n $spin = true;\n } while (microtime(true) < $end && empty($result) && !$callableException instanceof Timeout);\n\n if (!$result) {\n if ($message === null) {\n $message = ($callableException !== null) ? $callableException->getMessage() : 'no message';\n }\n $info = sprintf('Spin : timeout of %d exceeded, with message : %s', $timeout, $message);\n throw new Timeout($info, 0, $callableException);\n }\n\n return $result;\n }", "protected function waitForPermanentNegativeCompletionReply($socket) {\r\n\t\ttry {\r\n\t\t\t$this->_serverRespondedAsExpected($socket, 5);\r\n\t\t} catch (Exception $e) {\r\n\t\t\tthrow $e;\r\n\t\t}\r\n\t}", "public function AbsoluteTimeout($channel, $timeout);", "public function wait($wait = -1) {}", "private function validateTimeoutValue(?float $timeout): float\n {\n // Ensure a sane value, anything less than 0.0 we can assume disabled\n if ($timeout === null || $timeout < 0.0) {\n $timeout = 0.0;\n }\n\n return $timeout;\n }", "public function testTickNoop() {\n $promise = new \\React\\Promise\\Deferred();\n \n $task = new \\Async\\Task\\PromiseTask($promise->promise());\n \n // The task should not yet be complete\n $this->assertFalse($task->isComplete());\n \n // Tick a few times\n $task->tick($this->getMock(\\Async\\Scheduler\\Scheduler::class));\n $task->tick($this->getMock(\\Async\\Scheduler\\Scheduler::class));\n $task->tick($this->getMock(\\Async\\Scheduler\\Scheduler::class));\n \n // The task should not have completed\n $this->assertFalse($task->isComplete());\n \n // Resolve the promise\n $promise->resolve(\"resolved\");\n \n // The task should be complete with no error\n $this->assertTrue($task->isComplete());\n $this->assertFalse($task->isFaulted()); \n // The result of the task should be the promise result\n $this->assertEquals(\"resolved\", $task->getResult());\n \n // Tick a few more times\n $task->tick($this->getMock(\\Async\\Scheduler\\Scheduler::class));\n $task->tick($this->getMock(\\Async\\Scheduler\\Scheduler::class));\n $task->tick($this->getMock(\\Async\\Scheduler\\Scheduler::class));\n \n // Verify that the result is unchanged\n $this->assertTrue($task->isComplete());\n $this->assertFalse($task->isFaulted()); \n // The result of the task should be the promise result\n $this->assertEquals(\"resolved\", $task->getResult());\n }", "public function wait_response($allowTimeout);", "public function waitLock(\n $timeout, $expiry = self::DEFAULT_EXPIRY, $maxSleep = 1000\n )\n {\n $start = microtime(true);\n $uSleepTime = min(max(500, $timeout), $maxSleep) * 1000;\n while(!$this->isLocked())\n {\n try\n {\n $this->lock($expiry);\n break;\n }\n catch(LockFailedException $e)\n {\n if($timeout == 0 || ((microtime(true) - $start) * 1000) >= $timeout)\n {\n throw $e;\n }\n usleep($uSleepTime);\n }\n }\n return $this;\n }", "public function retry(int $timeout, callable $callback, int $sleep = 5): mixed\n {\n $start = time();\n\n beginning:\n\n if ($output = $callback()) {\n return $output;\n }\n\n if (time() - $start < $timeout) {\n sleep($sleep);\n\n goto beginning;\n }\n\n throw new TimeoutException((array) $output);\n }", "function delay(float|int $timeout): void\n {\n signal(fn (Closure $resume) => after($resume, (int) $timeout * 1000));\n }", "public static function decodePromise(PromiseInterface $promise, $type = null): PromiseInterface\n {\n return $promise->then(\n function ($value) use ($type) {\n if (!$value instanceof ValuesInterface || $value instanceof \\Throwable) {\n return $value;\n }\n\n return $value->getValue(0, $type);\n }\n );\n }", "public static function asyncWait(int $ms)\n {\n wait(\\Amp\\Promise\\timeout(\n new LazyPromise(function() {\n // Do nothing, just asynchronous wait\n }),\n $ms\n ));\n }", "function wait($timeout=10, $propagate=TRUE, $interval=0.5)\n\t{\n\t\treturn $this->get($timeout, $propagate, $interval);\n\t}", "static public function asPromise ($s) {\n\t\t#/home/grabli66/haxelib/tink_core/git/src/tink/core/Future.hx:88: characters 5-13\n\t\treturn $s;\n\t}", "public function setTimeout(int $timeout): void {}", "public function waitAndAllow($string,$timeOut=300)\n\t{\n\t\t$allow=$this->isLock($string);\n\t\tif($allow==1) {\n\t\t\t$this->getLock($string);\n\t\t\treturn $allow; }\n\t\telse{\n\t\t\tif($string) {\n\t\t\tset_time_limit(3600);\n\t\t\t$allow=0;\n\t\t\t$phase1_microSec=rand(100,200);\n\t\t\t$phase1_limit=rand(16000,17000);\n\t\t\tfor($i=0;$i<$phase1_limit;$i++){\n\t\t\t\t$allow=$this->isLock($string);\n\t\t\t\tif($allow==1){ $this->getLock($string,$timeOut);\n\t\t\t\t\treturn $allow;}\n\t\t\t\telse usleep($phase1_microSec);}\n\t\t\t$phase2_microSec=rand(10,50);\n\t\t\t$phase2_limit=rand(12000,13000);\n\t\t\tfor($i=0;$i<$phase2_limit;$i++){\n\t\t\t\t$allow=$this->isLock($string);\n\t\t\t\tif($allow==1){ $this->getLock($string,$timeOut);\n\t\t\t\t\treturn $allow;}\n\t\t\t\telse usleep($phase2_microSec);}\n\t\t\t$phase3_microSec=rand(1,10);\n\t\t\t$phase3_limit=rand(10000,11000);\n\t\t\tfor($i=0;$i<$phase3_limit;$i++){\n\t\t\t\t$allow=$this->isLock($string);\n\t\t\t\tif($allow==1){ $this->getLock($string,$timeOut);\n\t\t\t\treturn $allow;}\n\t\t\t\telse usleep($phase3_microSec);}\n\t\t\t}\n\t\t\telse\n\t\t\t\techo \"No String passed to check lock status\";\n\t\t}\n\t\treturn $allow;\n\t}", "public function acquire(int $timeout = 0): Lock {\n\t\tif ($this->_isMine()) {\n\t\t\treturn $this;\n\t\t}\n\t\tif ($this->isMyServer() && !$this->isProcessAlive()) {\n\t\t\treturn $this->_acquireDead();\n\t\t}\n\t\tif ($timeout === 0) {\n\t\t\t$this->_isLocked();\n\t\t\treturn $this->_acquireOnce();\n\t\t}\n\t\tif ($timeout < 0) {\n\t\t\tthrow new TimeoutExpired('Acquire timeout is negative {timeout}', ['timeout' => $timeout]);\n\t\t}\n\t\t$this->_acquire($timeout);\n\t\treturn $this;\n\t}", "public function getTimeout(): ?float;", "function lock_acquire($name, $timeout = 30.0) {\n global $locks;\n\n // Insure that the timeout is at least 1 ms.\n $timeout = max($timeout, 0.001);\n $expire = microtime(TRUE) + $timeout;\n if (isset($locks[$name])) {\n // Try to extend the expiration of a lock we already acquired.\n $success = (bool) db_update('semaphore')\n ->fields(array('expire' => $expire))\n ->condition('name', $name)\n ->condition('value', _lock_id())\n ->execute();\n if (!$success) {\n // The lock was broken.\n unset($locks[$name]);\n }\n return $success;\n }\n else {\n // Optimistically try to acquire the lock, then retry once if it fails.\n // The first time through the loop cannot be a retry.\n $retry = FALSE;\n // We always want to do this code at least once.\n do {\n try {\n db_insert('semaphore')\n ->fields(array(\n 'name' => $name,\n 'value' => _lock_id(),\n 'expire' => $expire,\n ))\n ->execute();\n // We track all acquired locks in the global variable.\n $locks[$name] = TRUE;\n // We never need to try again.\n $retry = FALSE;\n }\n catch (PDOException $e) {\n // Suppress the error. If this is our first pass through the loop,\n // then $retry is FALSE. In this case, the insert must have failed\n // meaning some other request acquired the lock but did not release it.\n // We decide whether to retry by checking lock_may_be_available()\n // Since this will break the lock in case it is expired.\n $retry = $retry ? FALSE : lock_may_be_available($name);\n }\n // We only retry in case the first attempt failed, but we then broke\n // an expired lock.\n } while ($retry);\n }\n return isset($locks[$name]);\n}", "public function amWaiting($time = 1)\n {\n if (method_exists($this, 'wait')) {\n $this->wait($time);\n }\n }", "public function setTimeout($timeout = null)\r\n {\r\n if ($timeout === null) {\r\n $timeout = 30000;\r\n }\r\n if (!is_int($timeout)) {\r\n throw new \\InvalidArgumentException('Parameter is not an integer');\r\n }\r\n if ($timeout < 0) {\r\n throw new \\InvalidArgumentException('Parameter is negative. Only positive timeouts accepted.');\r\n }\r\n\r\n $this->timeout = $timeout;\r\n return $this;\r\n }", "public function testPreResolved() {\n $promise = \\React\\Promise\\When::resolve(\"resolved\");\n \n $task = new \\Async\\Task\\PromiseTask($promise);\n \n // The task should be complete with no error\n $this->assertTrue($task->isComplete());\n $this->assertFalse($task->isFaulted());\n \n // The result of the task should be the promise result\n $this->assertEquals(\"resolved\", $task->getResult());\n }", "function timeout() {\n $q = Doctrine_Query::create()\n ->update('Zim_Model_User u')\n ->set('u.timedout', '?', '1')\n ->where(\"u.updated_at <= ?\", date('Y-m-d H:i:s', time()- $this->getVar('timeout_period', 30)));\n $q->execute();\n return;\n }", "public function warrantyPromise($value)\n {\n $this->setProperty('warrantyPromise', $value);\n return $this;\n }", "public function testThrottledTaskCompletesWithErrorWhenWrappedTaskCompletesWithError() {\n $wrapped = new TaskStub();\n \n $throttled = new \\Async\\Task\\ThrottledTask($wrapped, 0.5);\n \n // Check that the task is not complete\n $this->assertFalse($throttled->isComplete());\n \n // Complete the wrapped task with an error and check that the the throttled task reflects\n // that\n $wrapped->setException(new \\Exception(\"Some exception\"));\n $this->assertTrue($throttled->isComplete());\n $this->assertTrue($throttled->isFaulted());\n $this->assertSame(\"Some exception\", $throttled->getException()->getMessage());\n }", "static public function trigger () {\n\t\t#/home/grabli66/haxelib/tink_core/git/src/tink/core/Promise.hx:289: characters 12-32\n\t\treturn new FutureTrigger();\n\t}", "protected function waitForPositiveCompletionReply($socket) {\r\n\t\ttry {\r\n\t\t\t$this->_serverRespondedAsExpected($socket, 2);\r\n\t\t} catch (Exception $e) {\r\n\t\t\tthrow $e;\r\n\t\t}\r\n\t}", "public function waitWithBackoff()\n {\n $waitTime = $this->calculateSleepTime();\n if ($waitTime > 1000000) {\n sleep((int) ($waitTime / 1000000));\n } else {\n usleep($waitTime);\n }\n }", "public function setTimeout(int $timeout): void;", "protected function waitForPositivePreliminaryReply($socket) {\r\n\t\ttry {\r\n\t\t\t$this->_serverRespondedAsExpected($socket, 1);\r\n\t\t} catch (Exception $e) {\r\n\t\t\tthrow $e;\r\n\t\t}\r\n\t}", "public function awaitPendingPublishConfirms(int $timeout = 0): void\n {\n $this->getChannel()->wait_for_pending_acks($timeout);\n }", "public function iWaitForElement($element): void\n {\n $this->iWaitSecondsForElement($this->timeout, $element);\n }", "public function timeout($timesecs);", "public function retryUntil();", "public function awaitVirtualTimeBudgetExpired(ContextInterface $ctx): VirtualTimeBudgetExpiredEvent;", "public function raise(\\Exception $e): Awaitable<?(Tk, Tv)> {}", "public function setTimeout($timeout)\n {\n if (0 > $timeout) {\n /**\n * @uses Parsonline_Exception_ValueException\n */\n require_once('Parsonline/Exception/ValueException.php');\n throw new Parsonline_Exception_ValueException(\"SSH stream data transfere timeout should not be negative\");\n }\n $this->_timeout = intval($timeout);\n return $this;\n }", "function get($timeout=10, $propagate=TRUE, $interval=0.5)\n\t{\n\t\t$interval_us = (int)($interval * 1000000);\n\n\t\t$start_time = self::getmicrotime();\n\t\twhile(self::getmicrotime() - $start_time < $timeout)\n\t\t{\n\t\t\t\tif($this->isReady())\n\t\t\t\t{\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tusleep($interval_us);\n\t\t}\n\n\t\tif(!$this->isReady())\n\t\t{\n\t\t\t\tthrow new CeleryTimeoutException(sprintf('AMQP task %s(%s) did not return after %d seconds', $this->task_name, json_encode($this->task_args), $timeout), 4);\n\t\t}\n\n\t\treturn $this->getResult();\n\t}", "public static function run($callable, $timeout = 0)\n {\n if (!is_callable($callable)) {\n throw new InvalidArgumentException();\n }\n\n $timeout = (integer) $timeout;\n\n if (!function_exists('pcntl_signal')) {\n throw new Exception(\"PCNTL threading is not supported by your system.\");\n }\n\n pcntl_signal(SIGALRM, function ($signal) use ($timeout) {\n throw new TimeoutException(\"Timeout reached, execution aborted after {$timeout} second(s).\");\n }, true);\n\n pcntl_alarm($timeout);\n\n $result = null;\n\n try {\n $result = $callable();\n pcntl_alarm(0);\n } catch (Throwable|Exception $e) {\n pcntl_alarm(0);\n throw $e;\n }\n\n return $result;\n }", "public function setTimeout($value)\n {\n return $this->set(self::_TIMEOUT, $value);\n }", "public function acquire($timeout = 60, $retryAttempts = 100, $retryWaitUsec = 100000)\n {\n $timeout = abs($timeout);\n $retryAttempts = abs($retryAttempts);\n $retryWaitUsec = abs($retryWaitUsec);\n \n $key = $this->getKey();\n $attempts = 0;\n \n do {\n $value = $this->getLockExpirationValue($timeout);\n \n if ($this->client->setnx($key, $value)) {\n // lock acquired\n return $this->acquired($timeout);\n } else {\n // failed to acquire. If current value has expired attempt to get the lock\n $currentValue = $this->client->get($key);\n \n // has the current lock expired\n if ($this->hasLockValueExpired($currentValue)) {\n $this->killExpiredProcess($currentValue);\n \n $getsetResult = $this->client->getset($key, $value);\n if ($this->hasLockValueExpired($getsetResult)) {\n // still expired therefore lock acquired\n return $this->acquired($timeout);\n }\n }\n }\n \n // sleep then try again\n usleep($retryWaitUsec);\n $attempts++;\n } while ($attempts < $retryAttempts);\n \n return false;\n }", "public function promise() {\n return $this;\n }", "public function testSendMessageExceptionAsync()\n {\n // Configure HTTP basic authorization: basicAuth\n $config = Configuration::getDefaultConfiguration()\n ->setUsername('YOUR_USERNAME')\n ->setPassword('YOUR_PASSWORD');\n\n $expected_exception = new \\GuzzleHttp\\Exception\\RequestException(\n \"Error Communicating with Server\",\n new \\GuzzleHttp\\Psr7\\Request('POST', 'test')\n );\n $mock = new \\GuzzleHttp\\Handler\\MockHandler([$expected_exception]);\n $handler = \\GuzzleHttp\\HandlerStack::create($mock);\n $client = new \\GuzzleHttp\\Client(['handler' => $handler]);\n\n $apiInstance = new Api\\MessageApi(\n $client,\n $config\n );\n $message = new \\Karix\\Model\\CreateMessage();\n\n $promise = $apiInstance->sendMessageAsync($message)->then(function ($result) {\n $this->fail(\"No exception when calling MessageApi->sendMessage with mocked exception\");\n }, function ($exception) use( &$expected_exception) {\n $this->assertEquals(\"[0] \".$expected_exception->getMessage(), $exception->getMessage());\n });\n $promise->wait();\n }", "function testfutureValueException1()\n\t{\n\t\t$this->expectException(Exception::class);\n\t\tMath_Finance::futureValue(0.29, -7, 100);\n\t}", "public function getTimeout(): ?int;", "public function waitForOperation($requestId = '', $sleepInterval = 250)\n {\n \tif ($requestId == '') {\n \t\t$requestId = $this->getLastRequestId();\n \t}\n \tif ($requestId == '' || is_null($requestId)) {\n \t\treturn null;\n \t}\n\n\t\t$status = $this->getOperationStatus($requestId);\n\t\twhile ($status->Status == 'InProgress') {\n\t\t $status = $this->getOperationStatus($requestId);\n\t\t usleep($sleepInterval);\n\t\t}\n\n\t\treturn $status;\n }", "public function setTimeout(float $timeout): void\n {\n }", "function all(array $promises) {\n if (empty($promises)) {\n return new Success([]);\n }\n\n $results = [];\n $remaining = count($promises);\n $promisor = new Future;\n\n foreach ($promises as $key => $resolvable) {\n if (!$resolvable instanceof Promise) {\n $resolvable = new Success($resolvable);\n }\n\n $resolvable->when(function($error, $result) use (&$remaining, &$results, $key, $promisor) {\n // If the promisor already failed don't bother\n if (empty($remaining)) {\n return;\n }\n\n if ($error) {\n $remaining = 0;\n $promisor->fail($error);\n return;\n }\n\n $results[$key] = $result;\n if (--$remaining === 0) {\n $promisor->succeed($results);\n }\n });\n }\n\n // We can return $promisor directly because the Future Promisor implementation\n // also implements Promise for convenience\n return $promisor;\n}", "#[@test, @limit(time= 1.0)]\n public function noTimeout() {\n }", "function waitfor($file)\r\n\t{\r\n\t\treturn parent::waitFor($file);\r\n\t}", "public function solve(CaptchaResponse $captchaResponse, $timeout = null);", "public function sendSmsAndWaitResponse(string $addressee, string $message, int $line = 1, int $responseTimeout = self::DEFAULT_TIMEOUT): Sms\n {\n $lock = null;\n if (null !== $this->lockStore) {\n $lockFactory = new Factory($this->lockStore);\n $lock = $lockFactory->createLock('goip-sms-send-receive-' . $line, $responseTimeout);\n\n if (!$lock->acquire()) {\n throw new \\Exception('There is another wait-for-response SMS in progress');\n }\n }\n\n try {\n $sendResult = $this->sendSms($addressee, $message, $line);\n\n if (!$sendResult) {\n throw new SmsNotSentException($line, $addressee);\n }\n\n $mapper = new SmsMapper(new SmsAdapter($this->sms));\n /** @var Sms $latestMessage */\n $latestMessage = ($mapper->findByLine($line))[0];\n $stopwatch = new Stopwatch();\n $stopwatch->start('check_response');\n do {\n sleep(self::CHECK_RESPONSE_INTERVAL);\n /** @var Sms $responseCheckMessage */\n $responseCheckMessage = ($mapper->findByLine($line))[0];\n if ($responseCheckMessage->getDate()->format('Y-m-d H:i:s') === $latestMessage->getDate()->format('Y-m-d H:i:s')) {\n continue;\n }\n $stopwatch->stop('check_response');\n if (null !== $lock) {\n $lock->release();\n }\n return $responseCheckMessage;\n } while ($stopwatch->lap('check_response')->getDuration() <= $responseTimeout);\n\n if (null !== $lock) {\n $lock->release();\n }\n\n throw new SmsResponseTimeoutException($line);\n } catch (\\Throwable $th) {\n if (null !== $lock) {\n $lock->release();\n }\n throw new MissingSmsResponseException('Could not retrieve the SMS response. ' . $th->getMessage(), $th->getCode(), $th);\n }\n }", "protected function waitForPositiveIntermediateReply($socket) {\r\n\t\ttry {\r\n\t\t\t$this->_serverRespondedAsExpected($socket, 3);\r\n\t\t} catch (Exception $e) {\r\n\t\t\tthrow $e;\r\n\t\t}\r\n\t}", "public function always(callable $callback): PromiseLike {\n $this->_done->add($callback);\n $this->_failed->add($callback);\n $this->callIf(\n $this->_state !== self::STATE_PENDING,\n $callback,\n $this->_finishArguments\n );\n return $this;\n }", "public function testPollTimeOut() {\n $c = new _MockProviderCronRunner(50, 0.0001);\n $provider = $this->createMock(ProviderInterface::class);\n $polling = $this->createMock(PollingInterface::class);\n $provider->method('polling')->willReturn($polling);\n $polling->expects($this->once())->method('poll')->will($this->returnCallback(function () {\n usleep(101);\n return TRUE;\n }));\n $c->providers = [$provider];\n $start = microtime(TRUE);\n $c->poll();\n $this->assertLessThan(1, microtime(TRUE) - $start);\n }" ]
[ "0.64511245", "0.5322579", "0.5129807", "0.5068575", "0.49033225", "0.48423463", "0.47897398", "0.4775362", "0.4751394", "0.471529", "0.47035533", "0.4661031", "0.4623096", "0.46151805", "0.45796537", "0.4574256", "0.45056084", "0.4499299", "0.44949308", "0.44540098", "0.4445114", "0.4414991", "0.44113338", "0.43625033", "0.42893323", "0.42890775", "0.42787576", "0.42744762", "0.42647222", "0.42508787", "0.42451355", "0.42425582", "0.42382687", "0.42109793", "0.41981092", "0.41964006", "0.41958797", "0.4195678", "0.4195633", "0.41766712", "0.4100706", "0.40646797", "0.39643598", "0.395418", "0.39496028", "0.39358556", "0.3927331", "0.39255762", "0.39231193", "0.39183792", "0.3913745", "0.3902707", "0.38908437", "0.38890433", "0.38889265", "0.38780415", "0.38766694", "0.38715822", "0.38693342", "0.38519195", "0.38480702", "0.38339815", "0.38278282", "0.38209137", "0.3794388", "0.37842813", "0.37775698", "0.37614992", "0.37549096", "0.37373692", "0.37304854", "0.37290522", "0.3708491", "0.37067997", "0.37060875", "0.37053648", "0.37039676", "0.3691453", "0.36898914", "0.36837083", "0.36597517", "0.36571783", "0.36523044", "0.36497372", "0.36418107", "0.36379287", "0.36366022", "0.36334467", "0.36321273", "0.36316565", "0.36298412", "0.36225605", "0.3617627", "0.36109406", "0.36077967", "0.3606717", "0.36038008", "0.35927543", "0.35866475", "0.35756025" ]
0.6445397
1
wait for ANY of the given promises to resolve Once the first promise is resolved, this will try to cancel() all remaining promises and return whatever the first promise resolves to. If ALL promises fail to resolve, this will fail and throw an Exception. If no $timeout is given and either promise stays pending, then this will potentially wait/block forever until the last promise is settled. If a $timeout is given and either promise is still pending once the timeout triggers, this will cancel() all pending promises and throw a `TimeoutException`. This implies that if you pass a really small (or negative) value, it will still start a timer and will thus trigger at the earliest possible time in the future.
function awaitAny(array $promises, LoopInterface $loop, $timeout = null) { try { // Promise\any() does not cope with an empty input array, so reject this here if (!$promises) { throw new UnderflowException('Empty input array'); } $ret = await(Promise\any($promises)->then(null, function () { // rejects with an array of rejection reasons => reject with Exception instead throw new Exception('All promises rejected'); }), $loop, $timeout); } catch (TimeoutException $e) { // the timeout fired // => try to cancel all promises (rejected ones will be ignored anyway) _cancelAllPromises($promises); throw $e; } catch (Exception $e) { // if the above throws, then ALL promises are already rejected // => try to cancel all promises (rejected ones will be ignored anyway) _cancelAllPromises($promises); throw new UnderflowException('No promise could resolve', 0, $e); } // if we reach this, then ANY of the given promises resolved // => try to cancel all promises (settled ones will be ignored anyway) _cancelAllPromises($promises); return $ret; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function any(array $promises) {\n if (empty($promises)) {\n return new Success([], []);\n }\n\n $results = [];\n $errors = [];\n $remaining = count($promises);\n $promisor = new Future;\n\n foreach ($promises as $key => $resolvable) {\n if (!$resolvable instanceof Promise) {\n $resolvable = new Success($resolvable);\n }\n\n $resolvable->when(function($error, $result) use (&$remaining, &$results, &$errors, $key, $promisor) {\n if ($error) {\n $errors[$key] = $error;\n } else {\n $results[$key] = $result;\n }\n\n if (--$remaining === 0) {\n $promisor->succeed([$errors, $results]);\n }\n });\n }\n\n // We can return $promisor directly because the Future Promisor implementation\n // also implements Promise for convenience\n return $promisor;\n}", "function some(array $promises) {\n if (empty($promises)) {\n return new Failure(new \\LogicException(\n 'No promises or values provided for resolution'\n ));\n }\n\n $errors = [];\n $results = [];\n $remaining = count($promises);\n $promisor = new Future;\n\n foreach ($promises as $key => $resolvable) {\n if (!$resolvable instanceof Promise) {\n $resolvable = new Success($resolvable);\n }\n\n $resolvable->when(function($error, $result) use (&$remaining, &$results, &$errors, $key, $promisor) {\n if ($error) {\n $errors[$key] = $error;\n } else {\n $results[$key] = $result;\n }\n\n if (--$remaining > 0) {\n return;\n } elseif (empty($results)) {\n $promisor->fail(new \\RuntimeException(\n 'All promises failed'\n ));\n } else {\n $promisor->succeed([$errors, $results]);\n }\n });\n }\n\n // We can return $promisor directly because the Future Promisor implementation\n // also implements Promise for convenience\n return $promisor;\n}", "function first(array $promises) {\n if (empty($promises)) {\n return new Failure(new \\LogicException(\n 'No promises or values provided for resolution'\n ));\n }\n\n $remaining = count($promises);\n $isComplete = false;\n $promisor = new Future;\n\n foreach ($promises as $resolvable) {\n if (!$resolvable instanceof Promise) {\n $promisor->succeed($resolvable);\n break;\n }\n\n $promise->when(function($error, $result) use (&$remaining, &$isComplete, $promisor) {\n if ($isComplete) {\n // we don't care about Futures that resolve after the first\n return;\n } elseif ($error && --$remaining === 0) {\n $promisor->fail(new \\RuntimeException(\n 'All promises failed'\n ));\n } elseif (empty($error)) {\n $isComplete = true;\n $promisor->succeed($result);\n }\n });\n }\n\n // We can return $promisor directly because the Future Promisor implementation\n // also implements Promise for convenience\n return $promisor;\n}", "function awaitAll(array $promises, LoopInterface $loop, $timeout = null)\n{\n try {\n return await(Promise\\all($promises), $loop, $timeout);\n } catch (Exception $e) {\n // ANY of the given promises rejected or the timeout fired\n // => try to cancel all promises (rejected ones will be ignored anyway)\n _cancelAllPromises($promises);\n\n throw $e;\n }\n}", "function _cancelAllPromises(array $promises)\n{\n foreach ($promises as $promise) {\n if ($promise instanceof CancellablePromiseInterface) {\n $promise->cancel();\n }\n }\n}", "function all(array $promises) {\n if (empty($promises)) {\n return new Success([]);\n }\n\n $results = [];\n $remaining = count($promises);\n $promisor = new Future;\n\n foreach ($promises as $key => $resolvable) {\n if (!$resolvable instanceof Promise) {\n $resolvable = new Success($resolvable);\n }\n\n $resolvable->when(function($error, $result) use (&$remaining, &$results, $key, $promisor) {\n // If the promisor already failed don't bother\n if (empty($remaining)) {\n return;\n }\n\n if ($error) {\n $remaining = 0;\n $promisor->fail($error);\n return;\n }\n\n $results[$key] = $result;\n if (--$remaining === 0) {\n $promisor->succeed($results);\n }\n });\n }\n\n // We can return $promisor directly because the Future Promisor implementation\n // also implements Promise for convenience\n return $promisor;\n}", "protected function waitFor($permits, $timeout) {\n $time= $this->clock->time();\n $slot= (int)$time;\n\n // If next slot is in the future, wait\n if ($this->next > $slot) {\n $sleep= $this->next - $time;\n if (null !== $timeout && $sleep > $timeout) return self::TIMED_OUT;\n\n $this->clock->wait($sleep + self::ONE_MICRO);\n $time= $this->clock->time();\n $slot= (int)$time;\n $this->next= null;\n } else {\n $sleep= 0.0;\n }\n\n // If next has passed in the meantime, reset counts\n if ($slot > $this->next) {\n $this->reset= $time + $this->rate->unit()->seconds();\n $this->permits= 0;\n $this->next= $slot;\n }\n\n $this->permits+= $permits;\n\n // If we reached (or exceeded) the rate, set next slot to the future\n $exceed= $this->permits - $this->rate->value();\n if (0 === $exceed) {\n $this->next= $time + $this->rate->unit()->seconds();\n } else if ($exceed > 0) {\n $slots= $exceed / $this->rate->value() + 1;\n $this->next= $time + $slots * $this->rate->unit()->seconds();\n }\n\n return $sleep;\n }", "public function all(array $promisesOrValues);", "public static function when(...$arguments): PromiseLike {\n $counter = count($arguments);\n if ($counter === 1) {\n $argument = $arguments[0];\n if ($argument instanceOf self) {\n return $argument->promise();\n }\n if ($argument instanceOf PromiseLike) {\n return $argument;\n }\n $defer = new Deferred();\n $defer->resolve($argument);\n return $defer->promise();\n }\n if ($counter > 0) {\n $master = new Deferred();\n $resolveArguments = [];\n foreach ($arguments as $index => $argument) {\n if ($argument instanceOf PromiseLike) {\n $argument\n ->done(\n static function (...$arguments) use ($master, $index, &$counter, &$resolveArguments) {\n $resolveArguments[$index] = $arguments;\n if (--$counter === 0) {\n ksort($resolveArguments);\n $master->resolve(...$resolveArguments);\n }\n }\n )\n ->fail(\n static function (...$arguments) use ($master) {\n $master->reject(...$arguments);\n }\n );\n } else {\n $resolveArguments[$index] = [$argument];\n if (--$counter === 0) {\n ksort($resolveArguments);\n $master->resolve(...$resolveArguments);\n }\n }\n }\n return $master->promise();\n }\n $defer = new Deferred();\n $defer->resolve();\n return $defer->promise();\n }", "public function tryAcquiring($permits= 1, $timeout= 0.0) {\n return self::TIMED_OUT !== $this->waitFor($permits, $timeout);\n }", "public static function createAll($promisesOrValues);", "function filter(array $promises, callable $functor) {\n if (empty($promises)) {\n return new Success([]);\n }\n\n $results = [];\n $remaining = count($promises);\n $promisor = new Future;\n\n foreach ($promises as $key => $resolvable) {\n $promise = ($resolvable instanceof Promise) ? $resolvable : new Success($resolvable);\n $promise->when(function($error, $result) use (&$remaining, &$results, $key, $promisor, $functor) {\n if (empty($remaining)) {\n // If the future result already failed we don't bother.\n return;\n }\n if ($error) {\n $remaining = 0;\n $promisor->fail($error);\n return;\n }\n try {\n if ($functor($result)) {\n $results[$key] = $result;\n }\n if (--$remaining === 0) {\n $promisor->succeed($results);\n }\n } catch (\\Exception $error) {\n $promisor->fail($error);\n }\n });\n }\n\n // We can return $promisor directly because the Future Promisor implementation\n // also implements Promise for convenience\n return $promisor;\n}", "function await(PromiseInterface $promise, LoopInterface $loop, $timeout = null)\n{\n $wait = true;\n $resolved = null;\n $exception = null;\n $rejected = false;\n\n if ($timeout !== null) {\n $promise = Timer\\timeout($promise, $timeout, $loop);\n }\n\n $promise->then(\n function ($c) use (&$resolved, &$wait, $loop) {\n $resolved = $c;\n $wait = false;\n $loop->stop();\n },\n function ($error) use (&$exception, &$rejected, &$wait, $loop) {\n $exception = $error;\n $rejected = true;\n $wait = false;\n $loop->stop();\n }\n );\n\n while ($wait) {\n $loop->run();\n }\n\n if ($rejected) {\n if (!$exception instanceof \\Exception) {\n $exception = new \\UnexpectedValueException(\n 'Promise rejected with unexpected value of type ' . (is_object(($exception) ? get_class($exception) : gettype($exception))),\n 0,\n $exception instanceof \\Throwable ? $exception : null\n );\n }\n\n throw $exception;\n }\n\n return $resolved;\n}", "public function callAllPromises()\n {\n $pool = $this->pool;\n\n usort($pool, function ($a, $b) {\n return $a['priority'] - $b['priority'];\n });\n\n foreach ($pool as $node) {\n $promise = $node['promise'];\n $promise();\n }\n }", "function wait(Promise $promise, Reactor $reactor = null) {\n $isWaiting = true;\n $resolvedError = null;\n $resolvedResult = null;\n\n $promise->when(function($error, $result) use (&$isWaiting, &$resolvedError, &$resolvedResult) {\n $isWaiting = false;\n $resolvedError = $error;\n $resolvedResult = $result;\n });\n\n $reactor = $reactor ?: getReactor();\n while ($isWaiting) {\n $reactor->tick();\n }\n\n if ($resolvedError) {\n throw $resolvedError;\n }\n\n return $resolvedResult;\n}", "public function waitWithPluralTables(array $tables, $timeout = 1)\n {\n $arguments = array();\n foreach ($tables as $table) {\n $arguments[] = $this->getPDO()->quote($table);\n }\n $arguments[] = intval($timeout);\n $function = sprintf(\"queue_wait(%s)\", implode(\",\", $arguments));\n try {\n $value = $this->executeFunction($function, true);\n $index = intval($value[$function]) - 1;\n if (! isset($tables[$index])) {\n throw new Q4MException(\"All table aren't available.\");\n }\n } catch (Exception $e) {\n $tablesString = str_replace(\"\\n\", \"\", var_export($tables, true));\n throw new Q4MException(sprintf(\"Failed to wait with plural tables. tables=[%s]\", $tablesString), 0, $e);\n }\n\n return $this->wait($tables[$index]);\n }", "public function requestMultiple($requests)\n {\n $promises = array_map(function ($request) {\n \treturn $this->httpClient->sendAsync($request);\n\t\t}, $requests);\n\n $responses = Promise\\unwrap($promises);\n\n return $responses;\n }", "function retry($times, callable $callback, $sleep = 0, $when = null)\n {\n $attempts = 0;\n $times--;\n\n beginning: $attempts++;\n\n try {\n return $callback($attempts);\n } catch (Exception $e) {\n if (!$times || ($when && !$when($e))) {\n throw $e;\n }\n\n $times--;\n\n if ($sleep) {\n usleep($sleep * 1000);\n }\n\n goto beginning;\n }\n }", "protected function cleanupTimeoutedRequests() {\n foreach ($this->requests as $handle) {\n if ($handle->timeout > 0 && (microtime(true) - $handle->timeStart) >= $handle->timeout) {\n $this->eventManager->notify('complete', array($this, $handle));\n $this->detach($handle);\n }\n }\n }", "public function wait($timeout=null)\n {\n $delta = time();\n if ($timeout == null)\n $timeout = 60 * 2; // two minutes\n if (!($this->check(\"state\", \"started\")))\n Throw new \\CatapultApiException(\"Call already in non 'started' state'\");\n while (true) {\n if (!($this->check(\"state\", \"started\")))\n break;\n if ((time() - $delta) > $timeout)\n break;\n }\n }", "function retry($times, callable $callback, $sleep = 0)\n {\n $times--;\n beginning:\n try {\n return $callback();\n } catch (Exception $e) {\n if (!$times) {\n throw $e;\n }\n $times--;\n if ($sleep) {\n usleep($sleep * 1000);\n }\n goto beginning;\n }\n }", "public function acquire($permits= 1) {\n return $this->waitFor($permits, null);\n }", "function map(array $promises, callable $functor) {\n if (empty($promises)) {\n return new Success([]);\n }\n\n $results = [];\n $remaining = count($promises);\n $promisor = new Future;\n\n foreach ($promises as $key => $resolvable) {\n $promise = ($resolvable instanceof Promise) ? $resolvable : new Success($resolvable);\n $promise->when(function($error, $result) use (&$remaining, &$results, $key, $promisor, $functor) {\n if (empty($remaining)) {\n // If the future already failed we don't bother.\n return;\n }\n if ($error) {\n $remaining = 0;\n $promisor->fail($error);\n return;\n }\n\n try {\n $results[$key] = $functor($result);\n if (--$remaining === 0) {\n $promisor->succeed($results);\n }\n } catch (\\Exception $error) {\n $remaining = 0;\n $promisor->fail($error);\n }\n });\n }\n\n // We can return $promisor directly because the Future Promisor implementation\n // also implements Promise for convenience\n return $promisor;\n}", "function retry(int $times, callable $callback, int $sleep = 0, $when = null)\n {\n $attempts = 0;\n $times--;\n\n beginning:\n $attempts++;\n\n try {\n return $callback($attempts);\n } catch (Exception $e) {\n if (!$times || ($when && !$when($e))) {\n throw $e;\n }\n\n $times--;\n\n if ($sleep) {\n usleep($sleep * 1000);\n }\n\n goto beginning;\n }\n }", "public function retry($times, callable $callback, $sleep = 0)\n {\n $times--;\n\n beginning:\n try {\n return $callback();\n } catch (Exception $e) {\n if (! $times) {\n throw $e;\n }\n\n $times--;\n\n if ($sleep) {\n usleep($sleep * 1000);\n }\n\n goto beginning;\n }\n }", "public static function coalesce(array $time_periods) {\n if (count($time_periods) == 0) {\n return $time_periods;\n }\n\n usort($time_periods, array(\"Doctrine_Temporal_TimePeriod\", \"usortByStartDate\"));\n $working = null;\n foreach ($time_periods as $k => &$time_period) {\n if (is_null($working)) {\n $working =& $time_period;\n }\n elseif (is_null($working->exp_date)) {\n unset($time_periods[$k]);\n }\n elseif($working->exp_date >= $time_period->eff_date) {\n $working->exp_date = max($working->exp_date, $time_period->exp_date);\n unset($time_periods[$k]);\n }\n else {\n $working =& $time_period;\n }\n }\n return $time_periods;\n }", "function sleep_between(int $times, int $sleep, callable $callback): Collection\n {\n $sleep *= 1000;\n\n return Collection::times($times, static function ($iteration) use ($callback, $sleep, $times): mixed {\n $result = $callback($iteration);\n\n if ($iteration < $times) {\n usleep($sleep);\n }\n\n return $result;\n });\n }", "public function await(string $lastSeenId, int $timeout = 0): ?array;", "public static function createResolve($promiseOrValue = null);", "public function run(Queue ...$queues): Promise\n {\n return $this->entryPoint->listen(...$queues);\n }", "public function testDelayedResolution() {\n $promise = new \\React\\Promise\\Deferred();\n \n $task = new \\Async\\Task\\PromiseTask($promise->promise());\n \n // The task should not yet be complete\n $this->assertFalse($task->isComplete());\n \n // Resolve the promise\n $promise->resolve(\"resolved\");\n \n // The task should be complete with no error\n $this->assertTrue($task->isComplete());\n $this->assertFalse($task->isFaulted());\n \n // The result of the task should be the promise result\n $this->assertEquals(\"resolved\", $task->getResult());\n }", "protected function perform()\n {\n $active = $failedSelects = 0;\n $pendingRequests = !$this->scope ? $this->count() : !empty($this->requests[$this->scope]);\n\n while ($pendingRequests) {\n\n while ($mrc = curl_multi_exec($this->multiHandle, $active) == CURLM_CALL_MULTI_PERFORM);\n $this->checkCurlResult($mrc);\n\n // Get messages from curl handles\n while ($done = curl_multi_info_read($this->multiHandle)) {\n $this->dispatch('curl_multi.message', $done);\n foreach ($this->all() as $request) {\n $handle = $this->getRequestHandle($request);\n if ($handle && $handle->getHandle() === $done['handle']) {\n try {\n $this->processResponse($request, $handle, $done);\n } catch (\\Exception $e) {\n $this->removeErroredRequest($request, $e);\n }\n break;\n }\n }\n }\n\n // Notify each request as polling and handled queued responses\n $scopedPolling = $this->scope <= 0 ? $this->all() : $this->requests[$this->scope];\n $pendingRequests = !empty($scopedPolling);\n foreach ($scopedPolling as $request) {\n $request->dispatch(self::POLLING_REQUEST, array(\n 'curl_multi' => $this,\n 'request' => $request\n ));\n }\n\n if ($pendingRequests) {\n if (!$active) {\n // Requests are not actually pending a cURL select call, so\n // we need to delay in order to prevent eating too much CPU\n usleep(30000);\n } else {\n $select = curl_multi_select($this->multiHandle, 0.3);\n // Select up to 25 times for a total of 7.5 seconds\n if (!$select && $this->scope > 0 && ++$failedSelects > 25) {\n // There are cases where curl is waiting on a return\n // value from a parent scope in order to remove a curl\n // handle. This check will defer to a parent scope for\n // handling the rest of the connection transfer.\n // @codeCoverageIgnoreStart\n break;\n // @codeCoverageIgnoreEnd\n }\n }\n }\n }\n }", "public function first(Strand $strand, ...$coroutines)\n {\n $kernel = $strand->kernel();\n $substrands = [];\n\n foreach ($coroutines as $coroutine) {\n $substrands[] = $kernel->execute($coroutine);\n }\n\n (new StrandWaitFirst(...$substrands))->await($strand, $this);\n }", "private function mockObligatoryPossible(array $groups, Date $firstDate, Date $lastDate = null, array $numbers = [1], $count = 1) {\n if (!$this->courseService) {\n $this->createService(true);\n }\n\n $this->courseService->shouldReceive('obligatoryPossible')\n ->andReturnUsing(function($actualGroups, $actualFirstDate, $actualLastDate, $actualNumbers) use ($groups, $firstDate, $lastDate, $numbers) {\n $this->assertEquals($firstDate, $actualFirstDate);\n $this->assertEquals($lastDate, $actualLastDate);\n $this->assertEquals($numbers, $actualNumbers);\n })\n ->between($count, $count);\n }", "#[@test, @limit(time= 0.010)]\n public function timeouts() {\n $start= gettimeofday();\n $end= (1000000 * $start['sec']) + $start['usec'] + 1000 * 50; // 0.05 seconds\n do {\n $now= gettimeofday();\n } while ((1000000 * $now['sec']) + $now['usec'] < $end);\n }", "function any(array $functions): Closure\n{\n return function ($value) use ($functions) {\n return array_reduce(\n $functions,\n function ($current, $function) use ($value) {\n return $current || $function($value);\n },\n false\n );\n };\n}", "public function sendSingleVoiceTtsAsync(\\Infobip\\Model\\CallsSingleBody $callsSingleBody): PromiseInterface\n {\n $request = $this->sendSingleVoiceTtsRequest($callsSingleBody);\n\n return $this\n ->client\n ->sendAsync($request)\n ->then(\n function ($response) use ($request) {\n $this->deprecationChecker->check($request, $response);\n return $this->sendSingleVoiceTtsResponse($response, $request->getUri());\n },\n function (GuzzleException $exception) {\n $statusCode = $exception->getCode();\n\n $response = ($exception instanceof RequestException) ? $exception->getResponse() : null;\n\n $exception = new ApiException(\n \"[{$statusCode}] {$exception->getMessage()}\",\n $statusCode,\n $response?->getHeaders(),\n ($response !== null) ? (string)$response->getBody() : null\n );\n\n throw $this->sendSingleVoiceTtsApiException($exception);\n }\n );\n }", "public function testDelayedRejection() {\n $promise = new \\React\\Promise\\Deferred();\n \n $task = new \\Async\\Task\\PromiseTask($promise->promise());\n \n // The task should not yet be complete\n $this->assertFalse($task->isComplete());\n \n // Reject the promise\n $promise->reject(new \\Exception(\"rejected\"));\n \n // The task should be complete with an error\n $this->assertTrue($task->isComplete());\n $this->assertTrue($task->isFaulted());\n \n // The message of the task's exception should be that given to the promise\n $this->assertEquals(\"rejected\", $task->getException()->getMessage());\n }", "public function sendMultipleVoiceTtsAsync(\\Infobip\\Model\\CallsMultiBody $callsMultiBody): PromiseInterface\n {\n $request = $this->sendMultipleVoiceTtsRequest($callsMultiBody);\n\n return $this\n ->client\n ->sendAsync($request)\n ->then(\n function ($response) use ($request) {\n $this->deprecationChecker->check($request, $response);\n return $this->sendMultipleVoiceTtsResponse($response, $request->getUri());\n },\n function (GuzzleException $exception) {\n $statusCode = $exception->getCode();\n\n $response = ($exception instanceof RequestException) ? $exception->getResponse() : null;\n\n $exception = new ApiException(\n \"[{$statusCode}] {$exception->getMessage()}\",\n $statusCode,\n $response?->getHeaders(),\n ($response !== null) ? (string)$response->getBody() : null\n );\n\n throw $this->sendMultipleVoiceTtsApiException($exception);\n }\n );\n }", "public function timers(Timers $timers = null);", "public function testCompletesWithCorrectResultWhenOneSubTaskCompletes() {\n $tasks = [new TaskStub(), new TaskStub(), new TaskStub(), new TaskStub()];\n \n $task = new \\Async\\Task\\AnyTask($tasks);\n \n $this->assertFalse($task->isComplete());\n \n // Fail a task and check that the task has not completed\n $tasks[0]->setException(new \\Exception(\"failure\"));\n $task->tick($this->getMock(\\Async\\Scheduler\\Scheduler::class));\n $this->assertFalse($task->isComplete());\n \n // Complete a task and check that the task completes successfully with\n // the correct result\n $tasks[1]->setResult(10);\n $task->tick($this->getMock(\\Async\\Scheduler\\Scheduler::class));\n \n $this->assertTrue($task->isComplete());\n $this->assertFalse($task->isFaulted());\n $this->assertEquals(10, $task->getResult());\n }", "public function Client(\n array $requests,\n $iteratorMaximum = 1\n ) {\n $multiHandle = curl_multi_init();\n \n $connections = array();\n \n foreach ($requests as $index => $requestParams) {\n list($method, $uri) = $requestParams;\n \n $connections[$index] = curl_init($uri);\n \n if (PromisePay::isDebug()) {\n fwrite(\n STDOUT,\n \"#$index => $uri added.\" . PHP_EOL\n );\n }\n \n curl_setopt($connections[$index], CURLOPT_URL, $uri);\n curl_setopt($connections[$index], CURLOPT_HEADER, true);\n curl_setopt($connections[$index], CURLOPT_RETURNTRANSFER, true);\n curl_setopt($connections[$index], CURLOPT_CUSTOMREQUEST, strtoupper($method));\n curl_setopt($connections[$index], CURLOPT_USERAGENT, 'promisepay-php-sdk/1.0');\n \n curl_setopt(\n $connections[$index],\n CURLOPT_USERPWD,\n sprintf(\n '%s:%s',\n constant(Functions::getBaseNamespace() . '\\API_LOGIN'),\n constant(Functions::getBaseNamespace() . '\\API_PASSWORD')\n )\n );\n \n curl_multi_add_handle($multiHandle, $connections[$index]);\n }\n \n $active = false;\n \n do {\n $multiProcess = curl_multi_exec($multiHandle, $active);\n } while ($multiProcess === CURLM_CALL_MULTI_PERFORM);\n \n while ($active && $multiProcess === CURLM_OK) {\n if (curl_multi_select($multiHandle) === -1) {\n // if there's a problem at the moment, delay execution\n // by 100 miliseconds, as suggested on\n // https://curl.haxx.se/libcurl/c/curl_multi_fdset.html\n \n if (PromisePay::isDebug()) {\n fwrite(\n STDOUT,\n \"Pausing for 100 miliseconds.\" . PHP_EOL\n );\n }\n \n usleep(100000);\n }\n \n do {\n $multiProcess = curl_multi_exec($multiHandle, $active);\n } while ($multiProcess === CURLM_CALL_MULTI_PERFORM);\n }\n \n foreach($connections as $index => $connection) {\n $response = curl_multi_getcontent($connection);\n \n // we're gonna separate headers and response body\n $responseHeaders = curl_getinfo($connection);\n $responseBody = trim(substr($response, $responseHeaders['header_size']));\n \n if (PromisePay::isDebug()) {\n fwrite(\n STDOUT,\n sprintf(\"#$index content: %s\" . PHP_EOL, $responseBody)\n );\n \n fwrite(\n STDOUT,\n \"#$index headers: \" . print_r($responseHeaders, true) . PHP_EOL\n );\n }\n \n $jsonArray = json_decode($responseBody, true);\n \n if (substr($responseHeaders['http_code'], 0, 1) == '2' && is_array($jsonArray)) {\n // processed successfully, remove from queue\n foreach ($requests as $index => $requestParams) {\n list($method, $url) = $requestParams;\n \n if ($url == $responseHeaders['url']) {\n if (PromisePay::isDebug()) {\n fwrite(\n STDOUT,\n \"Unsetting $index from requests.\" . PHP_EOL\n );\n }\n \n unset($requests[$index]);\n }\n }\n \n // SCENARIO #1\n // Response JSON is self-contained under a master key\n foreach (PromisePay::$usedResponseIndexes as $responseIndex) {\n if (isset($jsonArray[$responseIndex])) {\n $jsonArray = $jsonArray[$responseIndex];\n \n break;\n } else {\n unset($responseIndex);\n }\n }\n \n // SCENARIO #2\n // Response JSON is NOT self-contained under a master key\n if (!isset($responseIndex)) {\n // for these scenarios, we'll store them under their endpoint name.\n // for example, requestSessionToken() internally calls getDecodedResponse()\n // without a key param.\n $responseIndex = trim(\n parse_url($responseHeaders['url'], PHP_URL_PATH),\n '/'\n );\n \n $slashLookup = strpos($responseIndex, '/');\n \n if ($slashLookup !== false)\n $responseIndex = substr($responseIndex, 0, $slashLookup);\n }\n } else {\n if (PromisePay::isDebug()) {\n fwrite(\n STDOUT,\n 'An invalid response was received: ' . PHP_EOL . $responseBody . PHP_EOL\n );\n }\n \n // handle errors\n $responseIndex = array_keys($jsonArray);\n $responseIndex = $responseIndex[0];\n }\n \n $this->responses[$responseIndex][] = $jsonArray;\n \n $this->storageHandler->storeJson($jsonArray);\n $this->storageHandler->storeMeta(PromisePay::getMeta($jsonArray));\n $this->storageHandler->storeLinks(PromisePay::getLinks($jsonArray));\n $this->storageHandler->storeDebug($responseHeaders);\n \n unset($responseIndex);\n \n curl_multi_remove_handle($multiHandle, $connection);\n }\n \n curl_multi_close($multiHandle);\n \n $this->pendingRequestsHistoryCounts[] = count($requests);\n \n if (PromisePay::isDebug()) {\n fwrite(\n STDOUT,\n sprintf(\n \"responses contains %d members.\" . PHP_EOL,\n count($this->responses)\n )\n );\n }\n \n // if a single request hasn't succeeded in the past 2 request batches,\n // terminate and return result.\n foreach ($this->pendingRequestsHistoryCounts as $index => $pendingRequestsCount) {\n if ($index === 0) continue;\n \n if ($this->pendingRequestsHistoryCounts[$index - 1] == $pendingRequestsCount) {\n if (PromisePay::isDebug()) {\n fwrite(\n STDOUT,\n 'Server 5xx detected; returning what was obtained thus far.' . PHP_EOL\n );\n }\n \n return $this->storageHandler;\n }\n }\n \n $this->iteratorCount++;\n \n if (empty($requests) || $this->iteratorCount >= $iteratorMaximum) {\n return $this->storageHandler;\n }\n \n if (PromisePay::isDebug()) {\n fwrite(STDOUT, PHP_EOL . '<<STARTING RECURSIVE CALL>>' . PHP_EOL);\n \n fwrite(\n STDOUT,\n 'REMAINING REQUESTS: ' . print_r($requests, true) .\n PHP_EOL .\n 'PROCESSED RESPONSES: ' . print_r($this->responses, true)\n );\n }\n \n return $this->Client($requests);\n }", "public function assert_positive($times)\n\t\t{\n\t\t\t# If size of times array is uneven, last action is clock in\n\t\t\t# Should not and cannot be compared with a clock out; validate elsewhere\n\t\t\t$periods = sizeof($times) - sizeof($times) % 2;\n\n\t\t\tfor($i = 0; $i < $periods; $i += 2)\n\t\t\t\tif($this->time_delta($times[$i], $times[$i + 1]) <= 0)\n\t\t\t\t\treturn false;\n\n\t\t\treturn true;\n\t\t}", "function retry($times, callable $callback, int $sleep = 0)\n{\n $attempts = 0;\n $backoff = new Backoff($sleep);\n\n beginning:\n try {\n return $callback(++$attempts);\n } catch (Throwable $e) {\n if (--$times < 0) {\n throw $e;\n }\n\n $backoff->sleep();\n goto beginning;\n }\n}", "public function shouldRejectWithoutCreatingGarbageCyclesIfCancellerWithReferenceThrowsException(): void\n {\n gc_collect_cycles();\n /** @var Promise<never> $promise */\n $promise = new Promise(function () {}, function () use (&$promise) {\n assert($promise instanceof Promise);\n throw new \\Exception('foo');\n });\n $promise->cancel();\n unset($promise);\n\n $this->assertSame(0, gc_collect_cycles());\n }", "public function findByPendingCallNotifications() {\n\t\t$callTolerence = 10;\n\t\t$callTolerenceTime = mktime(date(\"H\"), date(\"i\")+$callTolerence, 0, date(\"m\"), date(\"d\"), date(\"Y\"));\n\t\t$query = 'SELECT n FROM AcmeTaskBundle:Notification n WHERE n.datetime <= :callTolerenceTime AND n.push = 1 AND n.pushConfirm = 0 AND n.sms = 0 AND n.voicecall = 0 ORDER BY n.datetime';\n\t\t\n\t\ttry{\n\t\t\treturn $this->getEntityManager()\n\t\t\t\t->createQuery($query)\n\t\t\t\t->setParameter('callTolerenceTime', $callTolerenceTime)\n\t\t\t\t->getResult();\n\t\t} catch (\\Doctrine\\ORM\\NoResultException $e) {\n return null;\n \t}\n\t}", "public function waitAndAllow($string,$timeOut=300)\n\t{\n\t\t$allow=$this->isLock($string);\n\t\tif($allow==1) {\n\t\t\t$this->getLock($string);\n\t\t\treturn $allow; }\n\t\telse{\n\t\t\tif($string) {\n\t\t\tset_time_limit(3600);\n\t\t\t$allow=0;\n\t\t\t$phase1_microSec=rand(100,200);\n\t\t\t$phase1_limit=rand(16000,17000);\n\t\t\tfor($i=0;$i<$phase1_limit;$i++){\n\t\t\t\t$allow=$this->isLock($string);\n\t\t\t\tif($allow==1){ $this->getLock($string,$timeOut);\n\t\t\t\t\treturn $allow;}\n\t\t\t\telse usleep($phase1_microSec);}\n\t\t\t$phase2_microSec=rand(10,50);\n\t\t\t$phase2_limit=rand(12000,13000);\n\t\t\tfor($i=0;$i<$phase2_limit;$i++){\n\t\t\t\t$allow=$this->isLock($string);\n\t\t\t\tif($allow==1){ $this->getLock($string,$timeOut);\n\t\t\t\t\treturn $allow;}\n\t\t\t\telse usleep($phase2_microSec);}\n\t\t\t$phase3_microSec=rand(1,10);\n\t\t\t$phase3_limit=rand(10000,11000);\n\t\t\tfor($i=0;$i<$phase3_limit;$i++){\n\t\t\t\t$allow=$this->isLock($string);\n\t\t\t\tif($allow==1){ $this->getLock($string,$timeOut);\n\t\t\t\treturn $allow;}\n\t\t\t\telse usleep($phase3_microSec);}\n\t\t\t}\n\t\t\telse\n\t\t\t\techo \"No String passed to check lock status\";\n\t\t}\n\t\treturn $allow;\n\t}", "public function ConcurrentRequestsUsingPromise()\n {\n CalcTime::start();\n\n $client = new Client(['base_uri' => 'https://www.yundun.com']);\n\n // Initiate each request but do not block\n $promises = [\n 'friendlink' => $client->getAsync('/api/V4/site.friendlink'),\n 'report' => $client->getAsync('/api/V4/site.today.report.allplat')\n ];\n\n // Wait on all of the requests to complete. Throws a ConnectException\n // if any of the requests fail\n try {\n $results = Promise\\unwrap($promises);\n echo $results['friendlink']->getBody();\n echo \"\\n\";\n echo $results['report']->getBody();\n } catch (\\Exception $e) {\n var_dump($e->getMessage());\n }\n\n // Wait for the requests to complete, even if some of them fail\n $results = Promise\\settle($promises)->wait();\n\n // You can access each result using the key provided to the unwrap\n // function.\n echo $results['friendlink']['value']->getHeader('Content-Length')[0];\n echo $results['report']['value']->getHeader('Content-Length')[0];\n\n CalcTime::end();\n CalcTime::echoUseTime(__FUNCTION__);\n }", "protected function _setTimeouts($array){\n\t\t// Defaults timeout\n\t\t$this->_timeouts=array('connection' => array('sec' => self::DEFAULT_CONNECTION_TIMEOUT_SEC, 'usec' => self::DEFAULT_CONNECTION_TIMEOUT_USEC),\n\t\t\t\t'read' => array('sec' => self::DEFAULT_READ_TIMEOUT_SEC, 'usec' => self::DEFAULT_READ_TIMEOUT_USEC),\n\t\t\t\t'write' => array('sec' => self::DEFAULT_WRITE_TIMEOUT_SEC, 'usec' => self::DEFAULT_WRITE_TIMEOUT_USEC));\n\t\t// Detect errors\n\t\tif (empty($array)){\n\t\t\treturn TRUE; // We have nothing to do, so we quit\n\t\t}\n\t\telseif (!is_array($array)){\n\t\t\t$trace = debug_backtrace();\n\t\t\t$errorMessage = 'Argument 4 for SpykeeControllerClient::__construct() have to be an array, called in'\n\t\t\t\t\t.$trace[0]['file'].' on line '.$trace[0]['line'];\n\t\t\tthrow new ExeceptionSpykee('Unable to launch Spykee Script', $errorMessage);\n\t\t}\n\t\t\n\t\t// Set timeouts\n\t\tif(!empty($array['connection'])){\n\t\t\tif ($this->_timeouts['connection']['usec'] >= 1000){\n\t\t\t\t$trace = debug_backtrace();\n\t\t\t\t$errorMessage = 'Argument 4 for SpykeeControllerClient::__construct() usec have to be less than 1000 else add 1 to the sec, called in'\n\t\t\t\t\t\t.$trace[0]['file'].' on line '.$trace[0]['line'];\n\t\t\t\tthrow new ExeceptionSpykee('Unable to launch Spykee Script', $errorMessage);\n\t\t\t}\n\t\t\t$this->_timeouts['connection']['sec'] = (!empty($array['connection']['sec'])) ? $array['connection']['sec'] : 0;\n\t\t\t$this->_timeouts['connection']['sec'] = (!empty($array['connection']['usec'])) ? $array['connection']['usec'] : 0;\n\t\t}\n\t\tif (!empty($array['read'])){\n\t\t\tif ($this->_timeouts['read']['usec'] >= 1000){\n\t\t\t\t$trace = debug_backtrace();\n\t\t\t\t$errorMessage = 'Argument 4 for SpykeeControllerClient::__construct() usec have to be less than 1000 else add 1 to the sec, called in'\n\t\t\t\t\t\t.$trace[0]['file'].' on line '.$trace[0]['line'];\n\t\t\t\tthrow new ExeceptionSpykee('Unable to launch Spykee Script', $errorMessage);\n\t\t\t}\n\t\t\t$this->_timeouts['read']['sec'] = (!empty($array['read']['sec'])) ? $array['read']['sec'] : 0;\n\t\t\t$this->_timeouts['read']['sec'] = (!empty($array['read']['usec'])) ? $array['read']['usec'] : 0;\n\t\t}\n\t\tif (!empty($array['write'])){\n\t\t\tif ($this->_timeouts['write']['usec'] >= 1000){\n\t\t\t\t$trace = debug_backtrace();\n\t\t\t\t$errorMessage = 'Argument 4 for SpykeeControllerClient::__construct() usec have to be less than 1000 else add 1 to the sec, called in'\n\t\t\t\t\t\t.$trace[0]['file'].' on line '.$trace[0]['line'];\n\t\t\t\tthrow new ExeceptionSpykee('Unable to launch Spykee Script', $errorMessage);\n\t\t\t}\n\t\t\t$this->_timeouts['write']['sec'] = (!empty($array['write']['sec'])) ? $array['write']['sec'] : 0;\n\t\t\t$this->_timeouts['write']['sec'] = (!empty($array['write']['usec'])) ? $array['write']['usec'] : 0;\n\t\t}\n\t\treturn TRUE;\n\t}", "public function timeout($timesecs);", "protected function scheduleEntitiesSync(array $entities)\n {\n foreach ($entities as $entity) {\n if (!$this->isSyncRequired($entity)) {\n continue;\n }\n\n $entityToSync = $this->getIntegrationEntityToSync($entity);\n if ($entityToSync && $this->isIntegrationEntityValid($entityToSync)) {\n $this->tryScheduleSync($entityToSync);\n }\n }\n }", "public function send($requests)\n {\n $curlMulti = $this->getCurlMulti();\n $multipleRequests = is_array($requests);\n if (!$multipleRequests) {\n $requests = array($requests);\n }\n\n foreach ($requests as $request) {\n $curlMulti->add($request);\n }\n\n try {\n $curlMulti->send();\n } catch (ExceptionCollection $e) {\n throw $multipleRequests ? $e : $e->getIterator()->offsetGet(0);\n }\n\n if (!$multipleRequests) {\n return end($requests)->getResponse();\n }\n\n return array_map(function($request) {\n return $request->getResponse();\n }, $requests);\n }", "public function wait(int $timeout = 0) : bool{}", "protected function _treatFirstDigitTimeoutOption( $firstDigitTimeout = null )\n {\n if ( null === $firstDigitTimeout ) {\n throw new Exception( sprintf( 'Required option \"%s\" not provided', self::OPT_FIRST_DIGIT_TIMEOUT ) );\n }\n\n if ( is_int( $firstDigitTimeout ) ) {\n $firstDigitTimeout = (float)$firstDigitTimeout;\n } elseif ( is_string( $firstDigitTimeout ) && preg_match( '~^(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?$~', $firstDigitTimeout ) === 1 ) {\n trigger_error( sprintf( 'Unexpected data type for option \"%s\". Value will be automatically converted to float', self::OPT_FIRST_DIGIT_TIMEOUT ) );\n $firstDigitTimeout = (float)$firstDigitTimeout;\n }\n\n if ( !is_float( $firstDigitTimeout ) ) {\n throw new Exception( sprintf( 'Option \"%s\" was provided with an invalid value', self::OPT_FIRST_DIGIT_TIMEOUT ) );\n }\n\n $this->_options[self::OPT_FIRST_DIGIT_TIMEOUT] = $firstDigitTimeout;\n }", "private function check()\n {\n foreach ($this->scheduler->getQueuedJobs() as $job) {\n if ($job->isDue(new DateTime()) === true) {\n\n $this->executeIfNotOverlapped($job);\n }\n }\n }", "public function pollFirst();", "public function resolveParameters( array $parameters )\n {\n $arguments = [];\n foreach ( $parameters as $parameter ) {\n\n if ( $parameter->getClass() ) {\n $arguments[] = $this->container->get( $parameter->getClass()->getName() );\n } else if ( $parameter->isDefaultValueAvailable() ) {\n $arguments[] = $parameter->getDefaultValue();\n } else {\n throw new AmbiguousParameterException;\n }\n }\n\n return $arguments;\n }", "public static function RunDueTasks(){\n $query = new Query();\n \n //this filtering cold/should perhaps be one filter in TaskFinder, but for this challenge lets just be verbose\n $query->addFilter(\n TaskFinder::getMultipleStatusFilter(\n \\CodeChallenge\\Models\\Task::STATUS_TO_BE_EXECUTED, \n \\CodeChallenge\\Models\\Task::STATUS_FOR_RETRY \n )\n );\n $now = new \\DateTime();\n $in_a_minute = new \\DateTime();\n $in_a_minute->add(new \\DateInterval('P60S')); //This period is dependent on the interval between runs\n $query->addFilter(\n TaskFinder::getExecutionTimeBetweenFilter(\n $now,\n $in_a_minute\n )\n );\n \n $due_tasks = TaskFinder::find($query);\n foreach($due_tasks as $due_task){\n $due_task->setStatusToInPipeLine();\n $now = new \\DateTime();\n $execution_time = $due_task->getExecutionTime();\n $time_to_run = $now->diff($execution_time);\n $worker = new Worker($due_task);//The worker should thread out somehow, so that we can be sure the whole list of tasks can be traversed before the execution_time is reached\n if($time_to_run->format('s') < 2){//Again dependent on that no more than 60 is returned, otherwise this will be unpredictable\n $worker->runNow();\n }\n else{\n $worker->runIn($time_to_run);\n }\n }\n }", "public function testPollTimeOut() {\n $c = new _MockProviderCronRunner(50, 0.0001);\n $provider = $this->createMock(ProviderInterface::class);\n $polling = $this->createMock(PollingInterface::class);\n $provider->method('polling')->willReturn($polling);\n $polling->expects($this->once())->method('poll')->will($this->returnCallback(function () {\n usleep(101);\n return TRUE;\n }));\n $c->providers = [$provider];\n $start = microtime(TRUE);\n $c->poll();\n $this->assertLessThan(1, microtime(TRUE) - $start);\n }", "public function iWaitForSeconds($seconds) {\n sleep($seconds);\n }", "public function getMultiple(array $keys, $default = null)\n {\n if (is_callable([$this->interface, 'getMultiple'])) {\n $handleValue = function ($values) {\n foreach ($values as $key => &$value) {\n if (null === $value) {\n unset($this->items[$key]);\n } else {\n $value = $this->items[$key] = $this->unserializer($value);\n }\n }\n\n return $values;\n };\n\n try {\n $result = $this->interface->getMultiple(array_map(fn ($key) => $this->prefix.$key, $keys), $default);\n } catch (Throwable $throwable) {\n return reject($throwable);\n }\n\n if ($result instanceof PromiseInterface) {\n return $result->then($handleValue);\n }\n\n return resolve($handleValue($result));\n }\n\n $promises = [];\n\n foreach ($keys as $key) {\n $promises[$key] = $this->get($key, $default);\n }\n\n return all($promises);\n }", "public function wait($wait = -1) {}", "public function testTickNoop() {\n $promise = new \\React\\Promise\\Deferred();\n \n $task = new \\Async\\Task\\PromiseTask($promise->promise());\n \n // The task should not yet be complete\n $this->assertFalse($task->isComplete());\n \n // Tick a few times\n $task->tick($this->getMock(\\Async\\Scheduler\\Scheduler::class));\n $task->tick($this->getMock(\\Async\\Scheduler\\Scheduler::class));\n $task->tick($this->getMock(\\Async\\Scheduler\\Scheduler::class));\n \n // The task should not have completed\n $this->assertFalse($task->isComplete());\n \n // Resolve the promise\n $promise->resolve(\"resolved\");\n \n // The task should be complete with no error\n $this->assertTrue($task->isComplete());\n $this->assertFalse($task->isFaulted()); \n // The result of the task should be the promise result\n $this->assertEquals(\"resolved\", $task->getResult());\n \n // Tick a few more times\n $task->tick($this->getMock(\\Async\\Scheduler\\Scheduler::class));\n $task->tick($this->getMock(\\Async\\Scheduler\\Scheduler::class));\n $task->tick($this->getMock(\\Async\\Scheduler\\Scheduler::class));\n \n // Verify that the result is unchanged\n $this->assertTrue($task->isComplete());\n $this->assertFalse($task->isFaulted()); \n // The result of the task should be the promise result\n $this->assertEquals(\"resolved\", $task->getResult());\n }", "public function requests($urls, array $params = array())\n {\n foreach ($urls as $url) {\n $result = $this->requestOne($url, $params);\n\n if ($result) {\n return $result;\n } elseif ($this->sender->shouldRetry() == false) {\n return false;\n }\n }\n\n return false;\n }", "public function then(\n callable $doneFilter = NULL,\n callable $failFilter = NULL,\n callable $progressFilter = NULL\n ): PromiseLike {\n $defer = new Deferred();\n $this->done(\n function (...$arguments) use ($defer, $doneFilter) {\n $this->callFilter($doneFilter, [$defer, 'resolve'], $arguments);\n }\n );\n $this->fail(\n function (...$arguments) use ($defer, $failFilter) {\n $this->callFilter($failFilter, [$defer, 'reject'], $arguments);\n }\n );\n $this->progress(\n function (...$arguments) use ($defer, $progressFilter) {\n $this->callFilter($progressFilter, [$defer, 'notify'], $arguments);\n }\n );\n return $defer->promise();\n }", "public function testFindByTimeRangeFuture()\n\t{\n\t\t$dt = new \\DateTime();\n\t\t$dt->setTimestamp(time() + 1000);\n\t\t$dt2 = new \\DateTime();\n\t\t$dt2->setTimestamp(time() + 2000);\n\n\t\t$time_range = new TimeRange($dt, $dt2);\n\t\t$position = $this->dpm->findByTimeRange($time_range);\n\t\t$this->assertNotNull($position);\n\t\t$this->assertEquals(0, count($position));\n\t}", "public function then(\n ?callable $onFulfilled = null,\n ?callable $onRejected = null\n ): static;", "public function wait($seconds=1)\n {\n usleep($seconds*100000);\n return $this;\n }", "function getConflicts($resourceIds, \\Kaltura\\Client\\Plugin\\Schedule\\Type\\ScheduleEvent $scheduleEvent, $scheduleEventIdToIgnore = null, $scheduleEventConflictType = 1)\n\t{\n\t\t$kparams = array();\n\t\t$this->client->addParam($kparams, \"resourceIds\", $resourceIds);\n\t\t$this->client->addParam($kparams, \"scheduleEvent\", $scheduleEvent->toParams());\n\t\t$this->client->addParam($kparams, \"scheduleEventIdToIgnore\", $scheduleEventIdToIgnore);\n\t\t$this->client->addParam($kparams, \"scheduleEventConflictType\", $scheduleEventConflictType);\n\t\t$this->client->queueServiceActionCall(\"schedule_scheduleevent\", \"getConflicts\", \"KalturaScheduleEventListResponse\", $kparams);\n\t\tif ($this->client->isMultiRequest())\n\t\t\treturn $this->client->getMultiRequestResult();\n\t\t$resultXml = $this->client->doQueue();\n\t\t$resultXmlObject = new \\SimpleXMLElement($resultXml);\n\t\t$this->client->checkIfError($resultXmlObject->result);\n\t\t$resultObject = \\Kaltura\\Client\\ParseUtils::unmarshalObject($resultXmlObject->result, \"KalturaScheduleEventListResponse\");\n\t\t$this->client->validateObjectType($resultObject, \"\\\\Kaltura\\\\Client\\\\Plugin\\\\Schedule\\\\Type\\\\ScheduleEventListResponse\");\n\t\treturn $resultObject;\n\t}", "public function execute($function, $parameters = array())\n {\n $returnValue = null;\n\n for ($retriesLeft = $this->_retryCount; $retriesLeft >= 0; --$retriesLeft) {\n try {\n $returnValue = call_user_func_array($function, $parameters);\n return $returnValue;\n } catch (\\Exception $ex) {\n if ($retriesLeft == 1) {\n throw new Exception\\ExcessiveRetrievesException(\n 'Exceeded retry count of ' . $this->_retryCount\n . '. ' . $ex->getMessage()\n );\n }\n\n usleep($this->_retryInterval * 1000);\n }\n }\n }", "protected function cancelPayments()\n {\n $i = 0;\n $sql = \"SELECT `vendorTxCode` FROM payment WHERE status = ? AND \" .\n \"((cardType='MAESTRO' AND created <= ?) OR created <= ?)\";\n $params = array(SAGEPAY_REMOTE_STATUS_AUTHENTICATED, date('Y-m-d H:i:s', strtotime('-30 days')), date('Y-m-d H:i:s',\n strtotime('-90 days')));\n $cancelStatus = array('Status' => SAGEPAY_REMOTE_STATUS_CANCELLED);\n\n $payment = new ModelPayment();\n $paymentStm = $this->dbHelper->execute($sql, $params);\n if (!$paymentStm)\n {\n exit('Invalid query');\n }\n $payments = $paymentStm->fetchAll(PDO::FETCH_ASSOC);\n foreach ($payments as $row)\n {\n if ($payment->update($row['vendorTxCode'], $cancelStatus))\n {\n $i++;\n }\n }\n printf('Updated %d payments', $i);\n }", "public function awaitPendingPublishConfirms(int $timeout = 0): void\n {\n $this->getChannel()->wait_for_pending_acks($timeout);\n }", "public function execute(array $values = []) : array {\n foreach($this->_queries as $q) {\n if(!$q->executed()) {\n // build query string\n $query = $q->build();\n // get from cache if available\n if(isset($this->_cache)) {\n $expired = false;\n $data = $this->_cache->get($query, $expired);\n // if empty? return synchronously\n if(empty($data)) {\n $data = $q->execute($values);\n $this->_cache->set($query, $data);\n return $data;\n }\n // if expired call for update and return cached data\n if($expired) {\n $this->_cache->update($q, $values);\n }\n $q->cached();\n return $data;\n }\n // no cache, synchronously execute\n return $q->execute($values);\n }\n }\n return [];\n }", "public function testFailsWhenAllSubTasksFail() {\n $tasks = [new TaskStub(), new TaskStub(), new TaskStub(), new TaskStub()];\n \n $task = new \\Async\\Task\\AnyTask($tasks);\n \n // Fail each subtask in turn, checking that the task is not yet complete\n $i = 0;\n foreach( $tasks as $subTask ) {\n $i++;\n $this->assertFalse($task->isComplete());\n $subTask->setException(new \\Exception(\"failure $i\"));\n $task->tick($this->getMock(\\Async\\Scheduler\\Scheduler::class));\n }\n \n // Check that the task is now complete with an error\n $this->assertTrue($task->isComplete());\n $this->assertTrue($task->isFaulted());\n $this->assertInstanceOf(\n \\Async\\Task\\MultipleFailureException::class, $task->getException()\n );\n $this->assertContains('4 tasks failed', $task->getException()->getMessage());\n $this->assertEquals(\n [\n 0 => new \\Exception(\"failure 1\"),\n 1 => new \\Exception(\"failure 2\"),\n 2 => new \\Exception(\"failure 3\"),\n 3 => new \\Exception(\"failure 4\")\n ],\n $task->getException()->getFailures()\n );\n }", "public function wait(): array;", "protected function resolveExactCondition($fields, $inputs)\n\t{\n\t\tif (! count($inputs)) return null;\n\n\t\t$bindings = [];\n\t\t$values = implode(' OR ', array_map(function ($field) use ($inputs, &$bindings) {\n\t\t\treturn implode(', ', array_map(function ($input, $index) use ($field, &$bindings) {\n\t\t\t\t$bindings[\"{$field}{$index}\"] = $input;\n\t\t\t\treturn \":{$field}{$index}\";\n\t\t\t}, $inputs, array_keys($inputs)));\n\t\t}, $fields));\n\n\t\treturn [ $this->quote($field) . \" IN ({$values})\", $bindings ];\n\t}", "public function runJobs($jobs)\n\t{\n\t\tforeach ($jobs as $job) {\n\t\t\tApp::getDb()->avoidTimeout();\n\t\t\t$this->runJob($job);\n\t\t\tif ($this->halt_job_loop) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}", "private function mockCoursePossible(Teacher $teacher, Date $firstDate, Date $lastDate = null, $numbers = [1], $count = 1) {\n if (!$this->courseService) {\n $this->createService(true);\n }\n\n $this->courseService->shouldReceive('coursePossible')\n ->andReturnUsing(function($actualTeacher, $actualFirstDate, $actualLastDate, $actualNumbers) use ($teacher, $firstDate, $lastDate, $numbers) {\n $this->assertSame($teacher, $actualTeacher);\n $this->assertEquals($firstDate, $actualFirstDate);\n $this->assertEquals($lastDate, $actualLastDate);\n $this->assertEquals($numbers, $actualNumbers);\n })\n ->between($count, $count);\n }", "public function waitFor($timeout, $callback)\n {\n if (!is_callable($callback)) {\n throw new \\InvalidArgumentException('Given callback is not a valid callable');\n }\n\n $start = microtime(true);\n $end = $start + $timeout / 1000.0;\n\n do {\n $result = call_user_func($callback, $this);\n\n if ($result) {\n break;\n }\n\n usleep(100000);\n } while (microtime(true) < $end);\n\n return $result;\n }", "public static function oneClickTokenCancelAll(array $data = array())\n\t{\n\t\ttry {\n\t\t\t$oneClickTokenCancelAllResponse = \\BigFish\\PaymentGateway::oneClickTokenCancelAll(new \\BigFish\\PaymentGateway\\Request\\OneClickTokenCancelAll($data['providerName'], $data['userId']));\n\n\t\t\treturn $oneClickTokenCancelAllResponse;\n\t\t} catch (\\BigFish\\PaymentGateway\\Exception $e) {\n\t\t\treturn $e->getMessage();\n\t\t}\n\t}", "public function askMultiselectChoice(string $question, array $choices, $default, int $attempts = self::INFINITE_ATTEMPTS): array;", "static public function first ($this1, $other) {\n\t\t#/home/grabli66/haxelib/tink_core/git/src/tink/core/Future.hx:19: characters 5-32\n\t\t$ret = new FutureTrigger();\n\t\t#/home/grabli66/haxelib/tink_core/git/src/tink/core/Future.hx:20: characters 5-39\n\t\t$l1 = $this1->handle(Boot::getInstanceClosure($ret, 'trigger'));\n\t\t#/home/grabli66/haxelib/tink_core/git/src/tink/core/Future.hx:21: characters 5-40\n\t\t$l2 = $other->handle(Boot::getInstanceClosure($ret, 'trigger'));\n\t\t#/home/grabli66/haxelib/tink_core/git/src/tink/core/Future.hx:22: characters 5-30\n\t\t$ret1 = $ret;\n\t\t#/home/grabli66/haxelib/tink_core/git/src/tink/core/Future.hx:23: lines 23-24\n\t\tif ($l1 !== null) {\n\t\t\t#/home/grabli66/haxelib/tink_core/git/src/tink/core/Future.hx:24: characters 18-20\n\t\t\t$this2 = $l1;\n\t\t\t#/home/grabli66/haxelib/tink_core/git/src/tink/core/Future.hx:24: characters 7-21\n\t\t\t$ret1->handle(function ($_) use (&$this2) {\n\t\t\t\t#/home/grabli66/haxelib/tink_core/git/src/tink/core/Future.hx:24: characters 18-20\n\t\t\t\t$this2->cancel();\n\t\t\t});\n\t\t}\n\t\t#/home/grabli66/haxelib/tink_core/git/src/tink/core/Future.hx:25: lines 25-26\n\t\tif ($l2 !== null) {\n\t\t\t#/home/grabli66/haxelib/tink_core/git/src/tink/core/Future.hx:26: characters 18-20\n\t\t\t$this3 = $l2;\n\t\t\t#/home/grabli66/haxelib/tink_core/git/src/tink/core/Future.hx:26: characters 7-21\n\t\t\t$ret1->handle(function ($_1) use (&$this3) {\n\t\t\t\t#/home/grabli66/haxelib/tink_core/git/src/tink/core/Future.hx:26: characters 18-20\n\t\t\t\t$this3->cancel();\n\t\t\t});\n\t\t}\n\t\t#/home/grabli66/haxelib/tink_core/git/src/tink/core/Future.hx:27: characters 5-15\n\t\treturn $ret1;\n\t}", "public function test_pay_calledWithSeveralPaymentsProviders_returnPaymentProviderResultFalse()\n {\n $expected = new RoyalPayPaymentProvider(new RoyalPayConfig('',''));\n $paymentsCollection = new PaymentsCollection();\n $wirecardStrategy = $this->prophesize('EuroMillions\\web\\services\\card_payment_providers\\WideCardPaymentStrategy');\n $wirecardProvider = $this->prophesize('EuroMillions\\web\\services\\card_payment_providers\\WideCardPaymentProvider');\n $royalPayStrategy = $this->prophesize('EuroMillions\\web\\services\\card_payment_providers\\RoyalPayPaymentStrategy');\n $royalPayProvider = $this->prophesize('EuroMillions\\web\\services\\card_payment_providers\\RoyalPayPaymentProvider');\n $paymentsCollection->addItem('WideCardPaymentStrategy', $wirecardStrategy->reveal());\n $paymentsCollection->addItem('RoyalPayPaymentStrategy', $royalPayStrategy->reveal());\n $user = UserMother::aUserWith50Eur()->build();\n $order = OrderMother::aJustOrder()->buildANewWay();\n $credit_card = CreditCardMother::aValidCreditCard();\n $wirecardStrategy->get()->willReturn($wirecardProvider);\n $wirecardProvider->getName()->willReturn('wirecard');\n $wirecardProvider->charge(Argument::any())->willReturn(new PaymentProviderResult(false));\n $royalPayStrategy->get()->willReturn($royalPayProvider);\n $royalPayProvider->getName()->willReturn('royalpay');\n $royalPayProvider->charge(Argument::any())->willReturn(new PaymentProviderResult(false));\n $sut = new WalletService($this->getEntityManagerRevealed(), $this->currencyConversionService_double->reveal(),$this->transactionService_double->reveal());\n $actual = $sut->payFromProviderCollections($paymentsCollection,$user,$order,$credit_card);\n $this->assertEquals(false,$actual->success());\n }", "public function kill_time($times)\n {\n $times = $_POST['kill'];\n \n foreach ($times as $key => $value)\n {\n $q = $this->db->prepare(\"delete from CanWork where empID = ? and dateTime = ?\");\n $q->bind_param('ss', $value, $key);\n $q->execute();\n \n $next_time = $key;\n \n while (true)\n {\n $dt = new DateTime($next_time);\n $dt->modify('+'.MINIMUM_INTERVAL.' minutes');\n $next_time = $dt->format(\"Y-m-d H:i:s\");\n $q = $this->db->prepare(\"select * from CanWork where empID = ? and dateTime = ?\");\n $q->bind_param('ss', $value, $next_time);\n $q->execute();\n $result = $q->get_result();\n\n if (mysqli_num_rows($result) > 0) \n {\n $q = $this->db->prepare(\"delete from CanWork where empID = ? and dateTime = ?\");\n $q->bind_param('ss', $value, $next_time);\n $q->execute();\n }\n else\n break;\n }\n }\n }", "public function expect(int $timeout = null): self {\n\t\treturn $this->acquire($timeout);\n\t}", "private function waitForUnlocking()\n\t{\n\t\t$times = self::LOCK_TTL;\n\t\t$i = 0;\n\t\twhile ($this->isExecutionLocked() && $i < $times)\n\t\t{\n\t\t\tsleep(1);\n\t\t\t$i++;\n\t\t}\n\t}", "function cancelPending() {\n\t\tself::$_db->saveQry(\"SELECT `ID` FROM `#_reservations` \".\n\t\t\t\t\"WHERE (`status` = 'pending' OR `status` = 'prefered') \".\n\t\t\t\t\"AND ? >= `startTime` \",\n\t\t\t\tCalendar::startCancel());\n\t\t\n\n\t\twhile($res = self::$_db->fetch_assoc())\n\t\t\tReservation::load($res['ID'])->failed();\n\t\t\n\t\t\n\t\t// TagesEnde - BuchungsCancelZeit ist kleiner als Aktueller Zeitblock\n\t\tif(Calendar::calculateTomorrow()) {\n\t\t\t$opening = Calendar::opening(date('Y-m-d', strtotime(\"tomorrow\")));\n\t\t\tself::$_db->saveQry(\"SELECT * FROM `#_reservations` \".\n\t\t\t\t\t\"WHERE (`status` = 'pending' OR `status` = 'prefered') \".\n\t\t\t\t\t\"AND ? <= `startTime` AND `startTime` <= ? \",\n\t\t\t\t\t$opening->format(\"Y-m-d H:i\"), \n\t\t\t\t\tCalendar::startCancel($opening));\n\t\t\t\n\t\t\twhile($res = self::$_db->fetch_assoc())\n\t\t\t\tReservation::load($res['ID'])->failed();\n\t\t}\n\t\t\n\t}", "public function firstOrFail($columns = ['*'])\n {\n $results = $this->entity->firstOrFail($columns);\n\n $this->reset();\n\n return $results;\n }", "public static function combine(...$callables) : Closure\n {\n return function (...$args) use ($callables) {\n $results = [];\n foreach ($callables as $callable) {\n $results[] = $callable(...$args);\n }\n return $results;\n };\n }", "public function test_pay_calledWithSeveralPaymentsProviders_returnTheSecondPaymentProviderInCollection()\n {\n $expected = new RoyalPayPaymentProvider(new RoyalPayConfig('',''));\n list($paymentsCollection, $wirecardStrategy, $wirecardProvider, $royalPayStrategy, $royalPayProvider, $user, $order, $credit_card) = $this->preparePaymentsCollection();\n $wirecardStrategy->get()->willReturn($wirecardProvider);\n $wirecardProvider->getName()->willReturn('wirecard');\n $wirecardProvider->charge(Argument::any())->willReturn(new PaymentProviderResult(false));\n $royalPayStrategy->get()->willReturn($royalPayProvider);\n $royalPayProvider->getName()->willReturn('royalpay');\n $royalPayProvider->charge(Argument::any())->willReturn(new PaymentProviderResult(true, $expected));\n $sut = new WalletService($this->getEntityManagerRevealed(), $this->currencyConversionService_double->reveal(),$this->transactionService_double->reveal());\n $actual = $sut->payFromProviderCollections($paymentsCollection,$user,$order,$credit_card);\n $this->assertInstanceOf('EuroMillions\\web\\services\\card_payment_providers\\RoyalPayPaymentProvider',$actual->returnValues());\n }", "public function resolveCommands($commands)\n {\n $commands = is_array($commands) ? $commands : func_get_args();\n\n foreach ($commands as $command) {\n $this->resolve($command);\n }\n }", "public function resolveCommands($commands)\r\n {\r\n $commands = is_array($commands) ? $commands : func_get_args();\r\n\r\n foreach ($commands as $command) {\r\n $this->resolve($command);\r\n }\r\n }", "public function checkScheduledTasks() {\n if (count($this->defaultTasks)) {\n $now = DBDatetime::now()->Format(DBDatetime::ISO_DATETIME);\n\n foreach ($this->defaultTasks as $task => $method) {\n $state = SqsQueueState::get()->filter('Title', $task)->first();\n\n $new = false;\n if (!$state) {\n $state = SqsQueueState::create(array(\n 'Title' => $task\n ));\n $new = true;\n $state->write();\n }\n\n // let's see if the dates are okay.\n $lastQueueRun = strtotime($state->WorkerRun);\n $lastScheduleRun = strtotime($state->LastScheduledStart);\n $lastAdded = strtotime($state->LastAddedScheduleJob);\n\n $a = $state->WorkerRun;\n $b = $state->LastScheduledStart;\n\n // if the last time it was added is more than 10 minutes ago, AND\n // the last run is more than 10 minutes since it was last started OR it's new OR it was last run more than 15 minutes ago\n if ((time() - $lastAdded > 600) && ((($lastQueueRun - $lastScheduleRun) > 600) || $new || (time() - $lastQueueRun > 900))) {\n $state->LastAddedScheduleJob = $now;\n $state->write();\n $this->sendSqsMessage($task, $method);\n }\n }\n }\n }", "public function wait($timeout = null)\r\n {\r\n $this->futureExitCode->wait($timeout);\r\n \r\n return $this;\r\n }", "public static function coalesce($args)\n\t{\n\t\t$args = func_get_args();\n\t\tforeach ($args as &$arg)\n\t\t{\n\t\t\tif (isset($arg) && !empty($arg))\n\t\t\t{\n\t\t\t\treturn $arg;\n\t\t\t}\n\t\t}\n\n\t\treturn null;\n\t}", "function coalesce() {\n $args = func_get_args();\n foreach ($args as $arg) {\n if (!empty($arg)) {\n return $arg;\n }\n }\n return $args[0];\n}", "function lock_acquire($name, $timeout = 30.0) {\n global $locks;\n\n // Insure that the timeout is at least 1 ms.\n $timeout = max($timeout, 0.001);\n $expire = microtime(TRUE) + $timeout;\n if (isset($locks[$name])) {\n // Try to extend the expiration of a lock we already acquired.\n $success = (bool) db_update('semaphore')\n ->fields(array('expire' => $expire))\n ->condition('name', $name)\n ->condition('value', _lock_id())\n ->execute();\n if (!$success) {\n // The lock was broken.\n unset($locks[$name]);\n }\n return $success;\n }\n else {\n // Optimistically try to acquire the lock, then retry once if it fails.\n // The first time through the loop cannot be a retry.\n $retry = FALSE;\n // We always want to do this code at least once.\n do {\n try {\n db_insert('semaphore')\n ->fields(array(\n 'name' => $name,\n 'value' => _lock_id(),\n 'expire' => $expire,\n ))\n ->execute();\n // We track all acquired locks in the global variable.\n $locks[$name] = TRUE;\n // We never need to try again.\n $retry = FALSE;\n }\n catch (PDOException $e) {\n // Suppress the error. If this is our first pass through the loop,\n // then $retry is FALSE. In this case, the insert must have failed\n // meaning some other request acquired the lock but did not release it.\n // We decide whether to retry by checking lock_may_be_available()\n // Since this will break the lock in case it is expired.\n $retry = $retry ? FALSE : lock_may_be_available($name);\n }\n // We only retry in case the first attempt failed, but we then broke\n // an expired lock.\n } while ($retry);\n }\n return isset($locks[$name]);\n}", "public function waitForBGPs()\n {\n for ($x = 0; $x<60; $x++) {\n $finished = BackgroundProcessList::isFinishedProcessing();\n if ($finished == true) {\n return;\n }\n sleep(1);\n }\n return;\n }", "private static function execute($time = '')\n {\n if( !self::$_tasks ) return;\n if( empty($time) ) $time = time();\n\n $list = new ArrayIterator(self::$_tasks);\n foreach( $list as $task )\n {\n\tif( $task->test($time) )\n\t {\n\t $res = $task->execute($time);\n\t if( !$res )\n\t {\n\t\t// test failed.\n\t\taudit('',lang_by_realm('automatedtask_failed','tasks'),$task->get_name());\n\t\t$task->on_failure($time);\n\t }\n\t else\n\t {\n\t\taudit('',lang_by_realm('automatedtask_success','tasks'),$task->get_name());\n\t\t$task->on_success($time);\n\t }\n\t }\n }\n }", "public function then(\\GraphQL\\Executor\\Promise\\Promise $promise, ?callable $onFulfilled = null, ?callable $onRejected = null);" ]
[ "0.649529", "0.6494132", "0.6302467", "0.6269993", "0.60670805", "0.59814334", "0.5345528", "0.5160236", "0.49455294", "0.4708845", "0.4654317", "0.45698622", "0.45556992", "0.43820378", "0.43589747", "0.43394533", "0.43044353", "0.41204354", "0.40341297", "0.40297145", "0.40256214", "0.4010142", "0.39826155", "0.39805186", "0.39132887", "0.38727227", "0.38181782", "0.37682354", "0.3766943", "0.37580732", "0.3753525", "0.37337792", "0.36753085", "0.36589754", "0.3658232", "0.3620491", "0.36166695", "0.35954183", "0.35949618", "0.35937238", "0.35915792", "0.3589239", "0.35858947", "0.35795063", "0.35709754", "0.35493022", "0.35465673", "0.35415098", "0.35375935", "0.35328454", "0.3521669", "0.35173306", "0.3513835", "0.35115713", "0.35108107", "0.35018435", "0.3486968", "0.34843832", "0.34838614", "0.3477067", "0.34615073", "0.34611526", "0.34370157", "0.34320092", "0.34243718", "0.3417047", "0.34127438", "0.34000996", "0.33970276", "0.33900988", "0.33867854", "0.33789045", "0.33769876", "0.33727342", "0.33598903", "0.335989", "0.33573464", "0.33539194", "0.33517784", "0.33489037", "0.3336915", "0.33344913", "0.33291483", "0.33285353", "0.33125585", "0.33097965", "0.33082956", "0.33032942", "0.32920608", "0.32823554", "0.32790118", "0.32759118", "0.32755712", "0.32744673", "0.32717454", "0.32701892", "0.32642278", "0.32623434", "0.3261639", "0.32559538" ]
0.66331506
0
wait for ALL of the given promises to resolve Once the last promise resolves, this will return an array with whatever each promise resolves to. Array keys will be left intact, i.e. they can be used to correlate the return array to the promises passed. If ANY promise fails to resolve, this will try to cancel() all remaining promises and throw an Exception. If the promise did not reject with an `Exception`, then this function will throw an `UnexpectedValueException` instead. If no $timeout is given and either promise stays pending, then this will potentially wait/block forever until the last promise is settled. If a $timeout is given and either promise is still pending once the timeout triggers, this will cancel() all pending promises and throw a `TimeoutException`. This implies that if you pass a really small (or negative) value, it will still start a timer and will thus trigger at the earliest possible time in the future.
function awaitAll(array $promises, LoopInterface $loop, $timeout = null) { try { return await(Promise\all($promises), $loop, $timeout); } catch (Exception $e) { // ANY of the given promises rejected or the timeout fired // => try to cancel all promises (rejected ones will be ignored anyway) _cancelAllPromises($promises); throw $e; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function all(array $promises) {\n if (empty($promises)) {\n return new Success([]);\n }\n\n $results = [];\n $remaining = count($promises);\n $promisor = new Future;\n\n foreach ($promises as $key => $resolvable) {\n if (!$resolvable instanceof Promise) {\n $resolvable = new Success($resolvable);\n }\n\n $resolvable->when(function($error, $result) use (&$remaining, &$results, $key, $promisor) {\n // If the promisor already failed don't bother\n if (empty($remaining)) {\n return;\n }\n\n if ($error) {\n $remaining = 0;\n $promisor->fail($error);\n return;\n }\n\n $results[$key] = $result;\n if (--$remaining === 0) {\n $promisor->succeed($results);\n }\n });\n }\n\n // We can return $promisor directly because the Future Promisor implementation\n // also implements Promise for convenience\n return $promisor;\n}", "function some(array $promises) {\n if (empty($promises)) {\n return new Failure(new \\LogicException(\n 'No promises or values provided for resolution'\n ));\n }\n\n $errors = [];\n $results = [];\n $remaining = count($promises);\n $promisor = new Future;\n\n foreach ($promises as $key => $resolvable) {\n if (!$resolvable instanceof Promise) {\n $resolvable = new Success($resolvable);\n }\n\n $resolvable->when(function($error, $result) use (&$remaining, &$results, &$errors, $key, $promisor) {\n if ($error) {\n $errors[$key] = $error;\n } else {\n $results[$key] = $result;\n }\n\n if (--$remaining > 0) {\n return;\n } elseif (empty($results)) {\n $promisor->fail(new \\RuntimeException(\n 'All promises failed'\n ));\n } else {\n $promisor->succeed([$errors, $results]);\n }\n });\n }\n\n // We can return $promisor directly because the Future Promisor implementation\n // also implements Promise for convenience\n return $promisor;\n}", "function awaitAny(array $promises, LoopInterface $loop, $timeout = null)\n{\n try {\n // Promise\\any() does not cope with an empty input array, so reject this here\n if (!$promises) {\n throw new UnderflowException('Empty input array');\n }\n\n $ret = await(Promise\\any($promises)->then(null, function () {\n // rejects with an array of rejection reasons => reject with Exception instead\n throw new Exception('All promises rejected');\n }), $loop, $timeout);\n } catch (TimeoutException $e) {\n // the timeout fired\n // => try to cancel all promises (rejected ones will be ignored anyway)\n _cancelAllPromises($promises);\n\n throw $e;\n } catch (Exception $e) {\n // if the above throws, then ALL promises are already rejected\n // => try to cancel all promises (rejected ones will be ignored anyway)\n _cancelAllPromises($promises);\n\n throw new UnderflowException('No promise could resolve', 0, $e);\n }\n\n // if we reach this, then ANY of the given promises resolved\n // => try to cancel all promises (settled ones will be ignored anyway)\n _cancelAllPromises($promises);\n\n return $ret;\n}", "function any(array $promises) {\n if (empty($promises)) {\n return new Success([], []);\n }\n\n $results = [];\n $errors = [];\n $remaining = count($promises);\n $promisor = new Future;\n\n foreach ($promises as $key => $resolvable) {\n if (!$resolvable instanceof Promise) {\n $resolvable = new Success($resolvable);\n }\n\n $resolvable->when(function($error, $result) use (&$remaining, &$results, &$errors, $key, $promisor) {\n if ($error) {\n $errors[$key] = $error;\n } else {\n $results[$key] = $result;\n }\n\n if (--$remaining === 0) {\n $promisor->succeed([$errors, $results]);\n }\n });\n }\n\n // We can return $promisor directly because the Future Promisor implementation\n // also implements Promise for convenience\n return $promisor;\n}", "function _cancelAllPromises(array $promises)\n{\n foreach ($promises as $promise) {\n if ($promise instanceof CancellablePromiseInterface) {\n $promise->cancel();\n }\n }\n}", "public function all(array $promisesOrValues);", "function first(array $promises) {\n if (empty($promises)) {\n return new Failure(new \\LogicException(\n 'No promises or values provided for resolution'\n ));\n }\n\n $remaining = count($promises);\n $isComplete = false;\n $promisor = new Future;\n\n foreach ($promises as $resolvable) {\n if (!$resolvable instanceof Promise) {\n $promisor->succeed($resolvable);\n break;\n }\n\n $promise->when(function($error, $result) use (&$remaining, &$isComplete, $promisor) {\n if ($isComplete) {\n // we don't care about Futures that resolve after the first\n return;\n } elseif ($error && --$remaining === 0) {\n $promisor->fail(new \\RuntimeException(\n 'All promises failed'\n ));\n } elseif (empty($error)) {\n $isComplete = true;\n $promisor->succeed($result);\n }\n });\n }\n\n // We can return $promisor directly because the Future Promisor implementation\n // also implements Promise for convenience\n return $promisor;\n}", "protected function waitFor($permits, $timeout) {\n $time= $this->clock->time();\n $slot= (int)$time;\n\n // If next slot is in the future, wait\n if ($this->next > $slot) {\n $sleep= $this->next - $time;\n if (null !== $timeout && $sleep > $timeout) return self::TIMED_OUT;\n\n $this->clock->wait($sleep + self::ONE_MICRO);\n $time= $this->clock->time();\n $slot= (int)$time;\n $this->next= null;\n } else {\n $sleep= 0.0;\n }\n\n // If next has passed in the meantime, reset counts\n if ($slot > $this->next) {\n $this->reset= $time + $this->rate->unit()->seconds();\n $this->permits= 0;\n $this->next= $slot;\n }\n\n $this->permits+= $permits;\n\n // If we reached (or exceeded) the rate, set next slot to the future\n $exceed= $this->permits - $this->rate->value();\n if (0 === $exceed) {\n $this->next= $time + $this->rate->unit()->seconds();\n } else if ($exceed > 0) {\n $slots= $exceed / $this->rate->value() + 1;\n $this->next= $time + $slots * $this->rate->unit()->seconds();\n }\n\n return $sleep;\n }", "public static function createAll($promisesOrValues);", "public function callAllPromises()\n {\n $pool = $this->pool;\n\n usort($pool, function ($a, $b) {\n return $a['priority'] - $b['priority'];\n });\n\n foreach ($pool as $node) {\n $promise = $node['promise'];\n $promise();\n }\n }", "public function waitWithPluralTables(array $tables, $timeout = 1)\n {\n $arguments = array();\n foreach ($tables as $table) {\n $arguments[] = $this->getPDO()->quote($table);\n }\n $arguments[] = intval($timeout);\n $function = sprintf(\"queue_wait(%s)\", implode(\",\", $arguments));\n try {\n $value = $this->executeFunction($function, true);\n $index = intval($value[$function]) - 1;\n if (! isset($tables[$index])) {\n throw new Q4MException(\"All table aren't available.\");\n }\n } catch (Exception $e) {\n $tablesString = str_replace(\"\\n\", \"\", var_export($tables, true));\n throw new Q4MException(sprintf(\"Failed to wait with plural tables. tables=[%s]\", $tablesString), 0, $e);\n }\n\n return $this->wait($tables[$index]);\n }", "function filter(array $promises, callable $functor) {\n if (empty($promises)) {\n return new Success([]);\n }\n\n $results = [];\n $remaining = count($promises);\n $promisor = new Future;\n\n foreach ($promises as $key => $resolvable) {\n $promise = ($resolvable instanceof Promise) ? $resolvable : new Success($resolvable);\n $promise->when(function($error, $result) use (&$remaining, &$results, $key, $promisor, $functor) {\n if (empty($remaining)) {\n // If the future result already failed we don't bother.\n return;\n }\n if ($error) {\n $remaining = 0;\n $promisor->fail($error);\n return;\n }\n try {\n if ($functor($result)) {\n $results[$key] = $result;\n }\n if (--$remaining === 0) {\n $promisor->succeed($results);\n }\n } catch (\\Exception $error) {\n $promisor->fail($error);\n }\n });\n }\n\n // We can return $promisor directly because the Future Promisor implementation\n // also implements Promise for convenience\n return $promisor;\n}", "public static function when(...$arguments): PromiseLike {\n $counter = count($arguments);\n if ($counter === 1) {\n $argument = $arguments[0];\n if ($argument instanceOf self) {\n return $argument->promise();\n }\n if ($argument instanceOf PromiseLike) {\n return $argument;\n }\n $defer = new Deferred();\n $defer->resolve($argument);\n return $defer->promise();\n }\n if ($counter > 0) {\n $master = new Deferred();\n $resolveArguments = [];\n foreach ($arguments as $index => $argument) {\n if ($argument instanceOf PromiseLike) {\n $argument\n ->done(\n static function (...$arguments) use ($master, $index, &$counter, &$resolveArguments) {\n $resolveArguments[$index] = $arguments;\n if (--$counter === 0) {\n ksort($resolveArguments);\n $master->resolve(...$resolveArguments);\n }\n }\n )\n ->fail(\n static function (...$arguments) use ($master) {\n $master->reject(...$arguments);\n }\n );\n } else {\n $resolveArguments[$index] = [$argument];\n if (--$counter === 0) {\n ksort($resolveArguments);\n $master->resolve(...$resolveArguments);\n }\n }\n }\n return $master->promise();\n }\n $defer = new Deferred();\n $defer->resolve();\n return $defer->promise();\n }", "public function requestMultiple($requests)\n {\n $promises = array_map(function ($request) {\n \treturn $this->httpClient->sendAsync($request);\n\t\t}, $requests);\n\n $responses = Promise\\unwrap($promises);\n\n return $responses;\n }", "public function wait(): array;", "function await(PromiseInterface $promise, LoopInterface $loop, $timeout = null)\n{\n $wait = true;\n $resolved = null;\n $exception = null;\n $rejected = false;\n\n if ($timeout !== null) {\n $promise = Timer\\timeout($promise, $timeout, $loop);\n }\n\n $promise->then(\n function ($c) use (&$resolved, &$wait, $loop) {\n $resolved = $c;\n $wait = false;\n $loop->stop();\n },\n function ($error) use (&$exception, &$rejected, &$wait, $loop) {\n $exception = $error;\n $rejected = true;\n $wait = false;\n $loop->stop();\n }\n );\n\n while ($wait) {\n $loop->run();\n }\n\n if ($rejected) {\n if (!$exception instanceof \\Exception) {\n $exception = new \\UnexpectedValueException(\n 'Promise rejected with unexpected value of type ' . (is_object(($exception) ? get_class($exception) : gettype($exception))),\n 0,\n $exception instanceof \\Throwable ? $exception : null\n );\n }\n\n throw $exception;\n }\n\n return $resolved;\n}", "function map(array $promises, callable $functor) {\n if (empty($promises)) {\n return new Success([]);\n }\n\n $results = [];\n $remaining = count($promises);\n $promisor = new Future;\n\n foreach ($promises as $key => $resolvable) {\n $promise = ($resolvable instanceof Promise) ? $resolvable : new Success($resolvable);\n $promise->when(function($error, $result) use (&$remaining, &$results, $key, $promisor, $functor) {\n if (empty($remaining)) {\n // If the future already failed we don't bother.\n return;\n }\n if ($error) {\n $remaining = 0;\n $promisor->fail($error);\n return;\n }\n\n try {\n $results[$key] = $functor($result);\n if (--$remaining === 0) {\n $promisor->succeed($results);\n }\n } catch (\\Exception $error) {\n $remaining = 0;\n $promisor->fail($error);\n }\n });\n }\n\n // We can return $promisor directly because the Future Promisor implementation\n // also implements Promise for convenience\n return $promisor;\n}", "public function runAllRequests(): array\n {\n $running = null;\n do {\n $status = curl_multi_exec($this->multiHandle, $running);\n usleep(250000); // 0.25s\n } while ($status === CURLM_CALL_MULTI_PERFORM || $running);\n\n for($i=0, $iMax = count($this->handles); $i < $iMax; $i++) {\n $out = curl_multi_getcontent($this->handles[$i]);\n $data[$i] = $out; // json_decode($out, true);\n curl_multi_remove_handle($this->multiHandle, $this->handles[$i]);\n }\n// foreach ($this->handles as $i => $c) {\n// $out = curl_multi_getcontent($this->handles[$i]);\n// $data[$i] = json_decode($out, true);\n// curl_multi_remove_handle($this->multiHandle, $this->handles[$i]);\n// }\n curl_multi_close($this->multiHandle);\n return $data;\n }", "private static function getAllPendingResults() {\n $returnVal = array();\n $keepLooping = true;\n $start = microtime(true);\n while ($keepLooping && count(self::$connections) !== 0) {\n $keepLooping = false;\n foreach (array_keys(self::$connections) as $key) {\n $connection = self::$connections[$key];\n if($connection === null)\n continue;\n $keepLooping = true;\n $line = fgets($connection->filePointer);\n\n try {\n $connection->parser->addLine($line);\n }\n catch (\\Exception $e) {\n $returnVal[$key] = $e->getMessage();\n fclose($connection->filePointer);\n self::$connections[$key] = null;\n continue;\n }\n $streamInfo = stream_get_meta_data($connection->filePointer);\n if (feof($connection->filePointer) || $streamInfo['timed_out'] || $connection->parser->done() ||\n (microtime(true) - $start) > self::DEFAULT_TIMEOUT) {\n $returnVal[$key] = $connection->parser->getData();\n fclose($connection->filePointer);\n self::$connections[$key] = null;\n }\n }\n usleep(self::DEFAULT_SLEEP_TIME); // take some naps to reduce polling loop hits\n }\n self::$results = $returnVal;\n return $returnVal;\n }", "public function __sleep()\n {\n return [];\n }", "private function aggregate(string $method, array $parameters = []): PromiseInterface\n {\n /* @var PromiseInterface[] $promises */\n $promises = array_map(function (ServiceInterface $service) use ($method, $parameters): PromiseInterface {\n return call_user_func_array([$service, $method], $parameters);\n }, $this->services);\n // create an aggregate promise that will be fulfilled\n // when all service promises are either fulfilled or rejected\n $aggregate = \\GuzzleHttp\\Promise\\settle($promises);\n return $aggregate->then(function (array $inspections) {\n $results = [];\n foreach ($inspections as $inspection) {\n if ($inspection['state'] === PromiseInterface::FULFILLED) {\n // we expect the result to be an array, otherwise this won't work\n $results[] = $inspection['value'];\n }\n }\n return $results;\n });\n }", "public function execute(array $values = []) : array {\n foreach($this->_queries as $q) {\n if(!$q->executed()) {\n // build query string\n $query = $q->build();\n // get from cache if available\n if(isset($this->_cache)) {\n $expired = false;\n $data = $this->_cache->get($query, $expired);\n // if empty? return synchronously\n if(empty($data)) {\n $data = $q->execute($values);\n $this->_cache->set($query, $data);\n return $data;\n }\n // if expired call for update and return cached data\n if($expired) {\n $this->_cache->update($q, $values);\n }\n $q->cached();\n return $data;\n }\n // no cache, synchronously execute\n return $q->execute($values);\n }\n }\n return [];\n }", "public function getMultiple(array $keys, $default = null)\n {\n if (is_callable([$this->interface, 'getMultiple'])) {\n $handleValue = function ($values) {\n foreach ($values as $key => &$value) {\n if (null === $value) {\n unset($this->items[$key]);\n } else {\n $value = $this->items[$key] = $this->unserializer($value);\n }\n }\n\n return $values;\n };\n\n try {\n $result = $this->interface->getMultiple(array_map(fn ($key) => $this->prefix.$key, $keys), $default);\n } catch (Throwable $throwable) {\n return reject($throwable);\n }\n\n if ($result instanceof PromiseInterface) {\n return $result->then($handleValue);\n }\n\n return resolve($handleValue($result));\n }\n\n $promises = [];\n\n foreach ($keys as $key) {\n $promises[$key] = $this->get($key, $default);\n }\n\n return all($promises);\n }", "public function postGetPollerWaitList(): array\n {\n $statement = $this->pearDB->query(\"\n SELECT id, address as ip, name as server_name FROM `platform_topology`\n WHERE `type` = 'poller' AND pending = '1'\n \");\n\n return $statement->fetchAll();\n }", "public function await(string $lastSeenId, int $timeout = 0): ?array;", "public function __sleep(): array\n {\n return [];\n }", "public function __sleep()\n {\n return array();\n }", "public function all(): array\n {\n $config = $this->container->get('config');\n\n if (!isset($config['ratelimits'])) {\n throw new RuntimeException('Missing rate limits configuration');\n }\n\n return array_map(function (string $limitName) {\n return $this->factory($limitName);\n }, array_keys($config['ratelimits']));\n }", "function sleep_between(int $times, int $sleep, callable $callback): Collection\n {\n $sleep *= 1000;\n\n return Collection::times($times, static function ($iteration) use ($callback, $sleep, $times): mixed {\n $result = $callback($iteration);\n\n if ($iteration < $times) {\n usleep($sleep);\n }\n\n return $result;\n });\n }", "public function tryAcquiring($permits= 1, $timeout= 0.0) {\n return self::TIMED_OUT !== $this->waitFor($permits, $timeout);\n }", "function wait(Promise $promise, Reactor $reactor = null) {\n $isWaiting = true;\n $resolvedError = null;\n $resolvedResult = null;\n\n $promise->when(function($error, $result) use (&$isWaiting, &$resolvedError, &$resolvedResult) {\n $isWaiting = false;\n $resolvedError = $error;\n $resolvedResult = $result;\n });\n\n $reactor = $reactor ?: getReactor();\n while ($isWaiting) {\n $reactor->tick();\n }\n\n if ($resolvedError) {\n throw $resolvedError;\n }\n\n return $resolvedResult;\n}", "protected function cleanupTimeoutedRequests() {\n foreach ($this->requests as $handle) {\n if ($handle->timeout > 0 && (microtime(true) - $handle->timeStart) >= $handle->timeout) {\n $this->eventManager->notify('complete', array($this, $handle));\n $this->detach($handle);\n }\n }\n }", "public function getRetries()\n {\n $jobs = array();\n \n $retries = $this\n ->_em\n ->getRepository($this->_entityClass)\n ->createQueryBuilder('s')\n ->andWhere('s.active = :active')\n ->andWhere('s.retry = :retry')\n ->andWhere('s.attempts < s.maxRetries')\n ->setParameters(array('active' => 0, 'retry' => 1))\n ->getQuery()\n ->getResult(); \n \n foreach ($retries as $record) {\n $job = new $this->_jobClass(call_user_func($this->_adapterClass . '::factory', $this->_options, $record, $this->_em, $this->_logger));\n array_push($jobs, $job);\n }\n return $jobs;\n \n }", "public function getFutureExceptions()\n {\n $futureExceptions = array();\n $currentDate = new \\DateTime('today');\n /** @var \\JWeiland\\Events2\\Domain\\Model\\Exception $exception */\n foreach ($this->exceptions as $exception) {\n if ($exception->getExceptionDate() > $currentDate) {\n $futureExceptions[$exception->getExceptionDate()->format('U')] = $exception;\n }\n }\n if (count($futureExceptions) === 1 && current($futureExceptions)->getExceptionDate() == $this->day->getDay()) {\n $futureExceptions = array();\n } else {\n ksort($futureExceptions, SORT_NUMERIC);\n }\n\n return $futureExceptions;\n }", "public function resolveParameters( array $parameters )\n {\n $arguments = [];\n foreach ( $parameters as $parameter ) {\n\n if ( $parameter->getClass() ) {\n $arguments[] = $this->container->get( $parameter->getClass()->getName() );\n } else if ( $parameter->isDefaultValueAvailable() ) {\n $arguments[] = $parameter->getDefaultValue();\n } else {\n throw new AmbiguousParameterException;\n }\n }\n\n return $arguments;\n }", "public function fetchAll(): array {\n\n if($this->database === null) {\n throw new \\Exception('Database connection has not been set.');\n }\n\n $this->queryProperty->setFetchType($this->queryProperty::FETCH_ALL);\n\n $cachedResult = $this->checkQueriesCache($this->queryProperty);\n if ($cachedResult !== null) {\n $this->cacheAndResetQueryProperties();\n return $cachedResult;\n }\n\n $task = $this->createTask();\n $result = $task->fetchAll(\\PDO::FETCH_ASSOC);\n $this->cacheAndResetQueryProperties($result);\n return $result;\n }", "public function run(Queue ...$queues): Promise\n {\n return $this->entryPoint->listen(...$queues);\n }", "public function pending() {\n $results = array();\n foreach ( $this->wrappers as $clazz => $wrappers ) {\n foreach ( $wrappers as $id => $wrapper ) {\n $proxy = $wrapper['proxy'];\n if ( ! $proxy->___repose_isPersisted() ) {\n // We are really only pending if we are not\n // already persisted!\n $results[] = $wrapper['proxy'];\n }\n }\n }\n return $results;\n }", "public static function results_all() {\n\t\t$results = array();\n\t\tforeach (self::$timers as $key => $value) {\n\t\t\t$results[$key] = self::$results($key);\n\t\t}\n\t\treturn $results;\n\t}", "public function GetQueuedJobs()\n {\n $JOBS = $this->DB->GET('MUP.injector.jobs', ['status' => 'QUEUED', 'pmta' => $this->HOSTID, 'active' => '1', 'ORDER' => ['date' => 'ASC']], ['id', 'target', 'pool'], 100000);\n if (empty($JOBS)) {\n $this->ALERTS[] = FAIL.\" ~ <<< No Jobs to Inject...\";\n }else{\n if (isset($JOBS['id']))\n $JOBS = [$JOBS['id']=> $JOBS];\n foreach ($JOBS as $ID => $JOB) \n if (!isset($this->QueuedJobs[$JOB['pool']][$JOB['target']])) \n $this->QueuedJobs[$JOB['pool']][$JOB['target']] = ltrim($ID, '0');\n $this->Debug('QUEUED JOBS', $this->QueuedJobs);\n }\n }", "public function testToArray() {\n $this->assertEquals([null, null], Timeout::toArray(null));\n $this->assertEquals([null, null], Timeout::toArray(0));\n $this->assertEquals([0, 1000], Timeout::toArray(1));\n $this->assertEquals([0, 1], Timeout::toArray(0.001));\n $this->assertEquals([0, 20050], Timeout::toArray(20.05));\n $this->assertEquals([5, 250000], Timeout::toArray(5250.00004));\n }", "public static function coalesce(array $time_periods) {\n if (count($time_periods) == 0) {\n return $time_periods;\n }\n\n usort($time_periods, array(\"Doctrine_Temporal_TimePeriod\", \"usortByStartDate\"));\n $working = null;\n foreach ($time_periods as $k => &$time_period) {\n if (is_null($working)) {\n $working =& $time_period;\n }\n elseif (is_null($working->exp_date)) {\n unset($time_periods[$k]);\n }\n elseif($working->exp_date >= $time_period->eff_date) {\n $working->exp_date = max($working->exp_date, $time_period->exp_date);\n unset($time_periods[$k]);\n }\n else {\n $working =& $time_period;\n }\n }\n return $time_periods;\n }", "function get_all_waiting_return()\n {\n return $this->db->where('returnNumberState', \\ReturnService\\_Return\\returnStateType::OPENED)->where('primaryOwnerNetworkId', Operator::ORANGE_NETWORK_ID)->get_where('numberreturn')->result_array();\n }", "public function process() : array\n {\n $results = [];\n\n foreach ($this->queue as [$task, $after, $context]) {\n $result = $task();\n\n if ($after) {\n $after($result, $context);\n }\n\n $results[] = $result;\n }\n\n $this->queue = [];\n\n return $results;\n }", "public function __sleep()\n {\n return [\n 'resolver',\n 'context',\n ];\n }", "protected function perform()\n {\n $active = $failedSelects = 0;\n $pendingRequests = !$this->scope ? $this->count() : !empty($this->requests[$this->scope]);\n\n while ($pendingRequests) {\n\n while ($mrc = curl_multi_exec($this->multiHandle, $active) == CURLM_CALL_MULTI_PERFORM);\n $this->checkCurlResult($mrc);\n\n // Get messages from curl handles\n while ($done = curl_multi_info_read($this->multiHandle)) {\n $this->dispatch('curl_multi.message', $done);\n foreach ($this->all() as $request) {\n $handle = $this->getRequestHandle($request);\n if ($handle && $handle->getHandle() === $done['handle']) {\n try {\n $this->processResponse($request, $handle, $done);\n } catch (\\Exception $e) {\n $this->removeErroredRequest($request, $e);\n }\n break;\n }\n }\n }\n\n // Notify each request as polling and handled queued responses\n $scopedPolling = $this->scope <= 0 ? $this->all() : $this->requests[$this->scope];\n $pendingRequests = !empty($scopedPolling);\n foreach ($scopedPolling as $request) {\n $request->dispatch(self::POLLING_REQUEST, array(\n 'curl_multi' => $this,\n 'request' => $request\n ));\n }\n\n if ($pendingRequests) {\n if (!$active) {\n // Requests are not actually pending a cURL select call, so\n // we need to delay in order to prevent eating too much CPU\n usleep(30000);\n } else {\n $select = curl_multi_select($this->multiHandle, 0.3);\n // Select up to 25 times for a total of 7.5 seconds\n if (!$select && $this->scope > 0 && ++$failedSelects > 25) {\n // There are cases where curl is waiting on a return\n // value from a parent scope in order to remove a curl\n // handle. This check will defer to a parent scope for\n // handling the rest of the connection transfer.\n // @codeCoverageIgnoreStart\n break;\n // @codeCoverageIgnoreEnd\n }\n }\n }\n }\n }", "#[@test, @limit(time= 0.010)]\n public function timeouts() {\n $start= gettimeofday();\n $end= (1000000 * $start['sec']) + $start['usec'] + 1000 * 50; // 0.05 seconds\n do {\n $now= gettimeofday();\n } while ((1000000 * $now['sec']) + $now['usec'] < $end);\n }", "public function waitForBGPs()\n {\n for ($x = 0; $x<60; $x++) {\n $finished = BackgroundProcessList::isFinishedProcessing();\n if ($finished == true) {\n return;\n }\n sleep(1);\n }\n return;\n }", "static public function ofMany ($futures, $gather = true) {\n\t\t#/home/grabli66/haxelib/tink_core/git/src/tink/core/Future.hx:93: lines 93-108\n\t\tif ($gather === null) {\n\t\t\t$gather = true;\n\t\t}\n\t\t#/home/grabli66/haxelib/tink_core/git/src/tink/core/Future.hx:94: characters 5-24\n\t\t$ret = new SyncFuture(new LazyConst(new \\Array_hx()));\n\t\t#/home/grabli66/haxelib/tink_core/git/src/tink/core/Future.hx:95: lines 95-104\n\t\t$_g = 0;\n\t\twhile ($_g < $futures->length) {\n\t\t\tunset($f);\n\t\t\t#/home/grabli66/haxelib/tink_core/git/src/tink/core/Future.hx:95: characters 10-11\n\t\t\t$f = ($futures->arr[$_g++] ?? null);\n\t\t\t#/home/grabli66/haxelib/tink_core/git/src/tink/core/Future.hx:96: lines 96-104\n\t\t\t$ret = $ret->flatMap(function ($results) use (&$f) {\n\t\t\t\t#/home/grabli66/haxelib/tink_core/git/src/tink/core/Future.hx:98: lines 98-102\n\t\t\t\treturn $f->map(function ($result) use (&$results) {\n\t\t\t\t\t#/home/grabli66/haxelib/tink_core/git/src/tink/core/Future.hx:100: characters 15-46\n\t\t\t\t\treturn $results->concat(\\Array_hx::wrap([$result]));\n\t\t\t\t});\n\t\t\t});\n\t\t}\n\n\t\t#/home/grabli66/haxelib/tink_core/git/src/tink/core/Future.hx:106: lines 106-107\n\t\tif ($gather) {\n\t\t\t#/home/grabli66/haxelib/tink_core/git/src/tink/core/Future.hx:106: characters 19-31\n\t\t\treturn $ret->gather();\n\t\t} else {\n\t\t\t#/home/grabli66/haxelib/tink_core/git/src/tink/core/Future.hx:107: characters 12-15\n\t\t\treturn $ret;\n\t\t}\n\t}", "function retry($times, callable $callback, $sleep = 0)\n {\n $times--;\n beginning:\n try {\n return $callback();\n } catch (Exception $e) {\n if (!$times) {\n throw $e;\n }\n $times--;\n if ($sleep) {\n usleep($sleep * 1000);\n }\n goto beginning;\n }\n }", "public function setMultiple(array $values, $ttl = null)\n {\n $promises = [];\n\n foreach ($values as $key => $value) {\n $promises[$key] = $this->set($key, $value, $ttl);\n }\n\n return all($promises);\n }", "public function dueJobs()\n {\n $currentTime = new DateTime('now', $this->timezone);\n return array_filter($this->jobs, static function (AbstractJob $job) use ($currentTime) {\n return $job->isDue($currentTime);\n });\n }", "public function wait($timeout=null)\n {\n $delta = time();\n if ($timeout == null)\n $timeout = 60 * 2; // two minutes\n if (!($this->check(\"state\", \"started\")))\n Throw new \\CatapultApiException(\"Call already in non 'started' state'\");\n while (true) {\n if (!($this->check(\"state\", \"started\")))\n break;\n if ((time() - $delta) > $timeout)\n break;\n }\n }", "public function getUsers( array $usernames ) : PromiseInterface;", "public function backoff(): array\n {\n return [5, 10, 15];\n }", "public function ConcurrentRequestsUsingPromise()\n {\n CalcTime::start();\n\n $client = new Client(['base_uri' => 'https://www.yundun.com']);\n\n // Initiate each request but do not block\n $promises = [\n 'friendlink' => $client->getAsync('/api/V4/site.friendlink'),\n 'report' => $client->getAsync('/api/V4/site.today.report.allplat')\n ];\n\n // Wait on all of the requests to complete. Throws a ConnectException\n // if any of the requests fail\n try {\n $results = Promise\\unwrap($promises);\n echo $results['friendlink']->getBody();\n echo \"\\n\";\n echo $results['report']->getBody();\n } catch (\\Exception $e) {\n var_dump($e->getMessage());\n }\n\n // Wait for the requests to complete, even if some of them fail\n $results = Promise\\settle($promises)->wait();\n\n // You can access each result using the key provided to the unwrap\n // function.\n echo $results['friendlink']['value']->getHeader('Content-Length')[0];\n echo $results['report']['value']->getHeader('Content-Length')[0];\n\n CalcTime::end();\n CalcTime::echoUseTime(__FUNCTION__);\n }", "public function getPendingSchedules()\n {\n return $this->db->where('status', self::STATUS_PENDING)\n ->get($this->cron_schedule_table_name)\n ->result_array();\n }", "function retry($times, callable $callback, $sleep = 0, $when = null)\n {\n $attempts = 0;\n $times--;\n\n beginning: $attempts++;\n\n try {\n return $callback($attempts);\n } catch (Exception $e) {\n if (!$times || ($when && !$when($e))) {\n throw $e;\n }\n\n $times--;\n\n if ($sleep) {\n usleep($sleep * 1000);\n }\n\n goto beginning;\n }\n }", "public function waitForBGPsAfter()\n {\n for ($x = 0; $x<60; $x++) {\n $finished = BackgroundProcessList::isFinishedProcessing();\n if ($finished == true) {\n return;\n }\n sleep(1);\n }\n return;\n }", "public static function setQueuedFetchStatusAllProjects() \r\n\t{\r\n\t\tglobal $realtime_webservice_data_fetch_interval, $realtime_webservice_stop_fetch_inactivity_days;\r\n\t\t\r\n\t\t// Make sure we have a value for $realtime_webservice_data_fetch_interval\r\n\t\tif (!(is_numeric($realtime_webservice_data_fetch_interval) && $realtime_webservice_data_fetch_interval >= 1)) {\r\n\t\t\t$realtime_webservice_data_fetch_interval = 24;\r\n\t\t}\r\n\t\t\r\n\t\t// Set fetch interval as specific timestamp in the past\r\n\t\t$fetchIntervalTime = date(\"Y-m-d H:i:s\", (strtotime(NOW)-(3600*$realtime_webservice_data_fetch_interval)));\r\n\t\t// Validate value of $realtime_webservice_stop_fetch_inactivity_days\r\n\t\tif (!is_numeric($realtime_webservice_stop_fetch_inactivity_days) || $realtime_webservice_stop_fetch_inactivity_days < 1) {\r\n\t\t\t$realtime_webservice_stop_fetch_inactivity_days = 7;\r\n\t\t}\r\n\t\t// Get timestamp of time limit of inactivity for a project\r\n\t\t$x_days_ago = date(\"Y-m-d H:i:s\", mktime(date(\"H\"),date(\"i\"),date(\"s\"),date(\"m\"),date(\"d\")-$realtime_webservice_stop_fetch_inactivity_days,date(\"Y\")));\r\n\t\t\t\t\r\n\t\t// Get list of records that are ready to be queued (ignore any records where the value is blank for the source ID field).\r\n\t\t// Make sure that we still check records with datetime reference fields with values in the future, even if the project or record has\r\n\t\t// not been modified in the past X days of inactivity.\r\n\t\t$project_mrid_list = array();\r\n\t\t$sql = \"select r.project_id, r.record, r.mr_id from \r\n\t\t\t\tredcap_projects p, redcap_ddp_mapping m, redcap_data d, redcap_ddp_records r \r\n\t\t\t\twhere p.status <= 1 and p.realtime_webservice_enabled = 1 and p.date_deleted is null\r\n\t\t\t\tand ((p.last_logged_event is not null and p.last_logged_event > '$x_days_ago') \r\n\t\t\t\t\tor (select count(1) from redcap_ddp_records r2 where r2.project_id = p.project_id and r2.future_date_count > 0) > 0)\r\n\t\t\t\tand p.project_id = m.project_id and m.is_record_identifier = 1 and d.project_id = m.project_id \r\n\t\t\t\tand d.event_id = m.event_id and d.field_name = m.field_name and r.project_id = m.project_id \r\n\t\t\t\tand r.record = d.record and d.value != '' and r.fetch_status is null \r\n\t\t\t\tand (r.updated_at is null or r.updated_at <= '$fetchIntervalTime')\";\r\n\t\t$q = db_query($sql);\t\t\r\n\t\twhile ($row = db_fetch_assoc($q)) {\r\n\t\t\t// Add to array\r\n\t\t\t$project_mrid_list[$row['project_id']][$row['record']] = $row['mr_id'];\r\n\t\t}\r\n\t\t\r\n\t\t// Keep count of number of records queued\r\n\t\t$numRecordsQueued = 0;\r\n\t\t// Loop through records and return only those modified in past X days (based upon $realtime_webservice_stop_fetch_inactivity_days)\r\n\t\tforeach ($project_mrid_list as $this_project_id=>$records_mrids) {\r\n\t\t\t// If there are more records than max records per batch, then do in several batches\r\n\t\t\t$records_log_query = array_chunk($records_mrids, self::RECORD_LIMIT_PER_LOG_QUERY, true);\r\n\t\t\t// Query log_event table for each batch\r\n\t\t\tforeach ($records_log_query as $records_mrids_this_batch) {\r\n\t\t\t\t// Return a list of records in this batch that have dates of service that exist in the future\r\n\t\t\t\t$records_mrids_this_batch_future_dates = self::checkRecordsFutureDates($this_project_id, $records_mrids_this_batch);\r\n\t\t\t\t// Return a list of records in this batch that have been modified in past X days \r\n\t\t\t\t// (exclude those already found that have future dates - reduces query time)\r\n\t\t\t\t$records_mrids_this_batch_NO_future_dates = array_diff_assoc($records_mrids_this_batch, $records_mrids_this_batch_future_dates);\r\n\t\t\t\t$records_mrids_this_batch_modified = self::checkRecordsModifiedRecently($this_project_id, $records_mrids_this_batch_NO_future_dates, $x_days_ago);\r\n\t\t\t\t// Merge the mr_id arrays to build the ones that we need to queue in this batch\r\n\t\t\t\t$mr_ids_to_queue_this_batch = array_unique(array_merge($records_mrids_this_batch_modified, $records_mrids_this_batch_future_dates));\r\n\t\t\t\t// Set the fetch status of the records returned to QUEUED\r\n\t\t\t\tif (!empty($mr_ids_to_queue_this_batch)) \r\n\t\t\t\t{\r\n\t\t\t\t\t$sql = \"update redcap_ddp_records set fetch_status = 'QUEUED' \r\n\t\t\t\t\t\t\twhere mr_id in (\" . prep_implode($mr_ids_to_queue_this_batch) . \")\";\r\n\t\t\t\t\tif (db_query($sql)) {\r\n\t\t\t\t\t\t// Increment queued record count\r\n\t\t\t\t\t\t$numRecordsQueued += db_affected_rows();\t\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// Return number of recrods queued\r\n\t\treturn $numRecordsQueued;\r\n\t}", "abstract public function getQueuedSignups();", "protected function lock($keys)\n {\n // both string (single key) and array (multiple) are accepted\n $keys = (array) $keys;\n $locked = array();\n for ($i = 0; $i < 10; ++$i) {\n $locked += $this->lockAcquire($keys);\n $keys = \\array_diff($keys, $locked);\n\n if (empty($keys)) {\n break;\n }\n \\usleep(1);\n }\n return $locked;\n }", "public function deleteMultiple(array $keys)\n {\n if (is_callable([$this->interface, 'deleteMultiple'])) {\n $handleValue = function ($success) use ($keys) {\n if ($success) {\n foreach ($keys as $key) {\n unset($this->items[$key]);\n }\n }\n\n return $success;\n };\n\n $keys = array_map(fn ($key) => $this->prefix.$key, $keys);\n\n try {\n $result = $this->interface->deleteMultiple($keys);\n } catch (Throwable $throwable) {\n return reject($throwable);\n }\n\n if ($result instanceof PromiseInterface) {\n return $result->then($handleValue);\n }\n\n return resolve($handleValue($result));\n }\n\n $promises = [];\n\n foreach ($keys as $key) {\n $promises[$key] = $this->delete($key);\n }\n\n return all($promises);\n }", "public function getTimerBindings(): array\n {\n return $this->timers;\n }", "public function sendMultipleVoiceTtsAsync(\\Infobip\\Model\\CallsMultiBody $callsMultiBody): PromiseInterface\n {\n $request = $this->sendMultipleVoiceTtsRequest($callsMultiBody);\n\n return $this\n ->client\n ->sendAsync($request)\n ->then(\n function ($response) use ($request) {\n $this->deprecationChecker->check($request, $response);\n return $this->sendMultipleVoiceTtsResponse($response, $request->getUri());\n },\n function (GuzzleException $exception) {\n $statusCode = $exception->getCode();\n\n $response = ($exception instanceof RequestException) ? $exception->getResponse() : null;\n\n $exception = new ApiException(\n \"[{$statusCode}] {$exception->getMessage()}\",\n $statusCode,\n $response?->getHeaders(),\n ($response !== null) ? (string)$response->getBody() : null\n );\n\n throw $this->sendMultipleVoiceTtsApiException($exception);\n }\n );\n }", "private function collectArguments(array $parameters): array\n {\n $result = [];\n foreach ($parameters as $parameterInfo) {\n // resolve the argument to a value\n if ($parameterInfo->isOptional()) {\n // accept default values for all arguments because all subsequent arguments must also have a default value\n break;\n }\n $typeInfo = $parameterInfo->getType();\n if (!($typeInfo instanceof \\ReflectionNamedType)) {\n throw new ContainerException(\n $this->building,\n 'Type is missing or has a Union type for parameter ' . $parameterInfo->getName()\n );\n }\n if ($typeInfo->isBuiltin()) {\n // if it is a builtin / scalar type, see if there is a scalar matching that name\n $result[] = $this->getScalarValue($parameterInfo->getName());\n continue;\n }\n /** @var class-string $type for phpstan */\n $type = $typeInfo->getName();\n $result[] = $this->get($type);\n }\n return $result;\n }", "protected function calculateExecutionTime(): array\n\t{\n\t\t$totalTime = microtime(true) - $this->application->getStartTime();\n\n\t\t$executionTime = ['total' => $totalTime, 'details' => []];\n\n\t\t$otherTime = 0;\n\n\t\tforeach($this->timers as $timer)\n\t\t{\n\t\t\t$otherTime += $timer instanceof Closure ? $timer() : $timer;\n\t\t}\n\n\t\t$detailedTime = $totalTime - $otherTime;\n\n\t\t$executionTime['details']['PHP'] = ['time' => $detailedTime, 'pct' => ($detailedTime / $totalTime * 100)];\n\n\t\tforeach($this->timers as $timer => $time)\n\t\t{\n\t\t\tif($time instanceof Closure)\n\t\t\t{\n\t\t\t\t$time = $time();\n\t\t\t}\n\n\t\t\t$executionTime['details'][$timer] = ['time' => $time, 'pct' => ($time / $totalTime * 100)];\n\t\t}\n\n\t\treturn $executionTime;\n\t}", "public function acquireJobs(int $count): array;", "public function acquire($permits= 1) {\n return $this->waitFor($permits, null);\n }", "public function all( $sleep = true )\n\t{\n\t\t$items = [];\n\t\t$this->page( 0 );\n\n\t\t$response = $this->builder->get( $this->buildParameters() );\n\t\t$pageExists = true;\n\n\t\twhile ( $pageExists && count( $response->items ) > 0 ) {\n\t\t\tforeach ( $response->items as $item ) {\n\t\t\t\t$items[] = $item;\n\t\t\t}\n\n\t\t\t$this->page( $this->getPage() + 1 );\n\n\t\t\tif ( $sleep ) {\n\t\t\t\tusleep( 200 );\n\t\t\t}\n\n\t\t\ttry {\n\t\t\t\t$response = $this->builder->get( $this->buildParameters() );\n\t\t\t} catch ( FortnoxRequestException $requestException ) {\n\t\t\t\tif ( $requestException->fortnoxCode === 2001889 ) {\n\t\t\t\t\t$pageExists = false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $items;\n\t}", "public function findByPendingCallNotifications() {\n\t\t$callTolerence = 10;\n\t\t$callTolerenceTime = mktime(date(\"H\"), date(\"i\")+$callTolerence, 0, date(\"m\"), date(\"d\"), date(\"Y\"));\n\t\t$query = 'SELECT n FROM AcmeTaskBundle:Notification n WHERE n.datetime <= :callTolerenceTime AND n.push = 1 AND n.pushConfirm = 0 AND n.sms = 0 AND n.voicecall = 0 ORDER BY n.datetime';\n\t\t\n\t\ttry{\n\t\t\treturn $this->getEntityManager()\n\t\t\t\t->createQuery($query)\n\t\t\t\t->setParameter('callTolerenceTime', $callTolerenceTime)\n\t\t\t\t->getResult();\n\t\t} catch (\\Doctrine\\ORM\\NoResultException $e) {\n return null;\n \t}\n\t}", "protected function _setTimeouts($array){\n\t\t// Defaults timeout\n\t\t$this->_timeouts=array('connection' => array('sec' => self::DEFAULT_CONNECTION_TIMEOUT_SEC, 'usec' => self::DEFAULT_CONNECTION_TIMEOUT_USEC),\n\t\t\t\t'read' => array('sec' => self::DEFAULT_READ_TIMEOUT_SEC, 'usec' => self::DEFAULT_READ_TIMEOUT_USEC),\n\t\t\t\t'write' => array('sec' => self::DEFAULT_WRITE_TIMEOUT_SEC, 'usec' => self::DEFAULT_WRITE_TIMEOUT_USEC));\n\t\t// Detect errors\n\t\tif (empty($array)){\n\t\t\treturn TRUE; // We have nothing to do, so we quit\n\t\t}\n\t\telseif (!is_array($array)){\n\t\t\t$trace = debug_backtrace();\n\t\t\t$errorMessage = 'Argument 4 for SpykeeControllerClient::__construct() have to be an array, called in'\n\t\t\t\t\t.$trace[0]['file'].' on line '.$trace[0]['line'];\n\t\t\tthrow new ExeceptionSpykee('Unable to launch Spykee Script', $errorMessage);\n\t\t}\n\t\t\n\t\t// Set timeouts\n\t\tif(!empty($array['connection'])){\n\t\t\tif ($this->_timeouts['connection']['usec'] >= 1000){\n\t\t\t\t$trace = debug_backtrace();\n\t\t\t\t$errorMessage = 'Argument 4 for SpykeeControllerClient::__construct() usec have to be less than 1000 else add 1 to the sec, called in'\n\t\t\t\t\t\t.$trace[0]['file'].' on line '.$trace[0]['line'];\n\t\t\t\tthrow new ExeceptionSpykee('Unable to launch Spykee Script', $errorMessage);\n\t\t\t}\n\t\t\t$this->_timeouts['connection']['sec'] = (!empty($array['connection']['sec'])) ? $array['connection']['sec'] : 0;\n\t\t\t$this->_timeouts['connection']['sec'] = (!empty($array['connection']['usec'])) ? $array['connection']['usec'] : 0;\n\t\t}\n\t\tif (!empty($array['read'])){\n\t\t\tif ($this->_timeouts['read']['usec'] >= 1000){\n\t\t\t\t$trace = debug_backtrace();\n\t\t\t\t$errorMessage = 'Argument 4 for SpykeeControllerClient::__construct() usec have to be less than 1000 else add 1 to the sec, called in'\n\t\t\t\t\t\t.$trace[0]['file'].' on line '.$trace[0]['line'];\n\t\t\t\tthrow new ExeceptionSpykee('Unable to launch Spykee Script', $errorMessage);\n\t\t\t}\n\t\t\t$this->_timeouts['read']['sec'] = (!empty($array['read']['sec'])) ? $array['read']['sec'] : 0;\n\t\t\t$this->_timeouts['read']['sec'] = (!empty($array['read']['usec'])) ? $array['read']['usec'] : 0;\n\t\t}\n\t\tif (!empty($array['write'])){\n\t\t\tif ($this->_timeouts['write']['usec'] >= 1000){\n\t\t\t\t$trace = debug_backtrace();\n\t\t\t\t$errorMessage = 'Argument 4 for SpykeeControllerClient::__construct() usec have to be less than 1000 else add 1 to the sec, called in'\n\t\t\t\t\t\t.$trace[0]['file'].' on line '.$trace[0]['line'];\n\t\t\t\tthrow new ExeceptionSpykee('Unable to launch Spykee Script', $errorMessage);\n\t\t\t}\n\t\t\t$this->_timeouts['write']['sec'] = (!empty($array['write']['sec'])) ? $array['write']['sec'] : 0;\n\t\t\t$this->_timeouts['write']['sec'] = (!empty($array['write']['usec'])) ? $array['write']['usec'] : 0;\n\t\t}\n\t\treturn TRUE;\n\t}", "public function Client(\n array $requests,\n $iteratorMaximum = 1\n ) {\n $multiHandle = curl_multi_init();\n \n $connections = array();\n \n foreach ($requests as $index => $requestParams) {\n list($method, $uri) = $requestParams;\n \n $connections[$index] = curl_init($uri);\n \n if (PromisePay::isDebug()) {\n fwrite(\n STDOUT,\n \"#$index => $uri added.\" . PHP_EOL\n );\n }\n \n curl_setopt($connections[$index], CURLOPT_URL, $uri);\n curl_setopt($connections[$index], CURLOPT_HEADER, true);\n curl_setopt($connections[$index], CURLOPT_RETURNTRANSFER, true);\n curl_setopt($connections[$index], CURLOPT_CUSTOMREQUEST, strtoupper($method));\n curl_setopt($connections[$index], CURLOPT_USERAGENT, 'promisepay-php-sdk/1.0');\n \n curl_setopt(\n $connections[$index],\n CURLOPT_USERPWD,\n sprintf(\n '%s:%s',\n constant(Functions::getBaseNamespace() . '\\API_LOGIN'),\n constant(Functions::getBaseNamespace() . '\\API_PASSWORD')\n )\n );\n \n curl_multi_add_handle($multiHandle, $connections[$index]);\n }\n \n $active = false;\n \n do {\n $multiProcess = curl_multi_exec($multiHandle, $active);\n } while ($multiProcess === CURLM_CALL_MULTI_PERFORM);\n \n while ($active && $multiProcess === CURLM_OK) {\n if (curl_multi_select($multiHandle) === -1) {\n // if there's a problem at the moment, delay execution\n // by 100 miliseconds, as suggested on\n // https://curl.haxx.se/libcurl/c/curl_multi_fdset.html\n \n if (PromisePay::isDebug()) {\n fwrite(\n STDOUT,\n \"Pausing for 100 miliseconds.\" . PHP_EOL\n );\n }\n \n usleep(100000);\n }\n \n do {\n $multiProcess = curl_multi_exec($multiHandle, $active);\n } while ($multiProcess === CURLM_CALL_MULTI_PERFORM);\n }\n \n foreach($connections as $index => $connection) {\n $response = curl_multi_getcontent($connection);\n \n // we're gonna separate headers and response body\n $responseHeaders = curl_getinfo($connection);\n $responseBody = trim(substr($response, $responseHeaders['header_size']));\n \n if (PromisePay::isDebug()) {\n fwrite(\n STDOUT,\n sprintf(\"#$index content: %s\" . PHP_EOL, $responseBody)\n );\n \n fwrite(\n STDOUT,\n \"#$index headers: \" . print_r($responseHeaders, true) . PHP_EOL\n );\n }\n \n $jsonArray = json_decode($responseBody, true);\n \n if (substr($responseHeaders['http_code'], 0, 1) == '2' && is_array($jsonArray)) {\n // processed successfully, remove from queue\n foreach ($requests as $index => $requestParams) {\n list($method, $url) = $requestParams;\n \n if ($url == $responseHeaders['url']) {\n if (PromisePay::isDebug()) {\n fwrite(\n STDOUT,\n \"Unsetting $index from requests.\" . PHP_EOL\n );\n }\n \n unset($requests[$index]);\n }\n }\n \n // SCENARIO #1\n // Response JSON is self-contained under a master key\n foreach (PromisePay::$usedResponseIndexes as $responseIndex) {\n if (isset($jsonArray[$responseIndex])) {\n $jsonArray = $jsonArray[$responseIndex];\n \n break;\n } else {\n unset($responseIndex);\n }\n }\n \n // SCENARIO #2\n // Response JSON is NOT self-contained under a master key\n if (!isset($responseIndex)) {\n // for these scenarios, we'll store them under their endpoint name.\n // for example, requestSessionToken() internally calls getDecodedResponse()\n // without a key param.\n $responseIndex = trim(\n parse_url($responseHeaders['url'], PHP_URL_PATH),\n '/'\n );\n \n $slashLookup = strpos($responseIndex, '/');\n \n if ($slashLookup !== false)\n $responseIndex = substr($responseIndex, 0, $slashLookup);\n }\n } else {\n if (PromisePay::isDebug()) {\n fwrite(\n STDOUT,\n 'An invalid response was received: ' . PHP_EOL . $responseBody . PHP_EOL\n );\n }\n \n // handle errors\n $responseIndex = array_keys($jsonArray);\n $responseIndex = $responseIndex[0];\n }\n \n $this->responses[$responseIndex][] = $jsonArray;\n \n $this->storageHandler->storeJson($jsonArray);\n $this->storageHandler->storeMeta(PromisePay::getMeta($jsonArray));\n $this->storageHandler->storeLinks(PromisePay::getLinks($jsonArray));\n $this->storageHandler->storeDebug($responseHeaders);\n \n unset($responseIndex);\n \n curl_multi_remove_handle($multiHandle, $connection);\n }\n \n curl_multi_close($multiHandle);\n \n $this->pendingRequestsHistoryCounts[] = count($requests);\n \n if (PromisePay::isDebug()) {\n fwrite(\n STDOUT,\n sprintf(\n \"responses contains %d members.\" . PHP_EOL,\n count($this->responses)\n )\n );\n }\n \n // if a single request hasn't succeeded in the past 2 request batches,\n // terminate and return result.\n foreach ($this->pendingRequestsHistoryCounts as $index => $pendingRequestsCount) {\n if ($index === 0) continue;\n \n if ($this->pendingRequestsHistoryCounts[$index - 1] == $pendingRequestsCount) {\n if (PromisePay::isDebug()) {\n fwrite(\n STDOUT,\n 'Server 5xx detected; returning what was obtained thus far.' . PHP_EOL\n );\n }\n \n return $this->storageHandler;\n }\n }\n \n $this->iteratorCount++;\n \n if (empty($requests) || $this->iteratorCount >= $iteratorMaximum) {\n return $this->storageHandler;\n }\n \n if (PromisePay::isDebug()) {\n fwrite(STDOUT, PHP_EOL . '<<STARTING RECURSIVE CALL>>' . PHP_EOL);\n \n fwrite(\n STDOUT,\n 'REMAINING REQUESTS: ' . print_r($requests, true) .\n PHP_EOL .\n 'PROCESSED RESPONSES: ' . print_r($this->responses, true)\n );\n }\n \n return $this->Client($requests);\n }", "static function ExecWaitTimeout($cmd, $timeout = 8)\r\n\t{\r\n\t\t$descriptorspec = array(\r\n\t\t\t0 => array(\"pipe\", \"r\"),\r\n\t\t\t1 => array(\"pipe\", \"w\"),\r\n\t\t\t2 => array(\"pipe\", \"w\")\r\n\t\t);\r\n\t\t$pipes = array();\r\n\r\n\t\t$timeout += time();\r\n\r\n\t\t$process = proc_open($cmd, $descriptorspec, $pipes);\r\n\t\tif (!is_resource($process))\r\n\t\t\tthrow new Exception(\"proc_open failed on: \" . $cmd);\r\n\r\n\t\t$output = '';\r\n\r\n\t\t$status = array();\r\n\t\t$kill_status = '';\r\n\r\n\t\tdo {\r\n\t\t\tusleep(10);\r\n\t\t\t$timeleft = $timeout - time();\r\n\t\t\t$read = array($pipes[1]);\r\n\t\t\t$write = NULL;\r\n\t\t\t$exeptions = NULL;\r\n\t\t\tstream_select($read, $write, $exeptions, $timeleft);\r\n\r\n\t\t\tif (!empty($read))\r\n\t\t\t\t$output .= fread($pipes[1], 8192);\r\n\r\n\t\t\tif ($timeout - time() <= 0)\r\n\t\t\t{\r\n\t\t\t\t$status = proc_get_status($process);\r\n\t\t\t\t$kill_status = 'Trying to kill';\r\n\t\t\t\t$ppid = $status['pid'];\r\n\t\t\t\t$pids = preg_split('/\\s+/', `ps -o pid --no-heading --ppid $ppid`);\r\n\t\t\t\tforeach ($pids as $pid)\r\n\t\t\t\t\tif (is_numeric($pid))\r\n\t\t\t\t\t{\r\n//\t\t\t\t\techo \"Killing $pid\\n\";\r\n\t\t\t\t\t\tposix_kill($pid, 9); //9 is the SIGKILL signal\r\n\t\t\t\t\t\t$kill_status = 'Killed';\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t} while (!feof($pipes[1]));\r\n\r\n\t\tif (empty($status))\r\n\t\t\t$status = proc_get_status($process);\r\n\r\n\t\tif ($kill_status)\r\n\t\t\t$status['status_kill'] = $kill_status;\r\n\r\n\t\tfclose($pipes[1]);\r\n\t\tfclose($pipes[2]);\r\n\r\n\t\tproc_close($process);\r\n\r\n\t\treturn array($output, $status);\r\n\t}", "function wait($timeout=10, $propagate=TRUE, $interval=0.5)\n\t{\n\t\treturn $this->get($timeout, $propagate, $interval);\n\t}", "public function getMulti(array $keys, array &$tokens = null): array\n {\n $values = $this->local->getMulti($keys);\n $tokens = [];\n\n // short-circuit reading from real cache if we have an uncommitted flush\n if (!$this->suspend) {\n // figure out which missing key we need to get from real cache\n $keys = array_diff($keys, array_keys($values));\n foreach ($keys as $i => $key) {\n // don't reach out to real cache for keys that are about to be gone\n if ($this->local->expired($key)) {\n unset($keys[$i]);\n }\n }\n\n // fetch missing values from real cache\n if ($keys) {\n $missing = $this->cache->getMulti($keys);\n $values += $missing;\n }\n }\n\n // any tokens we get will be unreliable, so generate some replacements\n // (more elaborate explanation in get())\n foreach ($values as $key => $value) {\n $token = uniqid('', false);\n $tokens[$key] = $token;\n $this->tokens[$token] = serialize($value);\n }\n\n return $values;\n }", "public function clearExpiredItems(): array\n {\n return $this->gc([\n 'gc_enable' => true,\n 'gc_probability' => 1,\n 'gc_divisor' => 1,\n ]);\n }", "public function getQueuedCookies(): array;", "public function retry($times, callable $callback, $sleep = 0)\n {\n $times--;\n\n beginning:\n try {\n return $callback();\n } catch (Exception $e) {\n if (! $times) {\n throw $e;\n }\n\n $times--;\n\n if ($sleep) {\n usleep($sleep * 1000);\n }\n\n goto beginning;\n }\n }", "public function getSequences($actions): array\n {\n $sequences = [];\n\n $defaults = [\n 'deployment_id' => null,\n 'project_id' => null,\n 'server_id' => null,\n 'server_name' => null,\n 'sequence' => null,\n 'name' => null,\n 'action_id' => null,\n 'hook_id' => null,\n ];\n\n foreach ($actions as $action) {\n foreach ($action->beforeHooks as $beforeHook) {\n $sequences[] = array_merge($defaults, [\n 'name' => $beforeHook->name,\n 'hook_id' => $beforeHook->id,\n ]);\n }\n\n $sequences[] = array_merge($defaults, [\n 'name' => $action->name,\n 'action_id' => $action->id,\n ]);\n\n foreach ($action->afterHooks as $afterHook) {\n $sequences[] = array_merge($defaults, [\n 'name' => $afterHook->name,\n 'hook_id' => $afterHook->id,\n ]);\n }\n }\n\n return $sequences;\n }", "public function checkResources()\n {\n if (empty($GLOBALS['conf']['resource']['driver'])) {\n return array();\n }\n\n if ($this->vars->i) {\n $event = $this->_getDriver($this->vars->c)->getEvent($this->vars->i);\n } else {\n $event = Kronolith::getDriver()->getEvent();\n }\n // Overrite start/end times since we may be checking before we edit\n // an existing event with new times.\n $event->start = new Horde_Date($this->vars->s);\n $event->end = new Horde_Date($this->vars->e);\n $event->start->setTimezone(date_default_timezone_get());\n $event->end->setTimezone(date_default_timezone_get());\n $results = array();\n foreach (explode(',', $this->vars->r) as $id) {\n $resource = Kronolith::getDriver('Resource')->getResource($id);\n $results[$id] = $resource->getResponse($event);\n }\n\n return $results;\n }", "private function promiseReduce(array $values, callable $callback, $initialValue)\n {\n }", "public function executeMulti(string $queries): array\n {\n $ret = [];\n\n $this->multiQuery($queries);\n do\n {\n $result = $this->mysqli->store_result();\n if ($this->mysqli->errno) $this->mySqlError('mysqli::store_result');\n if ($result)\n {\n if ($this->haveFetchAll)\n {\n $ret[] = $result->fetch_all(MYSQLI_ASSOC);\n }\n else\n {\n $tmp = [];\n while (($row = $result->fetch_assoc()))\n {\n $tmp[] = $row;\n }\n\n $ret[] = $tmp;\n }\n $result->free();\n }\n else\n {\n $ret[] = $this->mysqli->affected_rows;\n }\n\n $continue = $this->mysqli->more_results();\n if ($continue)\n {\n $tmp = $this->mysqli->next_result();\n if ($tmp===false) $this->mySqlError('mysqli::next_result');\n }\n } while ($continue);\n\n return $ret;\n }", "public function fetchPairs(): array {\n\n if($this->database === null) {\n throw new \\Exception('Database connection has not been set.');\n }\n\n $this->queryProperty->setFetchType($this->queryProperty::FETCH_PAIRS);\n\n $cachedResult = $this->checkQueriesCache($this->queryProperty);\n if ($cachedResult !== null) {\n $this->cacheAndResetQueryProperties();\n return $cachedResult;\n }\n\n $task = $this->createTask();\n $result = $task->fetchAll(\\PDO::FETCH_ASSOC | \\PDO::FETCH_UNIQUE);\n $this->cacheAndResetQueryProperties($result);\n return $result;\n }", "public function getFutureMeals(): array\n {\n $queryBuilder = $this->createQueryBuilder('m');\n $queryBuilder->where('m.dateTime >= :now');\n $queryBuilder->setParameter(':now', new DateTime('now'), Types::DATETIME_MUTABLE);\n\n return $queryBuilder->getQuery()->getResult();\n }", "public function testFailsWhenAllSubTasksFail() {\n $tasks = [new TaskStub(), new TaskStub(), new TaskStub(), new TaskStub()];\n \n $task = new \\Async\\Task\\AnyTask($tasks);\n \n // Fail each subtask in turn, checking that the task is not yet complete\n $i = 0;\n foreach( $tasks as $subTask ) {\n $i++;\n $this->assertFalse($task->isComplete());\n $subTask->setException(new \\Exception(\"failure $i\"));\n $task->tick($this->getMock(\\Async\\Scheduler\\Scheduler::class));\n }\n \n // Check that the task is now complete with an error\n $this->assertTrue($task->isComplete());\n $this->assertTrue($task->isFaulted());\n $this->assertInstanceOf(\n \\Async\\Task\\MultipleFailureException::class, $task->getException()\n );\n $this->assertContains('4 tasks failed', $task->getException()->getMessage());\n $this->assertEquals(\n [\n 0 => new \\Exception(\"failure 1\"),\n 1 => new \\Exception(\"failure 2\"),\n 2 => new \\Exception(\"failure 3\"),\n 3 => new \\Exception(\"failure 4\")\n ],\n $task->getException()->getFailures()\n );\n }", "protected function scheduleEntitiesSync(array $entities)\n {\n foreach ($entities as $entity) {\n if (!$this->isSyncRequired($entity)) {\n continue;\n }\n\n $entityToSync = $this->getIntegrationEntityToSync($entity);\n if ($entityToSync && $this->isIntegrationEntityValid($entityToSync)) {\n $this->tryScheduleSync($entityToSync);\n }\n }\n }", "function retry(int $times, callable $callback, int $sleep = 0, $when = null)\n {\n $attempts = 0;\n $times--;\n\n beginning:\n $attempts++;\n\n try {\n return $callback($attempts);\n } catch (Exception $e) {\n if (!$times || ($when && !$when($e))) {\n throw $e;\n }\n\n $times--;\n\n if ($sleep) {\n usleep($sleep * 1000);\n }\n\n goto beginning;\n }\n }", "private function prime()\n {\n $promises = [];\n\n foreach ($this->queue as $page) {\n $url = $page->getStoreUrl();\n\n $options = [];\n\n if ($page->getMagentoVary() != null) {\n $options['cookies'] =\n\n $cookieJar = CookieJar::fromArray([\n 'X-Magento-Vary' => $page->getMagentoVary()\n ], $page->getCookieDomain());\n }\n\n $sendtime = microtime(true);\n\n $request = new Request('GET', $url);\n\n $promises[] = $this->client->sendAsync($request, $options)->then(\n\n function (Response $response) use ($page, $sendtime, $request) {\n\n $responsetime = microtime(true);\n\n $this->writeln(\n '<info>GET '.$page->getPath() .' '.$page->getMagentoVary().'</info> <comment>'.$response->getStatusCode().', '.number_format (( $responsetime - $sendtime ), 2).'s</comment>'\n );\n $page->setStatus(1);\n $this->pageRepository->save($page);\n }\n )->otherwise(function(\\Exception $e) use ($page, $sendtime, $request) {\n $this->writeln(\n '<error>'.$e->getMessage().'</error>'\n );\n $priority = $page->getPriority();\n $page->setPriority($priority-1);\n $page->setStatus(1);\n $this->pageRepository->save($page);\n });\n\n }\n\n \\GuzzleHttp\\Promise\\all($promises)->wait();\n }", "private function promiseForAssocArray(array $assoc) : \\GraphQL\\Executor\\Promise\\Promise\n {\n }", "public function send($requests)\n {\n $curlMulti = $this->getCurlMulti();\n $multipleRequests = is_array($requests);\n if (!$multipleRequests) {\n $requests = array($requests);\n }\n\n foreach ($requests as $request) {\n $curlMulti->add($request);\n }\n\n try {\n $curlMulti->send();\n } catch (ExceptionCollection $e) {\n throw $multipleRequests ? $e : $e->getIterator()->offsetGet(0);\n }\n\n if (!$multipleRequests) {\n return end($requests)->getResponse();\n }\n\n return array_map(function($request) {\n return $request->getResponse();\n }, $requests);\n }", "protected function resolveConditions()\n\t{\n\t\tif ($this->isEmpty()) return [ [], [] ];\n\n\t\t$conditions = array_filter([\n\t\t\t$this->resolveStringCondition([ 'type' ], $this->type),\n\t\t\t$this->resolveStringCondition([ 'uri', 'commandName', 'jobName', 'testName' ], array_merge($this->uri, $this->name)),\n\t\t\t$this->resolveStringCondition([ 'controller' ], $this->controller),\n\t\t\t$this->resolveExactCondition([ 'method' ], $this->method),\n\t\t\t$this->resolveNumberCondition([ 'responseStatus', 'commandExitCode', 'jobStatus', 'testStatus' ], $this->status),\n\t\t\t$this->resolveNumberCondition([ 'responseDuration' ], $this->time),\n\t\t\t$this->resolveDateCondition([ 'time' ], $this->received)\n\t\t]);\n\n\t\t$sql = array_map(function ($condition) { return $condition[0]; }, $conditions);\n\t\t$bindings = array_reduce($conditions, function ($bindings, $condition) {\n\t\t\treturn array_merge($bindings, $condition[1]);\n\t\t}, []);\n\n\t\treturn [ $sql, $bindings ];\n\t}", "public static function resolve(string $expression) : array\n {\n $polynomial = self::getPolynomialExpression($expression);\n\n $status = self::checkIfQuadraticSinglePolynomial($polynomial);\n if($status['errors']) { // TODO: Create different types of exceptions\n throw new \\Exception(self::interpretErrorMsg($status['errors']));\n }\n // TODO: Create abstract status msg interpreter\n return self::solveQuadraticSinglePolynomial($polynomial);\n }", "public function loadAllJobs()\n {\n // foreach ($jobs as $key => $job) {\n // $job_due_date = Carbon::parse($job->due_date);\n // $current_date = Carbon::now()->subDay();\n // if ($current_date->gt($job_due_date)) {\n // $job->isJobExpired = true;\n // } else {\n // $job->isJobExpired = false;\n // }\n // }\n\n // return $jobs;\n $jobs = [];\n $unassignedTasks = Task::where(['isAssigned' => 0, ['Time02', '!=', 0]])->orderBy('id', 'DESC')->groupBy('job_id')->get();\n foreach ($unassignedTasks as $key => $task) {\n $job = Job::find($task->job_id);\n $job_due_date = Carbon::parse($job->due_date);\n $current_date = Carbon::now()->subDay();\n if ($current_date->gt($job_due_date)) {\n $job->isJobExpired = true;\n } else {\n $job->isJobExpired = false;\n }\n array_push($jobs, $job);\n }\n\n return $jobs;\n }", "public function dequeue($n = 1, $timeout = 0)\n {\n //do a non-blocking dequeue, return on success\n $result = $this->queue->dequeue($n, 0);\n if (count($result) || $timeout < 1) {\n return $result;\n }\n $start = microtime(true);\n //if nothing popped: while timeout is not reached do the following:\n while (($loopStart = microtime(true)) < $start + $timeout + 1) {\n $result = $this->queue->dequeue($n, 0);\n if (count($result)) {\n return $result;\n }\n\n //find $t0 and $best as declared in $this->enqueue()\n $first = $this->redis->zrange($this->name, 0, 0, 'WITHSCORES');\n if (count($first)) {\n $t0 = array_values($first)[0];\n $best = array_keys($first)[0];\n } else {\n $t0 = $start + $timeout;\n $best = 0;\n }\n //$x = blpop \"{$this->name}:$best\", $t0\n //if $x: dequeue, if something is dequeued return\n $timeToWait = max(1, ceil(min($timeout - $loopStart + $start, $t0 - $loopStart)));\n $items = $this->redis->blpop([$this->name . ':' . $best], $timeToWait);\n if (is_null($items)) {\n continue;\n }\n $items = [$items[1]];\n if ($n > 1) {\n $lua = <<<LUA\n local values = redis.call('lrange', KEYS[1], 0, KEYS[2] - 1)\n redis.call('ltrim', KEYS[1], KEYS[2], - 1)\n return values\nLUA;\n $remainingItems = $this->redis->eval($lua, 2, $this->name . ':' . $best, $n - 1);\n $items = array_merge($items, $remainingItems);\n }\n $result = $this->queue->dequeue(count($items));\n if (count($result)) {\n return $result;\n }\n }\n return [];\n }", "public function execute(): array\n {\n if (!$this->table) {\n return Array();\n }\n $where = $this->getWhere();\n\n $this->statement($where);\n $this->statement($this->order);\n $this->statement($this->limit);\n \n $query = $this->prepare();\n \n if ($query) {\n try {\n $query->execute();\n\n return $query->fetchAll();\n } catch (\\PDOException $e) {\n $this->mydatabase->handleError($e, \"SELECT-EXECUTE\", $this->statement);\n }\n }\n \n return Array();\n }", "public function getReturnPolicies(array $queries = []): ReturnPolicyResponse\n {\n return $this->client->request('getReturnPolicies', 'GET', 'return_policy',\n [\n 'query' => $queries,\n ]\n );\n }", "protected function PollJobs() {\n\n\t\tforeach($this->_running_queue as $i=>$rjob) {\n\t\t\techo (\"Index is $i<br/>\");\n\t\t\t//job finished?\n\t\t\t$status = $this->JobPollAsync($rjob);\n\t\t\tif ($status === false) {\n\t\t\t\t$this->LogEntry(\"Status is false for job $i and slots are \" . $this->_slots .\"<br/>\");\n\t\t\t\tunset($this->_running_queue[$i]);\n\t\t\t\t$this->_finished_count++;\n\t\t\t\tif (count($this->_waiting_queue)) {\n\t\t\t\t\t$this->LogEntry(\"Adding a job because finish count is \" . $this->_finished_count . \" and job count is \" . $this->_job_count . \" so slot count becomes \" . $this->_slots +1 . \"<br/>\");\n\t\t\t\t\t$this->_slots++;\n\t\t\t\t} else {\n\t\t\t\t\t$this->LogEntry(\"Finish count is ! < job count and slots are \" . $this->_slots. \"<br/>\");\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$this->LogEntry(\"Status of job $i is $status\\n\");\n\t\t\t}\n\t\t}\n\t}", "public function getAllFinished(): array;", "public function testPollTimeOut() {\n $c = new _MockProviderCronRunner(50, 0.0001);\n $provider = $this->createMock(ProviderInterface::class);\n $polling = $this->createMock(PollingInterface::class);\n $provider->method('polling')->willReturn($polling);\n $polling->expects($this->once())->method('poll')->will($this->returnCallback(function () {\n usleep(101);\n return TRUE;\n }));\n $c->providers = [$provider];\n $start = microtime(TRUE);\n $c->poll();\n $this->assertLessThan(1, microtime(TRUE) - $start);\n }" ]
[ "0.68982315", "0.66100746", "0.65163076", "0.640026", "0.6107004", "0.58707744", "0.5810408", "0.5314764", "0.5182554", "0.5158637", "0.5081975", "0.48235583", "0.47540858", "0.474315", "0.4735046", "0.47210088", "0.46368867", "0.45637625", "0.44007424", "0.43679753", "0.43650648", "0.43155685", "0.42980897", "0.4288808", "0.42576948", "0.4197878", "0.4161634", "0.41472498", "0.41230705", "0.41218784", "0.411237", "0.40907946", "0.40735558", "0.40727487", "0.40466627", "0.4008724", "0.39935115", "0.39933848", "0.39869073", "0.39812237", "0.3978027", "0.397362", "0.3927498", "0.3914434", "0.39114767", "0.3902632", "0.3900806", "0.38963112", "0.3892893", "0.3890838", "0.38893378", "0.38793188", "0.3862329", "0.3861633", "0.38603708", "0.38597125", "0.38505667", "0.3809005", "0.38014337", "0.3798328", "0.3793681", "0.3793042", "0.37828085", "0.3769835", "0.3759213", "0.37453642", "0.374301", "0.37416407", "0.37372398", "0.373655", "0.37342367", "0.37279156", "0.37265462", "0.3723327", "0.37201712", "0.37171704", "0.37158048", "0.37146106", "0.37143382", "0.37044242", "0.3702792", "0.3700586", "0.36985332", "0.36966696", "0.36921537", "0.36884525", "0.36782703", "0.36773023", "0.36765218", "0.36756098", "0.36689338", "0.36677268", "0.3658261", "0.36559764", "0.36512348", "0.365035", "0.36496827", "0.3645992", "0.36447805", "0.36345434" ]
0.69126177
0
internal helper function used to iterate over an array of Promise instances and cancel() each
function _cancelAllPromises(array $promises) { foreach ($promises as $promise) { if ($promise instanceof CancellablePromiseInterface) { $promise->cancel(); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function awaitAll(array $promises, LoopInterface $loop, $timeout = null)\n{\n try {\n return await(Promise\\all($promises), $loop, $timeout);\n } catch (Exception $e) {\n // ANY of the given promises rejected or the timeout fired\n // => try to cancel all promises (rejected ones will be ignored anyway)\n _cancelAllPromises($promises);\n\n throw $e;\n }\n}", "protected function _cancelOperation() {}", "public function runAllRequests(): array\n {\n $running = null;\n do {\n $status = curl_multi_exec($this->multiHandle, $running);\n usleep(250000); // 0.25s\n } while ($status === CURLM_CALL_MULTI_PERFORM || $running);\n\n for($i=0, $iMax = count($this->handles); $i < $iMax; $i++) {\n $out = curl_multi_getcontent($this->handles[$i]);\n $data[$i] = $out; // json_decode($out, true);\n curl_multi_remove_handle($this->multiHandle, $this->handles[$i]);\n }\n// foreach ($this->handles as $i => $c) {\n// $out = curl_multi_getcontent($this->handles[$i]);\n// $data[$i] = json_decode($out, true);\n// curl_multi_remove_handle($this->multiHandle, $this->handles[$i]);\n// }\n curl_multi_close($this->multiHandle);\n return $data;\n }", "public function stopAllCoroutineConsumer(): void\n {\n if (! empty($this->startedTopicIdArr)) {\n foreach ($this->startedTopicIdArr as $consumerId) {\n $this->stopConsumer($consumerId, 1);\n }\n }\n }", "function awaitAny(array $promises, LoopInterface $loop, $timeout = null)\n{\n try {\n // Promise\\any() does not cope with an empty input array, so reject this here\n if (!$promises) {\n throw new UnderflowException('Empty input array');\n }\n\n $ret = await(Promise\\any($promises)->then(null, function () {\n // rejects with an array of rejection reasons => reject with Exception instead\n throw new Exception('All promises rejected');\n }), $loop, $timeout);\n } catch (TimeoutException $e) {\n // the timeout fired\n // => try to cancel all promises (rejected ones will be ignored anyway)\n _cancelAllPromises($promises);\n\n throw $e;\n } catch (Exception $e) {\n // if the above throws, then ALL promises are already rejected\n // => try to cancel all promises (rejected ones will be ignored anyway)\n _cancelAllPromises($promises);\n\n throw new UnderflowException('No promise could resolve', 0, $e);\n }\n\n // if we reach this, then ANY of the given promises resolved\n // => try to cancel all promises (settled ones will be ignored anyway)\n _cancelAllPromises($promises);\n\n return $ret;\n}", "public function __destruct() {\n // scope of a foreach) but it has not reached its end, we must sync\n // the client with the queued elements that have not been read from\n // the connection with the server.\n $this->sync();\n }", "public function cancel();", "public function getCancellationEvents();", "protected function cancelPayments()\n {\n $i = 0;\n $sql = \"SELECT `vendorTxCode` FROM payment WHERE status = ? AND \" .\n \"((cardType='MAESTRO' AND created <= ?) OR created <= ?)\";\n $params = array(SAGEPAY_REMOTE_STATUS_AUTHENTICATED, date('Y-m-d H:i:s', strtotime('-30 days')), date('Y-m-d H:i:s',\n strtotime('-90 days')));\n $cancelStatus = array('Status' => SAGEPAY_REMOTE_STATUS_CANCELLED);\n\n $payment = new ModelPayment();\n $paymentStm = $this->dbHelper->execute($sql, $params);\n if (!$paymentStm)\n {\n exit('Invalid query');\n }\n $payments = $paymentStm->fetchAll(PDO::FETCH_ASSOC);\n foreach ($payments as $row)\n {\n if ($payment->update($row['vendorTxCode'], $cancelStatus))\n {\n $i++;\n }\n }\n printf('Updated %d payments', $i);\n }", "protected function cancelOnFail(array $rules): array\n {\n if (!isset($rules['abort'])) {\n return $rules;\n }\n\n unset($rules['abort']);\n foreach ($rules as &$rule) {\n $rule = (array) $rule + ['cancelOnFail' => true];\n }\n\n return $rules;\n }", "public static function stopAll () {\n\t\tforeach (self::$timeArray as $label => $value)\n\t\t\tself::stop ($label);\n\t}", "public function cancel(): void;", "public function cancelRequests()\n {\n $this->prepareCancel();\n\n $url = $this->urlbase.$this->urlbranch;\n\n $query = $this->genQuery();\n\n $path = $this->options['Action'].'Result';\n\n if ($this->mockMode) {\n $xml = $this->fetchMockFile()->$path;\n } else {\n $response = $this->sendRequest($url, ['Post' => $query]);\n\n if (! $this->checkResponse($response)) {\n return false;\n }\n\n $xml = simplexml_load_string($response['body'])->$path;\n }\n\n $this->parseXML($xml);\n }", "public function cancel() {\n # cleanup code before cancellng job\n $ret = array('message'=>'You cancelled this job at '.date('H:i:s'));\n return $ret;\n }", "public function callAllPromises()\n {\n $pool = $this->pool;\n\n usort($pool, function ($a, $b) {\n return $a['priority'] - $b['priority'];\n });\n\n foreach ($pool as $node) {\n $promise = $node['promise'];\n $promise();\n }\n }", "public static function oneClickTokenCancelAll(array $data = array())\n\t{\n\t\ttry {\n\t\t\t$oneClickTokenCancelAllResponse = \\BigFish\\PaymentGateway::oneClickTokenCancelAll(new \\BigFish\\PaymentGateway\\Request\\OneClickTokenCancelAll($data['providerName'], $data['userId']));\n\n\t\t\treturn $oneClickTokenCancelAllResponse;\n\t\t} catch (\\BigFish\\PaymentGateway\\Exception $e) {\n\t\t\treturn $e->getMessage();\n\t\t}\n\t}", "protected function cleanupTimeoutedRequests() {\n foreach ($this->requests as $handle) {\n if ($handle->timeout > 0 && (microtime(true) - $handle->timeStart) >= $handle->timeout) {\n $this->eventManager->notify('complete', array($this, $handle));\n $this->detach($handle);\n }\n }\n }", "public function terminateExpiredSubscriptions()\n {\n $subscriptionRepo = \\Env::get('em')->getRepository('Cx\\Modules\\Order\\Model\\Entity\\Subscription');\n $subscriptions = $subscriptionRepo->getExpiredSubscriptions(array(\n \\Cx\\Modules\\Order\\Model\\Entity\\Subscription::STATE_ACTIVE,\n \\Cx\\Modules\\Order\\Model\\Entity\\Subscription::STATE_CANCELLED));\n \n if (\\FWValidator::isEmpty($subscriptions)) {\n return;\n }\n \n foreach ($subscriptions as $subscription) {\n $subscription->terminate();\n }\n \\Env::get('em')->flush();\n }", "protected function cancel(): void\n {\n }", "public function cancelOperation() {\n printf(\"Cancelling...\\n\");\n $this->_cancelled = true;\n posix_kill($this->_pid, SIGKILL);\n pcntl_signal_dispatch();\n }", "public function cancelAllMonitors () {\n $this->callMethod( 'cancelAllMonitors');\n $this->_handlersMonitorFile = array();\n }", "public function cancelOrdersInPending()\n {\n //Etape 1 : on recupere pour chaque comptes le nombre de jours pour l'annulation\n $col = Mage::getModel('be2bill/merchandconfigurationaccount')->getCollection();\n $tabLimitedTime = array();\n foreach ($col as $obj) {\n $tabLimitedTime[$obj->getData('id_b2b_merchand_configuration_account')] = $obj->getData('order_canceled_limited_time') != null ? $obj->getData('order_canceled_limited_time') : 0;\n }\n\n //Etape 2\n $collection = Mage::getResourceModel('sales/order_collection')\n ->addFieldToFilter('main_table.state', Mage_Sales_Model_Order::STATE_NEW)\n ->addFieldToFilter('op.method', 'be2bill');\n $select = $collection->getSelect();\n $select->joinLeft(array(\n 'op' => Mage::getModel('sales/order_payment')->getResource()->getTable('sales/order_payment')), 'op.parent_id = main_table.entity_id', array('method', 'additional_information')\n );\n\n Mage::log((string)$collection->getSelect(), Zend_Log::DEBUG, \"debug_clean_pending.log\");\n\n // @var $order Mage_Sales_Model_Order\n foreach ($collection as $order) {\n $addInfo = unserialize($order->getData('additional_information'));\n $accountId = $addInfo['account_id'];\n $limitedTime = (int)$tabLimitedTime[$accountId];\n\n if ($limitedTime <= 0) {\n continue;\n }\n\n $store = Mage::app()->getStore($order->getStoreId());\n $currentStoreDate = Mage::app()->getLocale()->storeDate($store, null, true);\n $createdAtStoreDate = Mage::app()->getLocale()->storeDate($store, strtotime($order->getCreatedAt()), true);\n\n $difference = $currentStoreDate->sub($createdAtStoreDate);\n\n $measure = new Zend_Measure_Time($difference->toValue(), Zend_Measure_Time::SECOND);\n $measure->convertTo(Zend_Measure_Time::MINUTE);\n\n if ($limitedTime < $measure->getValue() && $order->canCancel()) {\n try {\n $order->cancel();\n $order->addStatusToHistory($order->getStatus(),\n // keep order status/state\n Mage::helper('be2bill')->__(\"Commande annulée automatique par le cron car la commande est en 'attente' depuis %d minutes\", $limitedTime));\n $order->save();\n } catch (Exception $e) {\n Mage::logException($e);\n }\n }\n }\n\n return $this;\n }", "private function destroyCurlQueue()\n {\n foreach ($this->request_queue as $ch) {\n if (is_resource($ch)) {\n curl_close($ch);\n }\n }\n }", "public function deleteMultiple(array $keys)\n {\n if (is_callable([$this->interface, 'deleteMultiple'])) {\n $handleValue = function ($success) use ($keys) {\n if ($success) {\n foreach ($keys as $key) {\n unset($this->items[$key]);\n }\n }\n\n return $success;\n };\n\n $keys = array_map(fn ($key) => $this->prefix.$key, $keys);\n\n try {\n $result = $this->interface->deleteMultiple($keys);\n } catch (Throwable $throwable) {\n return reject($throwable);\n }\n\n if ($result instanceof PromiseInterface) {\n return $result->then($handleValue);\n }\n\n return resolve($handleValue($result));\n }\n\n $promises = [];\n\n foreach ($keys as $key) {\n $promises[$key] = $this->delete($key);\n }\n\n return all($promises);\n }", "public function keepItemsInArrayCanUseClosure() {}", "public function discardBatch() {\n if (!$this->isBatch) {\n throw new JsonRpcException('Client is not in batch mode, start a batch operation by calling startBatch() first');\n }\n\n $batchRequests = $this->batchRequests;\n $this->batchRequests = [];\n $this->isBatch = false;\n\n return $batchRequests;\n }", "public function testWrappedTaskCancelledWhenThrottledTaskCancelled() {\n // Create a wrapped task that expects cancel to be called once\n $wrapped = $this->getMock(\\Async\\Task\\Task::class);\n $wrapped->expects($this->once())->method('cancel');\n \n $throttled = new \\Async\\Task\\ThrottledTask($wrapped, 0.5);\n \n $throttled->cancel();\n }", "public function unsetAllExept()\n {\n $exceptions = is_array(func_get_arg(0)) ? func_get_arg(0) : func_get_args();\n\n foreach ($this->toArray() as $key => $value)\n {\n \tif(!array_key_exists($key, $exceptions))\n \t{\n \t $this->removeAttribute($key);\n \t}\n }\n }", "private function purge()\n {\n $promises = [];\n\n foreach ($this->queue as $page) {\n $url = $page->getStoreUrl();\n\n $sendtime = microtime(true);\n\n $request = new Request('PURGE', $url);\n\n $promises[] = $this->client->sendAsync($request)->then(\n function (Response $response) use ($page, $sendtime, $request) {\n $responsetime = microtime(true);\n $this->writeln('<info>PURGE '.$page->getPath() .'</info> <comment>'.$response->getStatusCode().', '.number_format (( $responsetime - $sendtime ), 2).'s</comment>');\n },\n function (RequestException $e) use ($page) {\n $this->writeln('<info>PURGE '.$page->getPath() .'</info> <error> FAILED </error> \n<comment>'.$e->getMessage().'</comment>');\n }\n );\n }\n\n \\GuzzleHttp\\Promise\\all($promises)->wait();\n }", "public function clearPending();", "public function __destruct()\n {\n foreach (static::$sessions as $session_id => $session) {\n try {\n static::$retry->retry(function () use ($session) {\n $session->delete();\n }, true);\n } catch (\\Exception $e) {\n }\n }\n }", "public function declineAllPendingThreads()\n {\n return $this->ig->request('direct_v2/threads/decline_all/')\n ->addPost('_csrftoken', $this->ig->client->getToken())\n ->addPost('_uuid', $this->ig->uuid)\n ->setSignedPost(false)\n ->getResponse(new Response\\GenericResponse());\n }", "function filter(array $promises, callable $functor) {\n if (empty($promises)) {\n return new Success([]);\n }\n\n $results = [];\n $remaining = count($promises);\n $promisor = new Future;\n\n foreach ($promises as $key => $resolvable) {\n $promise = ($resolvable instanceof Promise) ? $resolvable : new Success($resolvable);\n $promise->when(function($error, $result) use (&$remaining, &$results, $key, $promisor, $functor) {\n if (empty($remaining)) {\n // If the future result already failed we don't bother.\n return;\n }\n if ($error) {\n $remaining = 0;\n $promisor->fail($error);\n return;\n }\n try {\n if ($functor($result)) {\n $results[$key] = $result;\n }\n if (--$remaining === 0) {\n $promisor->succeed($results);\n }\n } catch (\\Exception $error) {\n $promisor->fail($error);\n }\n });\n }\n\n // We can return $promisor directly because the Future Promisor implementation\n // also implements Promise for convenience\n return $promisor;\n}", "public function cancelAll(Request $req)\n {\n $schedule = $req->schedule;\n $bookingdate = $req->bookingdate;\n\n $tickets = Ticket::where([\n ['schedule_id', $schedule],\n ['from_stop', Auth::user()->terminal_id],\n ['paid', 1]\n ])->whereDate('booking_for', $bookingdate);\n $seats = TicketSeat::whereHas('ticket', function ($query) use ($schedule, $bookingdate) {\n return $query->where([\n ['schedule_id', $schedule],\n ['from_stop', Auth::user()->terminal_id],\n ['paid', 1]\n ])->whereDate('booking_for', $bookingdate);\n });\n\n $seats->delete();\n $tickets->delete();\n\n return response(array('msg' => 'All tickets deleted successfully.'));\n }", "public function retryAll()\n {\n foreach ($this->getFailedFiles() as $file) {\n // Rename the file first\n $tmpFile = dirname($file) . '/retrying-' . basename($file);\n rename($file, $tmpFile);\n\n $fp = @fopen($tmpFile, 'r');\n if ($fp === false) {\n fwrite(\n STDERR,\n sprintf('Could not open the file: %s' . PHP_EOL, $tmpFile)\n );\n continue;\n }\n while ($line = fgets($fp)) {\n $jsonDecodedValue = json_decode($line);\n // Check if data json_encoded after serialization\n if ($jsonDecodedValue !== null || $jsonDecodedValue !== false) {\n $line = $jsonDecodedValue;\n }\n $a = unserialize($line);\n $idNum = key($a);\n $job = $this->runner->getJobFromIdNum($idNum);\n if (! $job->callFunc($a[$idNum])) {\n $this->handleFailure($idNum, $a[$idNum]);\n }\n }\n @fclose($fp);\n @unlink($tmpFile);\n }\n }", "public function __destruct() {\n\t\t$filesystem = $this->filesystem;\n\t\t$this->tmpFiles->each(function($filePath) use($filesystem){\n\t\t\t$filesystem->delete($filePath);\n\t\t});\n\t}", "function ibase_blob_cancel($blob_handle): void\n{\n error_clear_last();\n $safeResult = \\ibase_blob_cancel($blob_handle);\n if ($safeResult === false) {\n throw IbaseException::createFromPhpError();\n }\n}", "public function cancelAction()\n\t{\n\t\t$this->processToken = null;\n\t\t$this->isNewProcess = true;\n\n\t\t$this->dropTempFile();\n\n\t\t$this->instanceBucket();\n\n\t\tif ($this->bucket instanceof \\CCloudStorageBucket)\n\t\t{\n\t\t\tif ($this->bucket->FileExists($this->uploadPath))\n\t\t\t{\n\t\t\t\tif (!$this->bucket->DeleteFile($this->uploadPath))\n\t\t\t\t{\n\t\t\t\t\t$this->addError(new Error('Cloud drop error.'));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$this->clearProgressParameters();\n\n\t\t$result = $this->preformAnswer(self::ACTION_CANCEL);\n\n\t\t$result['STATUS'] = self::STATUS_COMPLETED;\n\n\t\treturn $result;\n\t}", "public function shouldRejectWithoutCreatingGarbageCyclesIfCancellerWithReferenceThrowsException(): void\n {\n gc_collect_cycles();\n /** @var Promise<never> $promise */\n $promise = new Promise(function () {}, function () use (&$promise) {\n assert($promise instanceof Promise);\n throw new \\Exception('foo');\n });\n $promise->cancel();\n unset($promise);\n\n $this->assertSame(0, gc_collect_cycles());\n }", "public function cancel()\n {\n }", "public function cancel()\n {\n }", "public function reject($requests) {\n foreach ($requests as $teacher_id) {\n $this->deleteFromRequest($teacher_id);\n }\n}", "public function cancelLimeLightSubscription()\n {\n $subscription = Subscription::where('user_id', '=', $this->user->id)->firstOrFail();\n $account = $this->getLimeLightCustomerView($subscription);\n $orderList = explode(',', $account['order_list']);\n $results = [];\n $activeUntilDate = '';\n\n foreach ($orderList as $orderId) {\n try {\n $orderView = $this->getLimeLightOrderView($orderId);\n\n $subscription->recurring_date = $orderView['recurring_date'];\n $subscription->save();\n\n $recurringDate = strtotime($subscription->recurring_date);\n $activeUntilDate = date(\"Y-m-d\", strtotime(\"+1 month\", $recurringDate));\n\n } catch (\\Exception $e) {\n // TODO: handle this if the unsubscribe for that order id fails\n dd($e->getMessage());\n }\n\n try {\n $response = $this->limeLightCRM->membership()->updateRecurringOrder([\n 'order_id' => $orderId,\n 'status' => 'stop',\n ]);\n\n if ($response['response_code'] === '100') {\n $results = [\n 'success' => true,\n 'message' => 'Account successfully unsubscribed. Your account will remain active until ' . $activeUntilDate,\n ];\n } else {\n $results = [\n 'success' => false,\n 'message' => 'Failed to unsubscribe this account.',\n ];\n }\n\n } catch (\\Exception $e) {\n $results = [\n 'success' => false,\n 'message' => $e->getMessage(),\n ];\n }\n }\n\n return $results;\n }", "function abortPendingUploads()\n{\n $count=0;\n $bucket=bucket();\n $res=s3(\"listMultipartUploads\",[\"Bucket\"=>bucket()]);\n if (is_array($res[\"Uploads\"]))\n foreach ($res[\"Uploads\"] as $item)\n {\n\n $r=s3(\"abortMultipartUpload\",[\n \"Bucket\"=>$bucket,\n \"Key\"=>$item[\"Key\"],\n \"UploadId\"=>$item[\"UploadId\"],\n ]);\n $count++;\n }\n return $count;\n}", "function deleteTmpFiles()\n{\n global $tmpFiles1;\n global $tmpFiles2;\n\n foreach ($tmpFiles1 as $tmpFile){\n exec(\"rm -f $tmpFile\");\n }\n\n foreach ($tmpFiles2 as $tmpFile){\n exec(\"rm -f $tmpFile\");\n }\n}", "public function cancelHolds($cancelDetails)\n {\n $details = $cancelDetails['details'];\n $patron = $cancelDetails['patron'];\n $count = 0;\n $response = [];\n\n foreach ($details as $holdId) {\n $result = $this->makeRequest(\n ['v3', 'patrons', 'holds', $holdId], [], 'DELETE', $patron\n );\n\n if (!empty($result['code'])) {\n $msg = $this->formatErrorMessage($result['description']);\n $response[$holdId] = [\n 'item_id' => $holdId,\n 'success' => false,\n 'status' => 'hold_cancel_fail',\n 'sysMessage' => $msg\n ];\n } else {\n $response[$holdId] = [\n 'item_id' => $holdId,\n 'success' => true,\n 'status' => 'hold_cancel_success'\n ];\n ++$count;\n }\n }\n return ['count' => $count, 'items' => $response];\n }", "public function cancelJob(int $jobID): array\n {\n return $this->call(\n \"CancelJob\",\n [\n \"jobID\" => $jobID,\n ]\n );\n }", "function all(array $promises) {\n if (empty($promises)) {\n return new Success([]);\n }\n\n $results = [];\n $remaining = count($promises);\n $promisor = new Future;\n\n foreach ($promises as $key => $resolvable) {\n if (!$resolvable instanceof Promise) {\n $resolvable = new Success($resolvable);\n }\n\n $resolvable->when(function($error, $result) use (&$remaining, &$results, $key, $promisor) {\n // If the promisor already failed don't bother\n if (empty($remaining)) {\n return;\n }\n\n if ($error) {\n $remaining = 0;\n $promisor->fail($error);\n return;\n }\n\n $results[$key] = $result;\n if (--$remaining === 0) {\n $promisor->succeed($results);\n }\n });\n }\n\n // We can return $promisor directly because the Future Promisor implementation\n // also implements Promise for convenience\n return $promisor;\n}", "public function testSendInvoiceToBatchUnsuccessfulSendViaDestructor()\n {\n $validator = new InvoiceValidator();\n\n $sqsClient = $this->getMockedAwsSdk()->createSqs(['version' => '2012-11-05']);\n $cmd = $sqsClient->getCommand('SendMessage', [\n 'QueueName' => 'my-queue-name'\n ]);\n\n $results = [\n # Result for GetQueueUrl command\n new Result(['QueueUrl' => 'my-queue-url']),\n # Result for SendMessage command\n new AwsException('Exception message', $cmd)\n ];\n\n $sqsQueue = $this->getSqsQueueInstance($results);\n\n foreach ($this->getValidInvoiceData() as $data) {\n $invoice = Invoice::load($data, $validator);\n $sqsQueue->sendInvoiceToBatch($invoice, $validator);\n }\n # Destroy the object. This should trigger the batch send.\n unset($sqsQueue);\n }", "public function self_destruct(){\n foreach($this->donations() as $index => $obj)$obj->self_destruct();\n parent::self_destruct();\n }", "function interrupt($handle, $processor = null) \n{\n $signal = new pcntl\\Interrupt($processor);\n return [\\XPSPL\\handle($signal, $handle), $signal];\n}", "public function requestMultiple($requests)\n {\n $promises = array_map(function ($request) {\n \treturn $this->httpClient->sendAsync($request);\n\t\t}, $requests);\n\n $responses = Promise\\unwrap($promises);\n\n return $responses;\n }", "protected function perform()\n {\n $active = $failedSelects = 0;\n $pendingRequests = !$this->scope ? $this->count() : !empty($this->requests[$this->scope]);\n\n while ($pendingRequests) {\n\n while ($mrc = curl_multi_exec($this->multiHandle, $active) == CURLM_CALL_MULTI_PERFORM);\n $this->checkCurlResult($mrc);\n\n // Get messages from curl handles\n while ($done = curl_multi_info_read($this->multiHandle)) {\n $this->dispatch('curl_multi.message', $done);\n foreach ($this->all() as $request) {\n $handle = $this->getRequestHandle($request);\n if ($handle && $handle->getHandle() === $done['handle']) {\n try {\n $this->processResponse($request, $handle, $done);\n } catch (\\Exception $e) {\n $this->removeErroredRequest($request, $e);\n }\n break;\n }\n }\n }\n\n // Notify each request as polling and handled queued responses\n $scopedPolling = $this->scope <= 0 ? $this->all() : $this->requests[$this->scope];\n $pendingRequests = !empty($scopedPolling);\n foreach ($scopedPolling as $request) {\n $request->dispatch(self::POLLING_REQUEST, array(\n 'curl_multi' => $this,\n 'request' => $request\n ));\n }\n\n if ($pendingRequests) {\n if (!$active) {\n // Requests are not actually pending a cURL select call, so\n // we need to delay in order to prevent eating too much CPU\n usleep(30000);\n } else {\n $select = curl_multi_select($this->multiHandle, 0.3);\n // Select up to 25 times for a total of 7.5 seconds\n if (!$select && $this->scope > 0 && ++$failedSelects > 25) {\n // There are cases where curl is waiting on a return\n // value from a parent scope in order to remove a curl\n // handle. This check will defer to a parent scope for\n // handling the rest of the connection transfer.\n // @codeCoverageIgnoreStart\n break;\n // @codeCoverageIgnoreEnd\n }\n }\n }\n }\n }", "function fbird_blob_cancel($blob_handle): void\n{\n error_clear_last();\n $safeResult = \\fbird_blob_cancel($blob_handle);\n if ($safeResult === false) {\n throw IbaseException::createFromPhpError();\n }\n}", "public function testThrottledTaskCancelledWhenWrappedTaskCancelled() {\n $wrapped = new TaskStub();\n \n $throttled = new \\Async\\Task\\ThrottledTask($wrapped, 0.5);\n \n // Check that the task is not complete\n $this->assertFalse($throttled->isComplete());\n \n // Cancel the wrapped task and check that the the throttled task is cancelled\n $wrapped->cancel();\n $this->assertTrue($throttled->isComplete());\n $this->assertTrue($throttled->isCancelled());\n }", "public static function oneClickTokenCancel(array $data = array())\n\t{\n\t\ttry {\n\t\t\t$oneClickTokenCancelResponse = \\BigFish\\PaymentGateway::oneClickTokenCancel(new \\BigFish\\PaymentGateway\\Request\\OneClickTokenCancel($data['TransactionId']));\n\n\t\t\treturn $oneClickTokenCancelResponse;\n\t\t} catch (\\BigFish\\PaymentGateway\\Exception $e) {\n\t\t\treturn $e->getMessage();\n\t\t}\n\t}", "public function execute(): Iterator\n {\n if ($this->requests) {\n $this->processedCount = 0;\n $retryProxy = $this->api->createRetry($this->api->logger(), $this->api->maxAttempts());\n yield from $retryProxy->call(function (): iterator {\n try {\n foreach ($this->runBatchRequest() as $response) {\n do {\n yield from $this->processBatchResponse($response);\n $response = $this->getNextPage($response);\n } while ($response !== null);\n }\n } catch (BatchRequestException $e) {\n Helpers::processRequestException($e);\n }\n });\n }\n }", "protected function cleanExecutionArrays() {}", "function cancelPending() {\n\t\tself::$_db->saveQry(\"SELECT `ID` FROM `#_reservations` \".\n\t\t\t\t\"WHERE (`status` = 'pending' OR `status` = 'prefered') \".\n\t\t\t\t\"AND ? >= `startTime` \",\n\t\t\t\tCalendar::startCancel());\n\t\t\n\n\t\twhile($res = self::$_db->fetch_assoc())\n\t\t\tReservation::load($res['ID'])->failed();\n\t\t\n\t\t\n\t\t// TagesEnde - BuchungsCancelZeit ist kleiner als Aktueller Zeitblock\n\t\tif(Calendar::calculateTomorrow()) {\n\t\t\t$opening = Calendar::opening(date('Y-m-d', strtotime(\"tomorrow\")));\n\t\t\tself::$_db->saveQry(\"SELECT * FROM `#_reservations` \".\n\t\t\t\t\t\"WHERE (`status` = 'pending' OR `status` = 'prefered') \".\n\t\t\t\t\t\"AND ? <= `startTime` AND `startTime` <= ? \",\n\t\t\t\t\t$opening->format(\"Y-m-d H:i\"), \n\t\t\t\t\tCalendar::startCancel($opening));\n\t\t\t\n\t\t\twhile($res = self::$_db->fetch_assoc())\n\t\t\t\tReservation::load($res['ID'])->failed();\n\t\t}\n\t\t\n\t}", "public static function closeAll()\n {\n Collection::make(static::$browsers)->each->quit();\n\n static::$browsers = collect();\n }", "function deletePhotos($inputArr) {\n $ro = new BaseRO();\n $album = $inputArr[\"albumName\"];\n $filesToDel = $inputArr[\"picurls\"];\n $numfiles = count($filesToDel);\n\n for ($i=0; $i < $numfiles; $i++)\n {\n $ro->success = unlink($filesToDel[$i]);\n $ro->retmsg = \"Deleted \" . $filesToDel[$i];\n if (!($ro->success)) {\n $ro->retcode = 4;\n $ro->retmsg = \"Couldn't delete files\";\n return $ro;\n }\n }\n\n return $ro;\n}", "protected function closeAllButPrimary($browsers)\n {\n $browsers->slice(1)->each->quit();\n\n return $browsers->take(1);\n }", "private static function processPendingRemoveIds()\n {\n $pendingRemove = array();\n\n foreach (self::getMessages() as $type => $messages) {\n if (empty($messages))\n continue;\n\n foreach ($messages as $id => $message) {\n if (empty($message['remove_ids']))\n continue;\n\n foreach ($message['remove_ids'] as $rId) {\n $pendingRemove[$rId] = true;\n }\n }\n }\n\n $types = self::getMessages();\n\n foreach ($types as $type => $messages) {\n if (empty($messages))\n continue;\n\n foreach ($messages as $id => $message) {\n if (isset($pendingRemove[$id])) {\n unset($types[$type][$id]);\n }\n }\n }\n\n self::setMessages($types);\n }", "function mc_do_not_allow_3_month_cancellations( $actions, $subscriptions ) {\n \n foreach( $subscriptions as $subscription_key => $subscription_details ) {\n \n if( $subscription_details['product_id'] == 3622 ) {\n \n unset( $actions[$subscription_key]['cancel'] );\n }\n }\n \n return $actions;\n}", "public function unmarkAllExecutions() {}", "private function processBatchRequests($input)\n {\n $replies = array();\n\n foreach ($input as $request) {\n $reply = $this->processRequest($request);\n\n if ($reply !== null) {\n $replies[] = $reply;\n }\n }\n\n if (count($replies) === 0) {\n return null;\n }\n\n return $replies;\n }", "public function removeIterator(int $handle): void\n {\n $this->tonClient->request(\n 'net.remove_iterator',\n [\n 'handle' => $handle,\n ]\n )->wait();\n }", "public function cancel(): int;", "public function cancel(\\Exception $e = null)\n {\n $this->stopped();\n\n $this->setStatus(Job::STATUS_CANCELLED, $e);\n\n $this->redis->zadd(Queue::redisKey($this->queue, 'cancelled'), time(), $this->payload);\n $this->redis->lrem(Queue::redisKey($this->queue, $this->worker->getId() . ':processing_list'), 1, $this->payload);\n \n Stats::incr('cancelled', 1);\n Stats::incr('cancelled', 1, Queue::redisKey($this->queue, 'stats'));\n\n Event::fire(Event::JOB_CANCELLED, $this);\n }", "public function __destruct()\n {\n foreach ($this->drivers as $key => $driver) $this->close($key);\n }", "function __destruct() {\n\n\t\tunset ($this->iterable);\n\t}", "public function unregister() {\n // Normally, there are definitely wrappers set for the ALL filter. However,\n // in some cases involving many container rebuilds (e.g. BrowserTestBase),\n // $this->wrappers may be empty although wrappers are still registered\n // globally. Thus an isset() check is needed before iterating.\n if (isset($this->wrappers[StreamWrapperInterface::ALL])) {\n foreach (array_keys($this->wrappers[StreamWrapperInterface::ALL]) as $scheme) {\n stream_wrapper_unregister($scheme);\n }\n }\n }", "public function process() : array\n {\n $results = [];\n\n foreach ($this->queue as [$task, $after, $context]) {\n $result = $task();\n\n if ($after) {\n $after($result, $context);\n }\n\n $results[] = $result;\n }\n\n $this->queue = [];\n\n return $results;\n }", "private function prime()\n {\n $promises = [];\n\n foreach ($this->queue as $page) {\n $url = $page->getStoreUrl();\n\n $options = [];\n\n if ($page->getMagentoVary() != null) {\n $options['cookies'] =\n\n $cookieJar = CookieJar::fromArray([\n 'X-Magento-Vary' => $page->getMagentoVary()\n ], $page->getCookieDomain());\n }\n\n $sendtime = microtime(true);\n\n $request = new Request('GET', $url);\n\n $promises[] = $this->client->sendAsync($request, $options)->then(\n\n function (Response $response) use ($page, $sendtime, $request) {\n\n $responsetime = microtime(true);\n\n $this->writeln(\n '<info>GET '.$page->getPath() .' '.$page->getMagentoVary().'</info> <comment>'.$response->getStatusCode().', '.number_format (( $responsetime - $sendtime ), 2).'s</comment>'\n );\n $page->setStatus(1);\n $this->pageRepository->save($page);\n }\n )->otherwise(function(\\Exception $e) use ($page, $sendtime, $request) {\n $this->writeln(\n '<error>'.$e->getMessage().'</error>'\n );\n $priority = $page->getPriority();\n $page->setPriority($priority-1);\n $page->setStatus(1);\n $this->pageRepository->save($page);\n });\n\n }\n\n \\GuzzleHttp\\Promise\\all($promises)->wait();\n }", "public function __destruct() {\n if (isset($this->mh)) curl_multi_close($this->mh);\n }", "public static function deleteAllCancelledPreviouslyAssignedShift($employee_id){\n date_default_timezone_set('Europe/Prague');\n $smeny = DB::table('shift_facts')\n ->select('shift_info_dimension.shift_info_id','shift_info_dimension.shift_start','shift_info_dimension.shift_end')\n ->join('shift_info_dimension','shift_facts.shift_info_id','=','shift_info_dimension.shift_info_id')\n ->where(['shift_facts.employee_id' => $employee_id])\n ->where('shift_info_dimension.shift_start', '>=', Carbon::now())\n ->get();\n\n DB::table('shift_facts')\n ->join('shift_info_dimension','shift_facts.shift_info_id','=','shift_info_dimension.shift_info_id')\n ->where(['shift_facts.employee_id' => $employee_id])\n ->where('shift_info_dimension.shift_start', '>=', Carbon::now())\n ->delete();\n\n foreach ($smeny as $smena){\n DB::table('shift_info_dimension')\n ->where(['shift_info_dimension.shift_info_id' => $smena->shift_info_id])\n ->where('shift_info_dimension.shift_start', '>=', Carbon::now())\n ->delete();\n\n DB::table('time_dimension')\n ->where(['time_dimension.time_id' => $smena->shift_info_id])\n ->delete();\n }\n }", "public function cancel_traveler_booking($tourwise_id, $traveler_id_arr, $first_names_arr)\n{\n begin_t();\n for($i=0; $i<sizeof($traveler_id_arr); $i++)\n {\n $sq_cancel = mysql_query(\"update travelers_details set status='Cancel' where traveler_id='$traveler_id_arr[$i]'\");\n if(!$sq_cancel)\n {\n $GLOBALS['flag'] = false;\n echo \"error--Sorry, some members are not canceled.\";\n //exit;\n } \n } \n\n\n if($GLOBALS['flag']){\n commit_t();\n //Cancelation mail send\n $this->traveler_cancelation_mail_send($tourwise_id, $traveler_id_arr);\n\n //Cancelation sms send\n $this->traveler_cancelation_sms_send($tourwise_id);\n\n echo \"Group Booking Cancellation is successfully done.\";\n exit;\n }\n else{\n rollback_t();\n exit;\n }\n\n \n}", "public function batchDestroy(PastQuestionMultipleRequest $request)\n {\n // Gets all the past questions in the array by id\n $past_questions = PastQuestion::whereIn('id', $request->input('past_questions'))->get();\n if ($past_questions) {\n\n // Deletes all found past questions\n $filtered = $past_questions->filter(function ($value, $key) {\n if ($value->uploaded_by === auth()->user()->id || $this->USER_LEVEL_3 === auth()->user()->rank) {\n if ($value->delete()) {\n return $value;\n }\n }\n });\n\n // Check's if any past questions were deleted\n if (($deleted = count($filtered)) > 0) {\n return $this->actionSuccess(\"$deleted Past question(s) deleted\");\n } else {\n return $this->requestConflict('Currently unable to delete past question(s)');\n }\n\n } else {\n return $this->notFound('Past question(s) not found');\n }\n }", "public function removeSubRequests();", "public function cancelOrderReference($requestParameters = array());", "function cancel() {\n if($this->request->isAsyncCall()) {\n if($this->active_invoice->isLoaded()) {\n if($this->active_invoice->canCancel($this->logged_user)) {\n if($this->request->isSubmitted()) {\n try {\n $this->active_invoice->markAsCanceled($this->logged_user);\n \n $issued_to_user = $this->active_invoice->getIssuedTo();\n if ($issued_to_user instanceof User && Invoices::getNotifyClientAboutCanceledInvoice()) {\n $notify_users = array($issued_to_user);\n \t if ($issued_to_user->getId() != $this->logged_user->getId()) {\n \t $notify_users[] = $this->logged_user;\n \t } // if\n\n AngieApplication::notifications()\n ->notifyAbout('invoicing/invoice_canceled', $this->active_invoice, $this->logged_user)\n ->sendToUsers($notify_users);\n } // if\n \n \t\t\t\t\t\t$this->response->respondWithData($this->active_invoice, array(\n \t \t'as' => 'invoice', \n \t 'detailed' => true,\n \t ));\n } catch (Error $e) {\n \t$this->response->exception($e);\n } // try\n } // if\n } else {\n $this->response->forbidden();\n } // if\n } else {\n $this->response->notFound();\n } // if\n } else {\n $this->response->badRequest();\n } // if\n }", "protected function prepareCancel()\n {\n include $this->env;\n $this->options['Action'] = 'CancelReportRequests';\n if (isset($THROTTLE_LIMIT_REPORTREQUESTLIST)) {\n $this->throttleLimit = $THROTTLE_LIMIT_REPORTREQUESTLIST;\n }\n if (isset($THROTTLE_TIME_REPORTREQUESTLIST)) {\n $this->throttleTime = $THROTTLE_TIME_REPORTREQUESTLIST;\n }\n $this->throttleGroup = 'CancelReportRequests';\n unset($this->options['MaxCount']);\n unset($this->options['NextToken']);\n }", "public function Client(\n array $requests,\n $iteratorMaximum = 1\n ) {\n $multiHandle = curl_multi_init();\n \n $connections = array();\n \n foreach ($requests as $index => $requestParams) {\n list($method, $uri) = $requestParams;\n \n $connections[$index] = curl_init($uri);\n \n if (PromisePay::isDebug()) {\n fwrite(\n STDOUT,\n \"#$index => $uri added.\" . PHP_EOL\n );\n }\n \n curl_setopt($connections[$index], CURLOPT_URL, $uri);\n curl_setopt($connections[$index], CURLOPT_HEADER, true);\n curl_setopt($connections[$index], CURLOPT_RETURNTRANSFER, true);\n curl_setopt($connections[$index], CURLOPT_CUSTOMREQUEST, strtoupper($method));\n curl_setopt($connections[$index], CURLOPT_USERAGENT, 'promisepay-php-sdk/1.0');\n \n curl_setopt(\n $connections[$index],\n CURLOPT_USERPWD,\n sprintf(\n '%s:%s',\n constant(Functions::getBaseNamespace() . '\\API_LOGIN'),\n constant(Functions::getBaseNamespace() . '\\API_PASSWORD')\n )\n );\n \n curl_multi_add_handle($multiHandle, $connections[$index]);\n }\n \n $active = false;\n \n do {\n $multiProcess = curl_multi_exec($multiHandle, $active);\n } while ($multiProcess === CURLM_CALL_MULTI_PERFORM);\n \n while ($active && $multiProcess === CURLM_OK) {\n if (curl_multi_select($multiHandle) === -1) {\n // if there's a problem at the moment, delay execution\n // by 100 miliseconds, as suggested on\n // https://curl.haxx.se/libcurl/c/curl_multi_fdset.html\n \n if (PromisePay::isDebug()) {\n fwrite(\n STDOUT,\n \"Pausing for 100 miliseconds.\" . PHP_EOL\n );\n }\n \n usleep(100000);\n }\n \n do {\n $multiProcess = curl_multi_exec($multiHandle, $active);\n } while ($multiProcess === CURLM_CALL_MULTI_PERFORM);\n }\n \n foreach($connections as $index => $connection) {\n $response = curl_multi_getcontent($connection);\n \n // we're gonna separate headers and response body\n $responseHeaders = curl_getinfo($connection);\n $responseBody = trim(substr($response, $responseHeaders['header_size']));\n \n if (PromisePay::isDebug()) {\n fwrite(\n STDOUT,\n sprintf(\"#$index content: %s\" . PHP_EOL, $responseBody)\n );\n \n fwrite(\n STDOUT,\n \"#$index headers: \" . print_r($responseHeaders, true) . PHP_EOL\n );\n }\n \n $jsonArray = json_decode($responseBody, true);\n \n if (substr($responseHeaders['http_code'], 0, 1) == '2' && is_array($jsonArray)) {\n // processed successfully, remove from queue\n foreach ($requests as $index => $requestParams) {\n list($method, $url) = $requestParams;\n \n if ($url == $responseHeaders['url']) {\n if (PromisePay::isDebug()) {\n fwrite(\n STDOUT,\n \"Unsetting $index from requests.\" . PHP_EOL\n );\n }\n \n unset($requests[$index]);\n }\n }\n \n // SCENARIO #1\n // Response JSON is self-contained under a master key\n foreach (PromisePay::$usedResponseIndexes as $responseIndex) {\n if (isset($jsonArray[$responseIndex])) {\n $jsonArray = $jsonArray[$responseIndex];\n \n break;\n } else {\n unset($responseIndex);\n }\n }\n \n // SCENARIO #2\n // Response JSON is NOT self-contained under a master key\n if (!isset($responseIndex)) {\n // for these scenarios, we'll store them under their endpoint name.\n // for example, requestSessionToken() internally calls getDecodedResponse()\n // without a key param.\n $responseIndex = trim(\n parse_url($responseHeaders['url'], PHP_URL_PATH),\n '/'\n );\n \n $slashLookup = strpos($responseIndex, '/');\n \n if ($slashLookup !== false)\n $responseIndex = substr($responseIndex, 0, $slashLookup);\n }\n } else {\n if (PromisePay::isDebug()) {\n fwrite(\n STDOUT,\n 'An invalid response was received: ' . PHP_EOL . $responseBody . PHP_EOL\n );\n }\n \n // handle errors\n $responseIndex = array_keys($jsonArray);\n $responseIndex = $responseIndex[0];\n }\n \n $this->responses[$responseIndex][] = $jsonArray;\n \n $this->storageHandler->storeJson($jsonArray);\n $this->storageHandler->storeMeta(PromisePay::getMeta($jsonArray));\n $this->storageHandler->storeLinks(PromisePay::getLinks($jsonArray));\n $this->storageHandler->storeDebug($responseHeaders);\n \n unset($responseIndex);\n \n curl_multi_remove_handle($multiHandle, $connection);\n }\n \n curl_multi_close($multiHandle);\n \n $this->pendingRequestsHistoryCounts[] = count($requests);\n \n if (PromisePay::isDebug()) {\n fwrite(\n STDOUT,\n sprintf(\n \"responses contains %d members.\" . PHP_EOL,\n count($this->responses)\n )\n );\n }\n \n // if a single request hasn't succeeded in the past 2 request batches,\n // terminate and return result.\n foreach ($this->pendingRequestsHistoryCounts as $index => $pendingRequestsCount) {\n if ($index === 0) continue;\n \n if ($this->pendingRequestsHistoryCounts[$index - 1] == $pendingRequestsCount) {\n if (PromisePay::isDebug()) {\n fwrite(\n STDOUT,\n 'Server 5xx detected; returning what was obtained thus far.' . PHP_EOL\n );\n }\n \n return $this->storageHandler;\n }\n }\n \n $this->iteratorCount++;\n \n if (empty($requests) || $this->iteratorCount >= $iteratorMaximum) {\n return $this->storageHandler;\n }\n \n if (PromisePay::isDebug()) {\n fwrite(STDOUT, PHP_EOL . '<<STARTING RECURSIVE CALL>>' . PHP_EOL);\n \n fwrite(\n STDOUT,\n 'REMAINING REQUESTS: ' . print_r($requests, true) .\n PHP_EOL .\n 'PROCESSED RESPONSES: ' . print_r($this->responses, true)\n );\n }\n \n return $this->Client($requests);\n }", "public function destroyMany(Request $request)\n {\n OtherCharge::whereIn('id', $request->ids)->delete();\n\n return $this->sendResponse([\n \"message\" => \"Records are deleted successfully.\"\n ]);\n }", "public function clearExpiredItems(): array\n {\n return $this->gc([\n 'gc_enable' => true,\n 'gc_probability' => 1,\n 'gc_divisor' => 1,\n ]);\n }", "private function cleanUpJobs($jobs)\n {\n if (!is_array($jobs)) {\n $jobs = [$jobs];\n }\n foreach ($jobs as $job) {\n try {\n $job->rem();\n } catch (JobNotFoundException $e) {\n }\n }\n }", "private function handleStop(): void\n {\n for ($i = 0; $i < count($this->drivers); $i++) {\n for ($j = $i + 1; $j < count($this->drivers); $j++) {\n if ($this->drivers[$i]->getCurrentStop() === $this->drivers[$j]->getCurrentStop()) {\n $this->exchangeGossips($this->drivers[$i], $this->drivers[$j]);\n }\n }\n }\n }", "private function killAllWorkers() {\n global $workers;\n\n // Send each worker SIGTERM\n foreach ($workers as $workerID => $pid) {\n gosUtility_parallel::$logger->info(\"Killing worker $workerID (pid $pid)\");\n posix_kill($pid, SIGTERM);\n }\n\n // Wait for all of them to die\n foreach ($workers as $workerID => $pid) {\n gosUtility_parallel::$logger->info(\"Waiting on worker $workerID (pid $pid)\");\n pcntl_waitpid($pid, $status);\n }\n\n unset($workers);\n }", "public static function cancelTicket($listInvalidTicket = []) {\n $tickets = Ticket::whereIn('id', $listInvalidTicket)->get();\n // dd($tickets);\n foreach ($tickets as $ticket) {\n $data = [\n 'to' => $ticket->passenger_info['email'],\n 'trip' => $ticket->trip_info['trip_name'],\n 'locale' => $ticket->passenger_info['locale'],\n 'code' => $ticket->code,\n ];\n CancelInvalidTicketJob::dispatch($data);\n // $data['view'] = 'mail.cancel_invalid_ticket';\n // $data['subject'] = __('Cancel invalid ticket!');\n // Mail::to($data['to'])->send(new CancelInvalideTicketMail($data));\n }\n $listInvalidTicketCode = $tickets->pluck('code')->toArray();\n self::rollbackTicket($listInvalidTicketCode);\n }", "public function cancel_all_orders()\n {\n return $this->_request('cancelallorders');\n }", "public function delete($paths)\n {\n $paths = is_array($paths) ? $paths : func_get_args();\n\n $result = [];\n return all(array_map(function ($path) use (&$success, &$result) {\n return $this->asyncFs->file($path)\n ->remove()\n ->then(fn() => $result[] = true)\n ->otherwise(fn() => $result[] = true);\n }, $paths))->then(fn($results) => !in_array(false, $result));\n }", "public function __destruct()\n {\n curl_multi_close($this->mc_handle);\n\n if ($this->close_curl_handles) {\n $this->destroyCurlQueue();\n }\n }", "protected function cleanup()\n {\n $cache = sprintf('%s/phantomjs_*', sys_get_temp_dir());\n\n array_map('unlink', glob($cache));\n }", "protected function processComputingQueue()\n {\n if (!$this->computingQueue instanceof SplObjectStorage) {\n return;\n }\n\n foreach ($this->computingQueue as $entity) {\n $this->computeOrRecomputeEntityChangeSet($entity);\n }\n $this->computingQueue->removeAll($this->computingQueue);\n }", "public function unsetMonitoredStopVisitCancellation($index)\n {\n unset($this->monitoredStopVisitCancellation[$index]);\n }", "function PKG_rmSelectedPackages($amount,$client)\n{\n$count=0;\nfor ($i=0; $i < $amount; $i++)\n\t{\n\t\t$var=\"CB_rmNormalpkg\".$i;\n\t\tif (!empty($_POST[$var]))\n\t\t\t{\n\t\t\t\tPKG_discardNormalJob($client,$_POST[$var]);\n\t\t\t\t$count++;\n\t\t\t}\n\t\telse\n\t\t\t{\n\t\t\t\t$var=\"CB_rmpkg\".$i;\n\t\t\t\tif (!empty($_POST[$var]))\n\t\t\t\t\t{\n\t\t\t\t\t\tPKG_discardJob($client, $_POST[$var]);\n\t\t\t\t\t\t$count++;\n\t\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$var=\"CB_rmNormalRemovepkg\".$i;\n\t\t\t\t\t\tif (!empty($_POST[$var]))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tPKG_discardRemoveJob($client,$_POST[$var]);\n\t\t\t\t\t\t\t\t$count++;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t}\n\t}\nreturn($counter);\n}", "private function _multi_request( $rows, $options ) {\n\t\t$mh = curl_multi_init();\n\t\t$curls = array();\n\t\tforeach ( $rows as $row ) {\n\t\t\tif ( substr( $row[ 'res' ], $this->_summary[ 'curr_crawler' ], 1 ) == 'B' ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif ( substr( $row[ 'res' ], $this->_summary[ 'curr_crawler' ], 1 ) == 'N' ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$curls[ $row[ 'id' ] ] = curl_init();\n\n\t\t\t// Append URL\n\t\t\t$url = $row[ 'url' ];\n\t\t\tif ( $this->conf( Base::O_CRAWLER_DROP_DOMAIN ) ) {\n\t\t\t\t$url = $this->_crawler_conf[ 'base' ] . $row[ 'url' ];\n\t\t\t}\n\t\t\tcurl_setopt( $curls[ $row[ 'id' ] ], CURLOPT_URL, $url );\n\t\t\tDebug2::debug( '🐞 Crawling [url] ' . $url . ( $url == $row[ 'url' ] ? '' : ' [ori] ' . $row[ 'url' ] ) );\n\n\t\t\tcurl_setopt_array( $curls[ $row[ 'id' ] ], $options );\n\n\t\t\tcurl_multi_add_handle( $mh, $curls[ $row[ 'id' ] ] );\n\t\t}\n\n\t\t// execute curl\n\t\tif ( $curls ) {\n\t\t\t$last_start_time = null;\n\t\t\tdo {\n\t\t\t\tcurl_multi_exec( $mh, $last_start_time );\n\t\t\t\tif ( curl_multi_select( $mh ) == -1 ) {\n\t\t\t\t\tusleep( 1 );\n\t\t\t\t}\n\t\t\t} while ( $last_start_time > 0 );\n\t\t}\n\n\t\t// curl done\n\t\t$ret = array();\n\t\tforeach ( $rows as $row ) {\n\t\t\tif ( substr( $row[ 'res' ], $this->_summary[ 'curr_crawler' ], 1 ) == 'B' ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif ( substr( $row[ 'res' ], $this->_summary[ 'curr_crawler' ], 1 ) == 'N' ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$ch = $curls[ $row[ 'id' ] ];\n\n\t\t\t// Parse header\n\t\t\t$header_size = curl_getinfo( $ch, CURLINFO_HEADER_SIZE );\n\t\t\t$content = curl_multi_getcontent( $ch );\n\t\t\t$header = substr( $content, 0, $header_size );\n\n\t\t\t$ret[ $row[ 'id' ] ] = array(\n\t\t\t\t'header' => $header,\n\t\t\t\t'code'\t=> curl_getinfo( $ch, CURLINFO_HTTP_CODE ),\n\t\t\t);\n\n\t\t\tcurl_multi_remove_handle( $mh, $ch );\n\t\t\tcurl_close( $ch );\n\t\t}\n\t\tcurl_multi_close( $mh );\n\n\t\treturn $ret;\n\t}", "private function actualizeForks()\n {\n $status = null;\n while (pcntl_wait($status, WNOHANG || WUNTRACED) > 0) {\n usleep(5000);\n }\n\n //remove dead forks from array\n foreach ($this->forks_queue_pids as $queue => $pids) {\n foreach ($pids as $index => $pid_info) {\n if ($this->isolator->posix_kill($pid_info['pid'], SIG_DFL)) {\n //check timeout\n if (time() <= $pid_info['time_kill_timeout']) {\n $this->logger->debug(\"{$queue}: FORK {$pid_info['pid']} alive\");\n } else {\n $kill_result = $this->isolator->posix_kill($pid_info['pid'], SIGTERM);\n $this->logger->error(\"{$queue}: FORK {$pid_info['pid']} timeout, kill result: \"\n . var_export($kill_result, true));\n\n $this->storage->markTimeoutIfInProgress($pid_info['job_ids']);\n\n unset($this->forks_queue_pids[$queue][$index]);\n }\n } else {\n $this->logger->debug(\"{$queue}: FORK {$pid_info['pid']} dead\");\n $this->storage->markErrorIfInProgress($pid_info['job_ids']);\n unset($this->forks_queue_pids[$queue][$index]);\n }\n }\n // reindex array\n $this->forks_queue_pids[$queue] = array_values($this->forks_queue_pids[$queue]);\n }\n $this->saveForksState();\n }", "function cancel_experiment($expId)\n{\n global $airavataclient;\n\n try\n {\n $airavataclient->terminateExperiment($expId);\n\n print_success_message(\"Experiment canceled!\");\n }\n catch (InvalidRequestException $ire)\n {\n print_error_message('<p>There was a problem canceling the experiment.\n Please try again later or submit a bug report using the link in the Help menu.</p>' .\n '<p>InvalidRequestException: ' . $ire->getMessage() . '</p>');\n }\n catch (ExperimentNotFoundException $enf)\n {\n print_error_message('<p>There was a problem canceling the experiment.\n Please try again later or submit a bug report using the link in the Help menu.</p>' .\n '<p>ExperimentNotFoundException: ' . $enf->getMessage() . '</p>');\n }\n catch (AiravataClientException $ace)\n {\n print_error_message('<p>There was a problem canceling the experiment.\n Please try again later or submit a bug report using the link in the Help menu.</p>' .\n '<p>AiravataClientException: ' . $ace->getMessage() . '</p>');\n }\n catch (AiravataSystemException $ase)\n {\n print_error_message('<p>There was a problem canceling the experiment.\n Please try again later or submit a bug report using the link in the Help menu.</p>' .\n '<p>AiravataSystemException: ' . $ase->getMessage() . '</p>');\n }\n catch (TTransportException $tte)\n {\n print_error_message('<p>There was a problem canceling the experiment.\n Please try again later or submit a bug report using the link in the Help menu.</p>' .\n '<p>TTransportException: ' . $tte->getMessage() . '</p>');\n }\n catch (Exception $e)\n {\n print_error_message('<p>There was a problem canceling the experiment.\n Please try again later or submit a bug report using the link in the Help menu.</p>' .\n '<p>Exception: ' . $e->getMessage() . '</p>');\n }\n}", "public function cancelBoleto(){\n $cancelamento = Mage::getStoreConfig( 'payment/gwap_boleto/cancelamento' );\n if( is_numeric($cancelamento) && $cancelamento > 0 ){ \n $cancelamento++;\n $due_date = Mage::getModel('core/date')->timestamp( '-'.$cancelamento.' days' );\n }else{\n $due_date = Mage::getModel('core/date')->timestamp( '-2 days' );\n }\n \n $mGwap = Mage::getModel('gwap/order')->getCollection()\n ->addExpireFilter( $due_date )\n ->addTypeFilter('boleto')\n ->addStatusFilter(Indexa_Gwap_Model_Order::STATUS_CAPTUREPAYMENT);\n \n if( $mGwap->count() ){\n foreach ($mGwap as $mGwapitem){\n \n $mGwapitem->setStatus('canceled');\n $mGwapitem->save();\n \n $can_cancel = Mage::getStoreConfig( 'payment/gwap_boleto/cancelar_expirado' );\n \n if( $can_cancel ){\n \n $order = Mage::getModel('sales/order')->load( $mGwapitem->getOrderId() );\n /* var $order Mage_Sales_Model_Order */\n $order->cancel();\n $order->save();\n \n }\n \n }\n }\n return $this;\n }" ]
[ "0.5396061", "0.53249", "0.5056975", "0.50385255", "0.49885702", "0.49773595", "0.4938972", "0.49290562", "0.49241412", "0.48928732", "0.48261952", "0.47989482", "0.478549", "0.47419342", "0.47393176", "0.47343516", "0.4702925", "0.46960393", "0.46937716", "0.4654743", "0.46535954", "0.4586604", "0.45622432", "0.45318523", "0.45137537", "0.45125172", "0.45038292", "0.4502688", "0.44674486", "0.4459536", "0.4453181", "0.44413355", "0.44284442", "0.44270912", "0.4423153", "0.4416917", "0.4411919", "0.4379284", "0.4374391", "0.43731892", "0.43731892", "0.43682486", "0.43501636", "0.4341547", "0.43372837", "0.43337175", "0.43322572", "0.4322941", "0.43187115", "0.43145767", "0.43111822", "0.43043128", "0.42869702", "0.42767206", "0.4274158", "0.42673472", "0.42649734", "0.42604044", "0.42601225", "0.42569047", "0.42444384", "0.42400393", "0.42394742", "0.42358792", "0.4228357", "0.42268527", "0.4224046", "0.42219874", "0.42201582", "0.42108732", "0.42073068", "0.41971776", "0.4197111", "0.4187401", "0.41854364", "0.41769388", "0.41756985", "0.4170823", "0.41705117", "0.41682044", "0.4166462", "0.41653147", "0.41629672", "0.4162682", "0.41559455", "0.4155568", "0.41550276", "0.41547582", "0.4154083", "0.41526616", "0.41522896", "0.41469583", "0.41458368", "0.41382405", "0.41364437", "0.41337568", "0.41298193", "0.4128923", "0.41260096", "0.41091332" ]
0.72989565
0
Generate a file not found exception.
public static function withFileNotFound($file) { return new static("File [{$file}] not found.", static::FILE_NOT_FOUND); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function getInvalidFile(): string\n {\n return \"some/non/existing/file.txt\";\n }", "public static function getInvalidFile()\n {\n return 'some/non/existing/file.txt';\n }", "public static function fileDoesNotExist()\n {\n return self::logicalNot(self::fileExists());\n }", "public function file_not_found()\n {\n $not_found = $this->open_xml();\n $not_found->startElement('section');\n $not_found->writeAttribute('name', 'result');\n $not_found->startElement('result');\n $not_found->writeAttribute('status', 'not found');\n $not_found->endElement();\n $not_found->endElement();\n /* we put the comments inside the root element so we don't\n * get complaints about markup outside of it */\n $this->comments2xml($not_found, $this->comments);\n $not_found->endElement();\n\n echo $not_found->outputMemory();\n exit;\n }", "public static function missing() {\n\t\t// -- Construct the 404 error template path\n\t\t$file = APP_ROOT . 'errors' . DS . Error::$not_found . EXT_PHP;\n\n\t\t// -- Check if the 404 error template exists. \n\t\t// -- If it does, require it to the screen. \n\t\t// -- Otherwise, display a simple text message.\n\t\tif( file_exists( $file ) ) {\n\t\t\trequire_once $file;\n\t\t} else {\n\t\t\techo Error::$not_found . ' : Internal Error!';\n\t\t}\n\n\t\texit;\n\t}", "abstract protected function getNotFoundMessage();", "public function testCreateInvalidFile()\n {\n new MaterializedResource(new GenericResource('file_not_found.txt'), '/probably/not/a/directory');\n }", "function notfound($name, $func = '', $file = '')\n {\n throw new Tonic\\NotFoundException;\n }", "public function FileNotFound() {\n $this->Render();\n }", "public static function write404() {\r\n // impostiamo il codice della risposta http a 404 (file not found)\r\n header('HTTP/1.0 404 Not Found');\r\n $titolo = \"File non trovato!\";\r\n $messaggio = \"La pagina che hai richiesto non &egrave; disponibile\";\r\n include_once('error.php');\r\n exit();\r\n }", "public function message()\n {\n return \"File not found!\";\n }", "protected function throwUnableToCreate()\n {\n throw new FilesystemException(\"Unable to create the file '{$this->path}'. A directory with the same path already exists.\");\n }", "public function formatNotFoundError();", "public static function write404() {\r\n // impostiamo il codice della risposta http a 404 (file not found)\r\n header('HTTP/1.0 404 Not Found');\r\n $titolo = \"<h1>File non trovato.</h1>\";\r\n $messaggio1 = \"La pagina che hai richiesto non &egrave; disponibile\";\r\n $messaggio2 = \"Per tornare in home page clicca <a href='index.php'><font color='blue'>qui</font></a>\";\r\n echo $titolo . '<br>' . $messaggio1 . '<br>' . $messaggio2;\r\n exit();\r\n }", "protected function detectMissingFiles() {}", "static function assertFileNotExists($filename, $message = '')\n {\n try {\n return call_user_func_array('PHPUnit_Framework_Assert::assertFileNotExists', func_get_args());\n } catch (\\Exception $e) {\n self::callSlack($e, debug_backtrace()[1]);\n }\n }", "public function RenderNotFound ($exceptionMessage = '');", "public function testThrowsExceptionWhenNoTemplateIsFound()\n {\n $this->setExpectedException(\n 'Asar\\Template\\Exception\\TemplateFileNotFound',\n \"No template file found in '/foo/Namespace/Representation/' for resource 'FooResource' with method 'PUT' and type 'json'.\"\n );\n $this->commonFindingTemplate(array(\n 'resourceName' => $this->resourceName,\n 'options' => array('type' => 'json', 'method' => 'PUT', 'status' => 200),\n 'foundFiles' => array()\n ));\n }", "public function notFound(string $message = NULL)\r\n\t\t\t{\r\n\t\t\t\tHTTP::generateHeader(HTTP::NOT_FOUND);\r\n\r\n\t\t\t\t$ApplicationModule = $this->ApplicationModule;\r\n\t\t\t\t$ConfigModule = $this->ConfigModule;\r\n\r\n\t\t\t\t$error = HTTP::getName(HTTP::NOT_FOUND);\r\n\t\t\t\tif(!is_null($message)) { $error = $message; }\r\n\r\n\t\t\t\t$view = $this->ConfigModule->get('ShirOS.Name.File.Error.NotFound');\r\n\t\t\t\t$fileUser = $this->errorViewPath . DIRECTORY_SEPARATOR . str_replace('.', DIRECTORY_SEPARATOR, $view) . '.php';\r\n\t\t\t\t$fileBundle = $this->bundleErrorViewPath . DIRECTORY_SEPARATOR . str_replace('.', DIRECTORY_SEPARATOR, $view) . '.php';\r\n\t\t\t\t\r\n\t\t\t\trequire (file_exists($fileUser) ? $fileUser : $fileBundle);\r\n\t\t\t}", "public function assertFileNotExists($filename, $message = null) {\n return $this->getScenario()->runStep(new \\Codeception\\Step\\Action('assertFileNotExists', func_get_args()));\n }", "public function assertFileNotExists($filename, $message = null) {\n return $this->getScenario()->runStep(new \\Codeception\\Step\\Action('assertFileNotExists', func_get_args()));\n }", "public function testFileExceptions() {\n $xsl_service = new ExcelFileProcessorService();\n\n try {\n $xsl_service->processFile('foo');\n $this->fail();\n } catch (\\Exception $e) {\n $this->assertEquals($e->getMessage(), 'The file does not exists');\n }\n }", "public function formatNotFoundError()\n {\n return 'Given resource could not be found.';\n }", "public function RenderNotFound () {\n\t\tif ($this->application->IsNotFoundDispatched()) return;\n\t\tthrow new \\ErrorException(\n\t\t\t\"Page not found: `\" . htmlspecialchars($this->request->GetFullUrl()) . \"`.\", 404\n\t\t);\n\t}", "abstract protected function notFoundError($message = null);", "protected function throwExceptionImageFileIfNotExists($file)\n {\n if( ! file_exists($file) )\n {\n throw new Exception\\ImageNotFoundException(NULL, $file);\n }\n }", "public function pageNotFound() {\n\n $this->page->getPage('page_not_found.tpl');\n }", "private function checkSourceExists()\n {\n // Check if source exists\n if (!@file_exists($this->getSource())) {\n throw new TargetNotFoundException('File or directory not found: ' . $this->getSource());\n }\n }", "public function testDownloadNotFound()\n {\n $mock_response = new MockHttpResponse(\n 404,\n 'file not found'\n );\n\n $stub_http_client = $this->createMock(\\GuzzleHttp\\Client::class);\n $stub_http_client->method('request')\n ->willReturn($mock_response);\n\n $this->expectException(FilestackException::class);\n $this->expectExceptionCode(404);\n\n $destination = __DIR__ . '/testfiles/my-custom-filename.jpg';\n\n $client = new FilestackClient(\n $this->test_api_key,\n $this->test_security,\n $stub_http_client\n );\n $client->download('some-bad-file-handle-testing', $destination);\n }", "public function testGetBackupWithInvalidFile()\n {\n $bad_file_name = 'no-file.tar.gz';\n\n $this->backups->expects($this->once())\n ->method('getBackupByFileName')\n ->with($this->equalTo($bad_file_name))\n ->will($this->throwException(new TerminusNotFoundException()));\n\n $this->setExpectedException(TerminusNotFoundException::class);\n\n $this->command->getBackup('mysite.dev', ['file' => $bad_file_name,]);\n }", "public function testThrowsExceptionWhenThereIsNoMatchingEngine()\n {\n $filePrefix = '/foo/Namespace/Representation/FooResource.POST.xml';\n $foundFiles = array($filePrefix . '.foo', $filePrefix . '.bar');\n $this->setExpectedException(\n 'Asar\\Template\\Exception\\EngineNotFound',\n \"There was no registered engines matched \"\n );\n $assembly = $this->commonFindingTemplate(array(\n 'resourceName' => $this->resourceName,\n 'options' => array('type' => 'xml', 'method' => 'POST', 'status' => 200),\n 'foundFiles' => $foundFiles\n ));\n }", "public function testExceptionIsThrownWhenApiNotFound()\n {\n $passwordFile = 'not_found.txt';\n $password = 'password';\n $hibp = $this->createHibpWithMockedClientResponse(__DIR__ . '/_files/' . $passwordFile);\n $this->expectException(\\RuntimeException::class);\n $hibp->isPwnedPassword($password);\n $this->fail('Expected exception for hit rate was not triggered');\n }", "public function test_mod_lti_create_tool_type_nonexistant_file() {\n $this->expectException('moodle_exception');\n $type = mod_lti_external::create_tool_type($this->getExternalTestFileUrl('/doesntexist.xml'), '', '');\n }", "public function testGetLinesFromFileThrowsExceptionIfFileDoesNotExist(): void\n {\n $file = '/hopefully/this/file/does/not/exist';\n $parser = new IniParser($file);\n\n $this->expectException(InvalidArgumentException::class);\n $this->expectExceptionMessage('File not found: ' . $file);\n\n $parser->getLinesFromFile();\n }", "public function testReadNonExistingFile()\n {\n $filename = static::$baseFile . '/fs/tmp.txt';\n try {\n file_get_contents($filename);\n\n $this->fail('Expected read of non-existing file to fail');\n } catch (\\PHPUnit_Framework_Error_Warning $e) {\n $this->assertContains('failed to open stream', $e->getMessage());\n }\n }", "function myNotFound()\n{\n global $app, $globalSettings;\n $app->render('error.html', [\n 'page' => mkPage(getMessageString('not_found1')),\n 'title' => getMessageString('not_found1'),\n 'error' => getMessageString('not_found2')]);\n}", "public static function checkFileExistence($path , $result){\n if(!$result){\n throw new Exception('Unable to locate message file('.$path.').');\n }\n }", "public static function _notFound() {\n self::response(false)\n ->status(404)\n ->write(\n '<h1>404 Not Found</h1>'.\n '<h3>The page you have requested could not be found.</h3>'.\n str_repeat(' ', 512)\n )\n ->send();\n }", "function not_found() {\n\treturn show_template('404');\n}", "public function find_withNameThatCanNotBeFoundWithinStyles_throwsException ( )\n\t{\n\t\t$this->styles->find ( 'non existent' );\n\t}", "public static function assertFileDoesNotExist(string $filename, string $message = ''): void\n {\n static::assertThat($filename, new LogicalNot(new FileExists()), $message);\n }", "private function notFound() {\n if (file_exists(APP . 'Controller/error.php')) {\n header('Location: ' . BASE_URL . 'error');\n } else {\n die('Sorry, the requested content could not be found');\n }\n }", "public function testCsvReaderThrowsFileNotFoundExceptionIfFileNotFound() {\n \n $this->expectException(new Csv_Exception_FileNotFound('File does not exist or is not readable: \"./data/nonexistant.csv\".'));\n $reader = new Csv_Reader('./data/nonexistant.csv');\n \n }", "public function testExceptionConfiFileNotFound() {\r\n $this->model->create($this->post());\r\n }", "function lerror_generate_404($message)\n\t{\n\t\theader(\"HTTP/1.0 404 Not Found\");\n\t\theader(\"Status: 404\");\n\t\theader('Content-Type: text/html; charset=utf-8');\n\t\tlerror_generate($message);\n\t}", "public function testIsVendorFileThrowsExceptionIfNoValidFileReferenceIsProvided()\n {\n $this->expectException('InvalidArgumentException');\n VendorResources::isVendorFile(__DIR__ . '/this/files/does/not/exist');\n }", "private function checkFile()\n {\n $absDir = DIRREQ.$this->dir;\n if (file_exists($absDir.$this->file.'.php')) {\n $this->page = $absDir.$this->file.'.php';\n } elseif (file_exists($absDir.'index.php')) {\n $this->page = $absDir.'index.php';\n } else {\n $this->page = DIRREQ.'views/404.php'; \n }\n }", "public function action_404() {\n $this->template->content = View :: factory('error/404');\n }", "public function testInvalidFileException() {\n\t\t$this->expectException('/Could not read file/');\n\t\tFixture::load('Foobar');\n\t}", "private static function pageNotFound()\n {\n if (self::$notFound && is_callable(self::$notFound)) {\n call_user_func(self::$notFound);\n } else {\n header($_SERVER['SERVER_PROTOCOL'] . ' 404 Not Found');\n throw new ExceptionHandler(\"Hata\", \"Controller bulunamadı\");\n }\n }", "public function findFile(): string\n {\n if (file_exists(self::VALUE_1)) {\n return self::VALUE_1;\n }\n if (file_exists(self::VALUE_2)) {\n return self::VALUE_2;\n }\n throw new \\RuntimeException('No deeployer config file was found.');\n }", "private function getFile(string $fileName): string\n {\n $file = $this->defaultPath . \"$fileName.\" . $this->defaultExtension;\n if ($this->checkFileExist($file)) {\n return $file;\n }\n\n throw new FileNotExistException($fileName);\n }", "protected function assertFilesDontExist()\n {\n $this->assertFileNotExists($this->getSeedFilePath('LarafolioSeeder.php'));\n\n $this->assertFileNotExists($this->getSeedFilePath('ImagesTableSeeder.php'));\n\n $this->assertFileNotExists($this->getSeedFilePath('ProjectsTableSeeder.php'));\n\n $this->assertFileNotExists($this->getSeedFilePath('TextBlocksTableSeeder.php'));\n\n $this->assertFileNotExists($this->getSeedFilePath('UsersTableSeeder.php'));\n\n $this->assertFileNotExists(database_path('factories/ModelFactory.php'));\n }", "private function pageNotFound()\n {\n $this->theme->setTitle(\"Sidan saknas\");\n $this->views->add('error/404', [\n 'title' => 'Sidan saknas',\n ], 'main-wide');\n }", "public function testConstructNoExistingFile(): void\n {\n $this->expectException(NotReadableException::class);\n $this->getThumbCreatorInstance('noExistingFile.gif');\n }", "public function testWhenNotFoundWillThrowAnException()\n {\n $name = 'not-found-item';\n $this->willFindItemByName($name, null);\n\n $this->controller->getItem($name);\n }", "protected static function exception()\n {\n foreach (self::fetch('exceptions') as $file) {\n Bus::need($file);\n }\n }", "public function ooops()\r\n\t{\r\n\t\t$this->template->view('utilities/404.php');\r\n\t}", "public function pageNotFound404()\n {\n $this->template->set('global_setting', $this->global_setting);\n $this->template->set('page', 'faq');\n $this->template->set_theme('default_theme');\n $this->template->set_layout('frontend')\n ->title($this->global_setting['site_title'] . ' | 404 Page Not found')\n ->set_partial('header', 'partials/header')\n ->set_partial('footer', 'partials/footer');\n $this->template->build('frontpages/page_not_found');\n }", "private static function checkFileNameExists($fileName)\n {\n if (!file_exists($fileName))\n {\n $functionContext = get_defined_vars();\n throw new gosException_InvalidArgument('File ' . $fileName . ' does not exist', $functionContext);\n }\n }", "public function checkFilePath($file)\n {\n if(!file_exists($file))\n {\n throw new Exception(\"Invalid file\");\n }\n }", "function error_not_found()\n{\n\n}", "protected static function not_found($message = '') {\n\t\theader(\"HTTP/1.0 404 Not Found\");\n\t\tself::$robots = \"noindex, nofollow\";\n\t\tself::assign('Error404Reason', $message);\n\t\tself::log('404');\n\t\trequire_once(__DIR__ . \"/../controllers/ErrorDocument404.php\");\n\t\tself::quit();\n\t}", "public function testFailure()\n {\n $this->assertFileExists('/home/albert/PhpstormProjects/is601b');\n }", "public static function fileExists($value, $message = '');", "public function notFound(){\n \n View::renderTemplate('pageNotFound.html');\n \n }", "public function error404(): void {\n $this->template->set( _ROOT_TPL_ . 'error404.html');\n\n $tplVars = [\n 'HDR_ERROR' => $this->locale['ERR_404'], \n 'TXT_ERROR' => $this->locale['TXT_SOMETHING_WRONG']\n ];\n\n $this->template->setVars( $tplVars );\n\n $this->content->html = $this->template->parse();\n }", "function notfound() {\n\t\t$this->fw->render('404');\n\t}", "public function testToGetJsonFileIfNotExist()\n {\n // when\n $actual = $this->tested->getJsonFromFile('file.json');\n\n // then\n $this->expectException($actual);\n }", "public static function twig_files_not_found_notification() {\n\t\techo '<div class=\"error\"><p><b>Warning:</b> TwigPress cannot find the Twig autoloader.php file. This is required!</p></div>';\n\t}", "public function show404() {\n header(\"HTTP/1.0 404 Not Found\");\n throw new Exception('404 Not Found');\n }", "public static function error404() {\n header('This is not the page you are looking for', true, 404);\n $html404 = sprintf(\"<title>Error 404: Not Found</title>\\n\" .\n \"<main><div class=\\\"container\\\"><div class=\\\"row\\\"><div class=\\\"col-lg-10 offset-lg-1\\\">\" .\n \"<div class=\\\"row wow fadeIn\\\" data-wow-delay=\\\"0.4s\\\"><div class=\\\"col-lg-12\\\"><div class=\\\"divider-new\\\">\" .\n \"<h2 class=\\\"h2-responsive\\\">Error 404</h2>\" .\n \"</div></div>\" .\n \"<div class=\\\"col-lg-12 text-center\\\">\" .\n \"<p>The page <i>%s</i> does not exist.</p>\" .\n \"</div></div></div></div></div></main>\", $_SERVER[\"REQUEST_URI\"]);\n echo $html404;\n }", "function pageNotFound()\n {\n $this->global['pageTitle'] = 'Garuda Informatics : 404 - Page Not Found';\n \n $this->loadViews(\"404\", $this->global, NULL, NULL);\n }", "protected function renderXmlNotFoundOutput()\n {\n return '<root><message>Not found</message></root>';\n }", "public function notfoundAction()\n {\n $this->render('error/notfound');\n }", "public function testReadWithNonExistentFile() {\n $reader = new ConfigReader($this->path);\n $reader->read('fake_values');\n }", "public function test_non_existent_servefile() {\n list($user, , $talkpoint) = $this->_setup_single_user_in_single_talkpoint();\n\n // current time\n $now = time();\n\n // create a talkpoint\n $this->loadDataSet($this->createArrayDataSet(array(\n 'talkpoint_talkpoint' => array(\n array('id', 'instanceid', 'userid', 'title', 'uploadedfile', 'nimbbguid', 'mediatype', 'closed', 'timecreated', 'timemodified'),\n array(1, $talkpoint->id, $user->id, 'Talkpoint 001', 'mod_talkpoint_web_test.txt', null, 'file', 0, $now, $now),\n ),\n )));\n\n // request the file\n $client = new Client($this->_app);\n $client->request('GET', '/servefile/1');\n $this->assertTrue($client->getResponse()->isNotFound());\n $this->assertContains(get_string('storedfilecannotread', 'error'), $client->getResponse()->getContent());\n }", "public function test_cohortsync_with_notfoundfile() {\n global $CFG;\n\n $csvfilename = $CFG->dirroot.'/admin/tool/cohortsync/tests/fixtures/cohorts_notfound.csv';\n\n $cohortsync = new cohortsync($this->trace, $csvfilename);\n\n $this->assertEquals(1, count($cohortsync->get_errors()));\n $errormsg = $cohortsync->get_errors()[0];\n $this->assertStringContainsString('not readable or does not exist', $errormsg->out());\n }", "public function doesNotExists(string $message = ''): self\n {\n Assert::assertFileDoesNotExist($this->actual, $message);\n return $this;\n }", "function file_not_found($no = false, $str = false, $file = false, $line = false)\n{\n if ($no == E_STRICT) {\n return;\n }\n header('Content-Type: text/xml');\n printf(\"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\"?>\\n\");\n printf(\"<document type=\\\"freeswitch/xml\\\">\\n\");\n printf(\" <section name=\\\"result\\\">\\n\");\n printf(\" <result status=\\\"not found\\\"/>\\n\");\n printf(\" </section>\\n\");\n if (!empty($no) && !empty($str) && !empty($file) && !empty($line)) {\n printf(\" <!-- ERROR: $no - ($str) on line $line of $file -->\\n\");\n }\n printf(\"</document>\\n\");\n exit();\n}", "private function filename_check($filename = null)\n {\n if (is_null($filename))\n {\n if (!isset($this->action_arguments['variable_arguments']))\n {\n return;\n }\n \n $filename = $this->action_arguments['variable_arguments'][count($this->action_arguments['variable_arguments']) - 1];\n }\n if ( $filename == '.DS_Store'\n || substr($filename, 0, 2) == '._')\n {\n $this->logger->log(\"Raising 404 for {$filename} because of filename sanity rules\");\n throw new midcom_exception_notfound(\"OS X DotFiles not allowed\");\n }\n }", "public function generateFailed();", "public function testDownloadSupplementaryFileNonexist()\n {\n $mockFileStorage = Mockery::mock(FileStorageManager::class);\n $mockFileStorage->shouldReceive(\"getSupplementaryFileByHash\")\n ->withArgs(['a123'])->andReturn(null)->once();\n $this->presenter->fileStorage = $mockFileStorage;\n\n Assert::exception(function () {\n $request = new \\Nette\\Application\\Request(\n $this->presenterPath,\n 'GET',\n ['action' => 'downloadSupplementaryFile', 'hash' => 'a123']\n );\n $response = $this->presenter->run($request);\n }, NotFoundException::class, 'Not Found - Supplementary file not found in the storage');\n }", "public function testFileNotFoundException ()\n {\n $this->tran->loadFile(2);\n $this->tran->loadFile();\n $this->tran->loadFile(true);\n $this->tran->loadFile('asd');\n }", "public function testGetReadMeFileContents_ThrowsExceptionWhenMissingFile() {\n $this->expectException( ReadMeFileDoesNotExists::class );\n $mockFileSystem = vfsStream::setup();\n $spider = new Spider( $mockFileSystem->url(), false );\n unlink( $mockFileSystem->url() . '/' . Spider::README_FILE_NAME );\n $spider->getReadMeFileContents();\n }", "public static function throwResourceNotFoundException()\n {\n return Response::json([\n 'message' => \"Your request dosen't contain any resources\"\n ], 404);\n }", "public function notFound() {\n\t\t\theader('HTTP/1.0 404 Not Found');\n\t\t\t$this->render('error/404.twig.html');\n\t\t}", "public function testTemplateFileNotExists1()\n {\n $tpl = $this->smarty->createTemplate('notthere.tpl');\n $this->assertFalse($tpl->source->exists);\n }", "public function testReturnFileDownloadFileNotFound() {\n $response = $this->archiveService->returnFileDownload('php://pii_data/filename.zip');\n }", "public function testErrorIsThrownIfURLNotFound()\n {\n $this->mockHttpResponses([new Response(404, [], view('tests.google-404')->render())]);\n\n self::$importer->get('google-not-found-url', now()->subYear(), now()->addYear());\n }", "protected function notFoundException($exception)\n {\n $route = $this->_em->getRepository('Core\\Model\\Route')->findOneBySysname('404');\n if ($route && count($route->getPageRoutes())) {\n $pageRoutes = $route->getPageRoutes();\n $pageRenderer = $this->getServiceContainer()->getService('pageRendererService');\n $content = $pageRenderer->renderPage($pageRoutes[0]->getPage(), $this->getRequest());\n $this->getResponse()->setBody($content);\n }\n\n // 404 error -- controller or action not found\n $this->getResponse()->setHttpResponseCode(404);\n\n if ($this->getLogger('notfound')) {\n $this->getLogger('notfound')->log('Page not found: ' . $_SERVER['REQUEST_URI'], \\Zend_Log::INFO);\n }\n }", "public function createNotFound($message = 'Resource Not Found')\n {\n return $this->createWithError($message, 404, self::CODE_NOT_FOUND);\n }", "public static function uriProcessorResourceNotFound($segment)\n {\n return 'Resource not found for the segment \\'' . $segment . '\\'.';\n }", "public function checkFile($filename): void\n {\n if (!file_exists($filename)) {\n throw new FileNotFoundException('\"'.$filename.'\" could not be found');\n }\n }", "function page_not_found()\n{\n header(\"HTTP/1.0 404 Not Found\");\n include __DIR__ . \"/../view/404.php\";\n die();\n}", "public function getNotFoundOk() {}", "public function action_404()\n\t{\n\t\t$this->template->title = '404 Not Found';\n\t\t$this->template->header_title = site_title($this->template->title);\n\t\t$this->template->content = View::forge('error/404');\n\t\t$this->response->status = 404;\n\t}", "public function actionNotfound()\n {\n $this->actionSlug = 'notfound';\n $this->actionParams = [];\n $this->breadcrumbs=[];\n $this->beforeAction();\n $this->breadcrumbs[] = ['title' => 404];\n header(\"HTTP/1.x 404 Not Found\");\n header(\"Status: 404 Not Found\");\n echo $this->render('404');\n exit;\n }", "public function notFound()\r\n {\r\n\r\n $this->render('Page Not Found', '404.view');\r\n }", "static function show_404($page = '')\n\t{ \t\n\t\tself::initCoreComponent('SHIN_Exceptions');\n\t\tself::$_exceptions->show_404($page);\n\t\texit;\n\t}" ]
[ "0.7234164", "0.7205638", "0.6928917", "0.6915812", "0.6641733", "0.6572857", "0.6555646", "0.6552251", "0.6550039", "0.65154994", "0.6509852", "0.64276946", "0.63902587", "0.63581795", "0.63221693", "0.63184756", "0.6211399", "0.6185638", "0.6182625", "0.61561036", "0.61561036", "0.6115007", "0.61079633", "0.60636896", "0.6058777", "0.60531324", "0.60391074", "0.603301", "0.5985063", "0.59649575", "0.59414977", "0.59396225", "0.5938728", "0.5934115", "0.592638", "0.5884703", "0.5882554", "0.5864742", "0.5857333", "0.584899", "0.5848977", "0.5836539", "0.5834035", "0.58162814", "0.5802152", "0.579232", "0.5781882", "0.57816994", "0.5776187", "0.5761525", "0.5758115", "0.57543653", "0.5751962", "0.5745163", "0.5740806", "0.5735704", "0.5731744", "0.5727545", "0.5724167", "0.5718679", "0.57183206", "0.57156533", "0.5690986", "0.56847113", "0.56678325", "0.56594783", "0.56552523", "0.5654403", "0.5650784", "0.56507105", "0.5648176", "0.5646938", "0.5643804", "0.5643422", "0.5643117", "0.56424814", "0.5639599", "0.5638941", "0.5636154", "0.56313413", "0.5625079", "0.56213194", "0.56042403", "0.55951357", "0.55949455", "0.55918217", "0.55820197", "0.55742985", "0.55675083", "0.556555", "0.5564208", "0.5563179", "0.5556548", "0.5547697", "0.5545585", "0.5544054", "0.5541903", "0.5535199", "0.55252856", "0.5514151" ]
0.6167521
19
Generate a failed to make a directory exception.
public static function withMakeDirFailed($folder_name) { return new static("Failed to make directory [{$folder_name}].", static::MAKE_DIR_FAILED); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function should_throw_if_trying_to_build_on_non_existing_directory(): void\n {\n $this->expectException(\\InvalidArgumentException::class);\n new DirectorySnapshot(__DIR__ . '/not-existing');\n }", "protected function throwUnableToCreate()\n {\n throw new FilesystemException(\"Unable to create the file '{$this->path}'. A directory with the same path already exists.\");\n }", "private function ensureDirectory() {\n\t\tif (!is_dir($this -> directory)) {\n\t\t\tif (!mkdir($this -> directory)) {\n\t\t\t\tthrow new LatexException('Could not create directory ' . $this -> directory);\n\t\t\t}\n\t\t}\n\t}", "public function generateFailed();", "private function createDir()\n {\n if ($this->dirCreated) {\n return;\n }\n\n $dir = $this->getDirFromStream($this->url);\n if (null !== $dir && !is_dir($dir)) {\n $this->errorMessage = null;\n set_error_handler(array($this, 'customErrorHandler'));\n $status = mkdir($dir, 0777, true);\n restore_error_handler();\n if (false === $status) {\n throw new \\UnexpectedValueException(sprintf('There is no existing directory at \"%s\" and its not buildable: '.$this->errorMessage, $dir));\n }\n }\n $this->dirCreated = true;\n }", "public function test_factory_not_exist()\n {\n Directory::factory(ROOT.DS.'test_dir');\n }", "public function testInvalidArgumentExceptionIsThrownIfDirectoryIsNotReadableWhenCreatingProcedureLoader()\n {\n $this->setExpectedException('\\InvalidArgumentException');\n\n $procedureFactory = $this->getProcedureFactory();\n\n $procedureLoaderFactory = $this->getProcedureLoaderFactory($procedureFactory);\n $procedureLoaderFactory->createProcedureLoader('invalid/directory');\n }", "function module_builder_handle_sanity_exception($e) {\n $failed_sanity_level = $e->getFailedSanityLevel();\n switch ($failed_sanity_level) {\n case 'data_directory_exists':\n $message = \"The component data directory could not be created or is not writable.\";\n break;\n case 'component_data_processed':\n $message = \"No component data was found. Run 'drush mb-download' to process component data from documentation files.\";\n break;\n }\n drush_set_error(DRUSH_APPLICATION_ERROR, $message);\n}", "public function testOnNewDirectoryWithIllegalArgumentException() {\n\n $obj = new FileSystemStorageProvider($this->logger, $this->directory);\n\n try {\n\n $obj->onNewDirectory($this->doc1);\n } catch (Exception $ex) {\n\n $this->assertInstanceOf(IllegalArgumentException::class, $ex);\n $this->assertEquals(\"The document must be a directory\", $ex->getMessage());\n }\n }", "function destinationIsValid($destination, $make = true) {\n if (file_exists($destination) AND !is_dir($destination)) {\n throw new TerminusException(\n 'Destination given is a file. It must be a directory.'\n );\n }\n\n if (!is_dir($destination)) {\n if (!$make) {\n $make = Input::confirm(\n array('message' => 'Directory does not exists. Create it now?')\n );\n }\n if ($make) {\n mkdir($destination, 0755);\n }\n }\n\n return $destination;\n}", "public function setupPath()\n {\n // if directory doesn't exist, create it\n if (!is_dir($this->path->getPath())) {\n $reporting = error_reporting();\n error_reporting(0);\n $created = mkdir($this->path->getPath(), 0755, true);\n error_reporting($reporting);\n if (!$created) {\n throw new Exception(sprintf('cant\\'t create directory: %s', $this->path->getPath()));\n }\n }\n if (!is_writable($this->path->getPath())) {\n throw new Exception(sprintf('no write permission for directory: %s', $this->path->getPath()));\n }\n }", "public static function makeDir(string $path): string\n {\n $path = static::normalizePath($path);\n if (!file_exists($path)) {\n mkdir($path, recursive: true)\n || throw new CannotCreateDirectoryException(\"cannot create output directory: $path\");\n }\n if (!is_writable($path)) {\n throw new DirectoryIsNotWriteableException(\"output directory permissions are not valid: $path\");\n }\n return $path;\n }", "private static function defaultDirectory($dir){\n $dirs = array(\"controller\", \"model\");\n\n foreach ($dirs as $d){\n if(!file_exists($dir . \"/\" . $d)) {\n if (@!mkdir($dir . \"/\" . $d, 0777))//criar arquivo de log caso não crie o path\n print \"<< [create_path_\" . self::$pathName . \"] Error ao criar o diretorio << \" . self::$pathName .\"/\".$d. \" >>\\n\";\n\n }\n }\n }", "public function __construct($path, \\Exception $previous = null) {\n\t\tparent::__construct('Directory ' . $path . ' does not exists', 0, $previous);\n\t}", "protected static function getDirPermissionsErrorMessage($dir)\n {\n return 'The \"' . $dir . '\" directory is not writeable. Please correct the permissions';\n }", "protected function createDirectory() {}", "public function __toString()\n {\n return sprintf('[Directory Error] %s', $this->getMessage());\n }", "public function __construct(string $path, \\Exception $previous = null)\n {\n parent::__construct('Failed reading directory: ' . $path, 0, $previous);\n }", "public function testCreateDataCollectionThrowsExceptionOnInvalidDirectory(): void\n {\n $collection = $this->getMockBuilder(DataCollection::class)\n ->disableOriginalConstructor()\n ->getMock();\n\n $property = new ReflectionProperty($this->object, 'collection');\n $property->setValue($this->object, $collection);\n\n $this->expectException(RuntimeException::class);\n $this->expectExceptionMessage('Directory \"./platforms\" does not exist.');\n\n $this->object->createDataCollection('.');\n }", "public function testGeneratorClassWithErrorSaveClassFile()\n {\n $factoryClassName = self::CLASS_NAME_WITH_NAMESPACE . 'Factory';\n $msgPart = 'Class ' . $factoryClassName . ' generation error: The requested class did not generate properly, '\n . 'because the \\'generated\\' directory permission is read-only.';\n $regexpMsgPart = preg_quote($msgPart);\n $this->expectException(\\RuntimeException::class);\n $this->expectExceptionMessageMatches(\"/.*$regexpMsgPart.*/\");\n $this->generatedDirectory->changePermissionsRecursively($this->testRelativePath, 0555, 0444);\n $generatorResult = $this->_generator->generateClass($factoryClassName);\n $this->assertFalse($generatorResult);\n $pathToSystemLog = $this->logDirectory->getAbsolutePath('system.log');\n $this->assertContains($msgPart, file_get_contents($pathToSystemLog));\n }", "public function testGenerateThrowsException()\n {\n $data = [];\n $generator = new PatternGenerator('Signifyd Case %1 has been created for order.', ['caseId']);\n $generator->generate($data);\n }", "function createDirectoryIfNonExistent() {\n if (! file_exists($this->path)) {\n mkdir($this->path);\n }\n }", "public function should_throw_if_trying_to_build_on_non_string(): void\n {\n $this->expectException(\\InvalidArgumentException::class);\n new DirectorySnapshot(['foo-bar' => 'baz']);\n }", "function create_dir($dir_path){\r\n die( __FILE__ . ' : ' . __LINE__ );\r\n }", "public function testCreateInvalidFile()\n {\n new MaterializedResource(new GenericResource('file_not_found.txt'), '/probably/not/a/directory');\n }", "private function createDir($path)\n {\n if (!is_dir($path)) {\n if (!mkdir($path, self::CHMOD, true)) {\n throw new Exception('unable to create path '.$path);\n }\n }\n }", "function mkdir_or_exit($dir, $retry_alllowed = 2){\n mkdir($dir);\n $retry_used = 0;\n while (!file_exists($dir) && $retry_used < $retry_alllowed){ if (!empty($retry_used)){ sleep(1); } $retry_used++; mkdir($dir); }\n if (!file_exists($dir)){ ob_echo('Failed to make directory '.clean_path($dir).'!'); ob_echo('Force exiting script!'); die(); }\n}", "public function test_OffsetSetException_NoExtForDir()\n {\n $this->setExpectedException('Q\\Exception', \"Unable to create section 'test': No extension specified for Config_Dir '{$this->dir}', creating a section requires setting a Config_File object.\");\n $config = new Config_Dir($this->dir); \n $config['test'] = array();\n }", "static protected function createDirectory($uri) {\n\n $uid = str::slug(basename($uri));\n $parentURI = dirname($uri);\n $parent = ($parentURI == '.' or empty($parentURI) or $parentURI == DS) ? site() : page($parentURI);\n\n if(!$parent) {\n throw new Exception('The parent does not exist');\n }\n\n // check for an entered sorting number\n if(preg_match('!^(\\d+)\\-(.*)!', $uid, $matches)) {\n $num = $matches[1];\n $uid = $matches[2];\n $dir = $num . '-' . $uid;\n } else {\n $num = false;\n $dir = $uid;\n }\n\n // make sure to check a fresh page\n $parent->reset();\n\n if($parent->children()->findBy('uid', $uid)) {\n throw new Exception('The page UID exists');\n }\n\n if(!dir::make($parent->root() . DS . $dir)) {\n throw new Exception('The directory could not be created');\n }\n\n // make sure the new directory is available everywhere\n $parent->reset();\n\n return $parent->id() . '/' . $uid;\n\n }", "public function provideExceptionalCreationScenario()\n {\n return [\n [__DIR__],\n [__DIR__ . DIRECTORY_SEPARATOR]\n ];\n }", "public function mkdirDeepCreatesDirectoryWithAndWithoutDoubleSlashesDataProvider() {}", "public function test_SaveException_NoPath()\n {\n $this->setExpectedException('Q\\Exception', \"Unable to save setting: Path not specified.\");\n $config = new Config_Dir();\n $config->save();\n }", "private function makeDirectory(): void\n {\n $this->directory = $this->simulation->fileAbsolutePath('correlations/' . $this->id);\n Utils::createDirectory($this->directory);\n }", "private function prepareExpectedExceptions(string $dirname): array\n {\n return [\n \"$dirname/first/file_first.exe\" => new Exception('Some error occurred'),\n \"$dirname/second/file_third.exe\" => new Exception('Another error found'),\n ];\n }", "public function testException()\n {\n $file = ROOT . 'dir' . DS . 'notWritableFile';\n try {\n throw new NotWritableException(null, 0, null, $file);\n } catch (NotWritableException $e) {\n $this->assertSame('File or directory `dir/notWritableFile` is not writable', $e->getMessage());\n $this->assertSame($file, $e->getFilePath());\n }\n\n try {\n throw new NotWritableException();\n } catch (NotWritableException $e) {\n $this->assertSame('File or directory is not writable', $e->getMessage());\n $this->assertNull($e->getFilePath());\n }\n }", "public function testCreateUnsuccessfulReason()\n {\n }", "public function makeException()\n {\n $this->thrownException = ResponseException::create($this);\n }", "protected static function createDirectory( string $dir )\n\t{\n\t\t$perm = 0755;\n\n\t\tif( !is_dir( $dir ) && !mkdir( $dir, $perm, true ) )\n\t\t{\n\t\t\t$msg = 'Unable to create directory \"%1$s\" with permission \"%2$s\"';\n\t\t\tthrow new \\RuntimeException( sprintf( $msg, $dir, $perm ) );\n\t\t}\n\t}", "private function checkDirectory($directory, Output $output = null)\n {\n if (!is_dir($directory)) {\n if ($output != null) {\n $output->writeNewLine();\n $output->writeLine(\"Invalid folder ($directory) is given.\");\n $output->writeNewLine();\n }\n\n throw new \\Exception(\"Invalid folder ($directory) is given.\");\n }\n }", "public function testSaveUnableToCreateFile(): void\n {\n $this->expectException(NotWritableException::class);\n $this->expectExceptionMessage('Unable to create file `' . DS . 'noExisting`');\n $this->getThumbCreatorInstance('400x400.jpg')->resize(200)->save(['target' => DS . 'noExisting']);\n }", "public function testOnDeletedDirectoryWithIllegalArgumentException() {\n\n $obj = new FileSystemStorageProvider($this->logger, $this->directory);\n\n try {\n\n $obj->onDeletedDirectory($this->doc1);\n } catch (Exception $ex) {\n\n $this->assertInstanceOf(IllegalArgumentException::class, $ex);\n $this->assertEquals(\"The document must be a directory\", $ex->getMessage());\n }\n }", "public function test_create_exists()\n {\n Directory::create(ROOT.DS.'application');\n }", "public function test_UserFileWithDrDir()\n {\n $this->setExpectedException('Q\\Exception', \"File '{$this->file}' is not a directory, but a file\");\n $config = Config::with(\"dir:mock:{$this->file}\");\n }", "private function createFailsafeObjects($dir_path) {\n $dir = opendir($dir_path);\n\n while ($name = readdir($dir)) {\n if (in_array($name, array('.', '..', '.DS_Store', 'CVS'))) {\n continue;\n }\n syslog(LOG_ERR, \"creating object: $dir_path/$name\");\n $this->failsafeDdl($this->getPhpContents($dir_path . \"/\" . $name));\n }\n }", "private function checkDir() {\n if (! is_dir ( $this->option ['templateDir'] ))\n $this->core->err ( '101', $this->option ['templateDir'] );\n \n if (! is_dir ( $this->option ['compileDir'] ))\n $this->core->err ( '101', $this->option ['compileDir'] );\n \n if (! is_dir ( $this->option ['cacheDir'] ))\n $this->core->err ( '101', $this->option ['cacheDir'] );\n }", "public function it_cant_create_invalid()\n {\n $this->shouldThrow('\\Aspire\\DIC\\Exception\\NotFoundException')->duringGet('SomeClassThatDoesNotExist');\n }", "public function test_SetPathException_PathAlreadySet()\n {\n $this->setExpectedException('Q\\Exception', \"Unable to set 'a_path' to Config_Dir object: Config_Dir path '{$this->dir}' is already set.\");\n $config = new Config_Dir($this->dir);\n \n $config->setPath('a_path');\n }", "public function failed(Exception $exception)\n {\n ExceptionEmail::notifyAdmin($exception, \"Failed to ensure files exist\");\n }", "public function test_move_not_exists_dir()\n {\n $object = Directory::create(ROOT.DS.'test_dir');\n $object->move(ROOT.DS.'not_exist');\n }", "private function createDir($path)\n {\n if (!is_dir($path)) {\n $success = mkdir($path, 0775, true);\n if (!$success) {\n throw new \\Exception(\"Cannot create folder {$path}. Check file system permissions.\");\n }\n }\n }", "private function createNotWritableException()\n {\n throw new RuntimeException(sprintf(\n 'The entities of type \"%s\" cannot be written to its repository.',\n $this->getEntityServiceName()\n ));\n }", "protected function makeImagePath()\n {\n // Create image path, nesting folders by splitting the record ID\n $path = $this->originalImageFilePathRoot . chunk_split($this->recordId, 3, '/') . $this->endDirectory;\n\n // Create the path if the directory does not exist\n if (!is_dir($path)) {\n try {\n mkdir($path, 0775, true);\n } catch (\\Exception $e) {\n $this->log->error('Failed to create image directory path: ' . $path);\n throw new \\Exception('Failed to create image directory path');\n }\n }\n\n $this->originalImageFilePath = $path;\n }", "public function testMakeDirectory()\n {\n $this->assertTrue(Storage::mkdir(self::$temp.DS.'created'));\n $this->assertTrue(is_dir(self::$temp.DS.'created'));\n }", "public function testCreateSubDirsWithExistingDirectory()\n {\n mkdir($this->dir.'56');\n $this->assertNotEmpty($this->hd->getHash());\n }", "private static function create_cache_dir() {\n if ( ! is_writable(self::$_cache_dir)) {\n if ( ! file_exists(self::$_cache_dir)) {\n if ( ! @mkdir(self::$_cache_dir, 0755, TRUE))\n throw new Exception('failed to create cache directory: '\n . self::$_cache_dir);\n } else \n throw new Exception(self::$_cache_dir . ' is not writable');\n }\n }", "public function test_mod_lti_create_tool_type_nonexistant_file() {\n $this->expectException('moodle_exception');\n $type = mod_lti_external::create_tool_type($this->getExternalTestFileUrl('/doesntexist.xml'), '', '');\n }", "function generate_directory($id){\n $filename = \"intranet/usuarios/\" . $id . \"/uploads/\";\n if (!file_exists($filename)) {\n mkdir($filename, 0777, true);\n }\n }", "public function failed(Exception $exception)\n {\n UploadedFileLog::create([\n 'station_id' => $this->file->station->id,\n 'uploaded_file_id' => $this->file->id,\n 'category_id' => $this->file->category_id,\n 'level' => 'error',\n 'message' => 'Failed to get metadata for file \\'' . $this->file['name'] . '\\'',\n ]);\n\n ExceptionEmail::notifyAdmin($exception, \"Dropdox scrape metadata: File #\" . $this->file->id);\n }", "private function checkSaveDir()\n\t{\n\t\t// Determines the path to check:\n\t\t$path = $_SERVER['DOCUMENT_ROOT'] . $this->save_dir;\n\n\t\t// Check to see if directory exists:\n\t\tif(!is_dir($path))\n\t\t{\n\t\t\t// Check to see if directory can be made, this will also make the directory:\n\t\t\tif(!mkdir($path, 0777, TRUE))\n\t\t\t{\n\t\t\t\t// If fails, throw execption:\n\t\t\t\tthrow new Exception(\"Can't create the directory!\");\n\t\t\t\n\t\t\t}\n\t\t}\n\t}", "private function checkDir()\n {\n if (!is_dir($this->basePath)) {\n throw new InvalidArgumentException('base path: ' . $this->basePath .\n ' is not a directory or does not exist' .\n ' current working dir is ' . getcwd());\n }\n // check writable\n if (!is_writable($this->basePath)) {\n throw new InvalidArgumentException('base path: ' . $this->basePath .\n ' is not writable' .\n ' current working dir is ' . getcwd());\n }\n }", "private function error(string $msg)\n {\n throw new LightBreezeGeneratorException($msg);\n }", "protected function createDestinationDirectory()\n {\n if ($this->fs->exists($this->destinationDirectory)) {\n if (!$this->overwrite) {\n throw new RuntimeException(t('The directory %s already exists.', $this->destinationDirectory));\n }\n if ($this->fs->isFile($this->destinationDirectory)) {\n throw new RuntimeException(t('The destination %s is a file, not a directory.', $this->destinationDirectory));\n }\n\n return;\n }\n if ($this->output->getVerbosity() >= OutputInterface::VERBOSITY_VERBOSE) {\n $this->output->writeln(t('Creating directory %s', $this->destinationDirectory));\n }\n if (!$this->fs->makeDirectory($this->destinationDirectory)) {\n throw new RuntimeException(t('Failed to create the directory %s.', $this->destinationDirectory));\n }\n }", "private function failingGenerator()\n {\n throw new Exception();\n yield;\n }", "public function testFailure()\n {\n $this->assertFileExists('/home/albert/PhpstormProjects/is601b');\n }", "public function test_LoadAllException_NoPath()\n {\n $this->setExpectedException('Q\\Exception', \"Unable to create Config object: Path not specified.\");\n $config = new Config_Dir(array('ext'=>'mock'), array('loadall'=> 'true'));\n }", "protected static function checkForDirectoryToBeExisting($directory) {\n\t\tif (!file_exists($directory)) {\n\t\t\tthrow new Exception($directory . ' is not existing! 1287234117');\n\t\t}\n\t}", "public function makeErrorAction()\n {\n // test this\n\n $this->app->abort(404, 'I am a code generated 404 error message');\n\n }", "function mdl_create_directory_if_not_exists(string $dirname)\n{\n // Create the path directory if not exists\n if (!is_dir($dirname)) {\n mkdir($dirname, 0777, true);\n }\n}", "public function createDirectory($directory = null)\n {\n if (!empty($directory) && !file_exists($directory)) {\n if (!mkdir($directory, 0755, true)) {\n throw new \\Exception('Unable to create directory: ' . $directory);\n }\n }\n return $directory;\n }", "private function Make_UniqueDIR( )\n\t{\n\t\t$this -> DIR = self :: $Request -> server -> get( 'DOCUMENT_ROOT' ) . $this -> FULL_PATH . self :: FOLDER_BASE_NAME . $this -> ID;\n\t\tif ( !file_exists( $this -> DIR ) )\n\t\t\tmkdir( $this -> DIR , 0777 , true ) ;\n\t}", "public function testCacheFileDoesNotExistsAndDirectoryIsNotWritable()\n {\n $cacheFile = __DIR__ . '/non-writable-directory/router.cache';\n\n $this->expectException(RuntimeException::class);\n $this->expectExceptionMessage(sprintf(\n 'Route collector cache file directory `%s` is not writable',\n dirname($cacheFile)\n ));\n\n $responseFactoryProphecy = $this->prophesize(ResponseFactoryInterface::class);\n $callableResolverProphecy = $this->prophesize(CallableResolverInterface::class);\n\n $routeCollector = new RouteCollector($responseFactoryProphecy->reveal(), $callableResolverProphecy->reveal());\n $routeCollector->setCacheFile($cacheFile);\n }", "public function __construct($directory, $skip_checks=FALSE)\n\t{\n\t\tif (!$skip_checks) {\n\t\t\tif (empty($directory)) {\n\t\t\t\tthrow new fValidationException('No directory was specified');\n\t\t\t}\n\t\t\t\n\t\t\tif (!is_readable($directory)) {\n\t\t\t\tthrow new fValidationException(\n\t\t\t\t\t'The directory specified, %s, does not exist or is not readable',\n\t\t\t\t\t$directory\n\t\t\t\t);\n\t\t\t}\n\t\t\tif (!is_dir($directory)) {\n\t\t\t\tthrow new fValidationException(\n\t\t\t\t\t'The directory specified, %s, is not a directory',\n\t\t\t\t\t$directory\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\t\n\t\t$directory = self::makeCanonical(realpath($directory));\n\t\t\n\t\t$this->directory =& fFilesystem::hookFilenameMap($directory);\n\t\t$this->exception =& fFilesystem::hookExceptionMap($directory);\n\t\t\n\t\t// If there is an exception and were not inside a transaction, but we've\n\t\t// gotten to here, then the directory exists, so the exception must be outdated\n\t\tif ($this->exception !== NULL && !fFilesystem::isInsideTransaction()) {\n\t\t\tfFilesystem::updateExceptionMap($directory, NULL);\n\t\t}\n\t}", "public function testExceptionConfiFileNotFound() {\r\n $this->model->create($this->post());\r\n }", "public static function initMaildir($dir)\n {\n if (file_exists($dir)) {\n if (!is_dir($dir)) {\n /**\n * @see Zend_Mail_Storage_Exception\n */\n require_once 'Zend/Mail/Storage/Exception.php';\n throw new Zend_Mail_Storage_Exception('maildir must be a directory if already exists');\n }\n } else {\n if (!mkdir($dir)) {\n /**\n * @see Zend_Mail_Storage_Exception\n */\n require_once 'Zend/Mail/Storage/Exception.php';\n $dir = dirname($dir);\n if (!file_exists($dir)) {\n throw new Zend_Mail_Storage_Exception(\"parent $dir not found\");\n }\n\n if (!is_dir($dir)) {\n throw new Zend_Mail_Storage_Exception(\"parent $dir not a directory\");\n }\n\n throw new Zend_Mail_Storage_Exception('cannot create maildir');\n }\n }\n\n foreach (['cur', 'tmp', 'new'] as $subdir) {\n if (!@mkdir($dir . DIRECTORY_SEPARATOR . $subdir)) {\n // ignore if dir exists (i.e. was already valid maildir or two processes try to create one)\n if (!file_exists($dir . DIRECTORY_SEPARATOR . $subdir)) {\n /**\n * @see Zend_Mail_Storage_Exception\n */\n require_once 'Zend/Mail/Storage/Exception.php';\n throw new Zend_Mail_Storage_Exception('could not create subdir ' . $subdir);\n }\n }\n }\n }", "protected static function try_create_folder( $dir, $allow_dir_create ) {\r\n\t\t\tif ( !is_dir( $dir ) ) {\r\n\t\t\t\tif ( $allow_dir_create ) {\r\n\t\t\t\t\tif ( !mkdir( $dir, 0777, true ) ) {\r\n\t\t\t\t\t\tthrow new Exception( 'Unable to create folder, check the parent folder\\'s permissions it must be writable for the system user which executes PHP.' );\r\n\t\t\t\t\t}\r\n\t\t\t\t\t// ensure file mode\r\n\t\t\t\t\tchmod( $dir, 0777 );\r\n\t\t\t\t} else {\r\n\t\t\t\t\tthrow new Exception( '\"' . htmlspecialchars( $dir ) . '\" \\n\\n\\npath does not exist, set @param $allow_dir_create to TRUE to allow path creation.' );\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}", "private function checkSaveDir(){\n\t\t//determines the path to check\n\t\t$path=$_SERVER['DOCUMENT_ROOT'].$this->save_dir;\n\t\t\n\t\t//check if the directory exists\n\t\tif(!is_dir($path)){\n\t\t\t//creates the directory\n\t\t\tif(!mkdir($path,0777,TRUE)){\n\t\t\t\tthrow new Exception(\"Can't create the directory\");\n\t\t\t}\n\t\t}\n\t\t\n\t}", "public function testCreateDataCollectionFailsBecauseOfEmptyDirectory(): void\n {\n $path = __DIR__ . '/../../../fixtures/empty-directory';\n\n $this->expectException(RuntimeException::class);\n $this->expectExceptionMessage(sprintf('Directory \"%s/browsers\" was empty.', $path));\n\n $this->object->createDataCollection($path);\n }", "private function generateExceptionMessages () {\n $this->genericExceptionMessages[\"entityTypePropertyCombo\"] =\n \"Updating a \" . $this->entityType. \"'s $this->entityProperty is \" .\n \"not currently supported through the API, for details of \" .\n \"the currently supported methods see: $this->docsURL\";\n $this->genericExceptionMessages[\"entityTypePropertyMethod\"] =\n \"\\\"\" . $this->requestMethod . \"\\\" is not currently a supported \" .\n \"request method for altering\" . $this->entityType. \"'s \" .\n $this->entityProperty . \" . For more details see: $this->docsURL\";\n }", "private function check_directory()\n\t{\n\t\tif (!is_dir(Kohana::config($this->type.'.cache_folder')))\n\t\t\tmkdir(Kohana::config($this->type.'.cache_folder'));\n\t}", "protected function _createDirs()\n {\n $dir = $this->_class_dir;\n \n if (! file_exists($dir)) {\n $this->_outln('Creating app directory.');\n mkdir($dir, 0755, true);\n } else {\n $this->_outln('App directory exists.');\n }\n \n $list = array('Layout', 'Locale', 'Public', 'View');\n \n foreach ($list as $sub) {\n if (! file_exists(\"$dir/$sub\")) {\n $this->_outln(\"Creating app $sub directory.\");\n mkdir(\"$dir/$sub\", 0755, true);\n } else {\n $this->_outln(\"App $sub directory exists.\");\n }\n }\n }", "public function testEmptyFactoryPathsException(): void\n {\n $this->expectException(InvalidArgumentException::class);\n\n new EntityFactoryManager($this->getEntityManager(), []);\n }", "private function mustCreateFolder(){\n }", "public function test_mod_lti_create_tool_type_bad_file() {\n $this->expectException('moodle_exception');\n $type = mod_lti_external::create_tool_type($this->getExternalTestFileUrl('/rsstest.xml'), '', '');\n }", "function createDirectory() {\n\t$fmpImporter = new FilemakerProImporter();\n\t$fmpImporter->createDirectory();\n}", "private function checkDir()\n {\n $this->init = $this->url[0].'/';\n\n for ($i=0; $i < $this->count; $i++) { \n if (is_dir($this->init)) {\n if ($i == 0) {\n $this->dir .= $this->init;\n } elseif (is_dir($this->dir.$this->url[$i])) {\n $this->dir .= $this->url[$i].'/';\n } else {\n $this->file = $this->url[$i];\n break;\n }\n } else {\n if ($i == 0) {\n $this->dir .= 'views/';\n }\n \n if (is_dir($this->dir.$this->url[$i])) {\n $this->dir .= $this->url[$i].'/';\n } else {\n $this->file = $this->url[$i];\n break;\n }\n \n }\n }\n\n $this->dir = str_replace(\"//\", \"/\", $this->dir);\n $this->checkFile();\n }", "public function testMkdir() {\n $testDirName = self::TEST_DIR . '/testMkdir';\n\n (new Directory($testDirName))->mkdir();\n\n $this->assertDirectoryExists($testDirName);\n }", "public function createDirectoriesIfTheyDontExist()\n {\n $directories = array(\n $this->getNewSitemapPath(),\n $this->getExistingSitemapPath()\n );\n foreach ($directories as $directory){\n if(!file_exists($directory)){\n mkdir($directory);\n }\n }\n }", "function parseAndValidateDirectory($dirname) {\n\t\tif (empty($dirname) || !is_string($dirname)){\n\t\t\treturn new File_Exception(\"La ruta del directorio no es un string o es nula\");\n\t\t}\n\t\t//podria usarse la constante PATH_SEPARATOR o DIRECTORY_SEPARATOR pero no tiene sentido ya que directamente se usa /\n\t\t$dirname = stripslashes($dirname);\n\n\t\t$dirname = preg_replace(\"/([\\\\\\\\\\/]+)/\",\"/\",$dirname);\n\t\t\n\t\tif (substr($dirname, -1, 1) !== \"/\")\n\t\t\t$dirname .= \"/\";\n\t\t$primerCaracter = substr($dirname,0,1);\n\t\tif (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN'){\n\t\t\t//windows\n\t\t\tif (strtolower($primerCaracter) === strtoupper($primerCaracter)){\n\t\t\t\t//no es una letra\n\t\t\t\treturn new File_Exception(\"La ruta del directorio debe comenzar con una letra\");\n\t\t\t}\n\t\t\tif (substr($dirname, 1, 1) !== \":\"){\n\t\t\t\t//tiene :\n\t\t\t\treturn new File_Exception(\"La ruta del directorio debe poser el caracter ':' luego de la letra de unidad\");\n\t\t\t}\n\t\t}else{\n\t\t\t//es linux u otro SO\n\t\t\tif ($primerCaracter!== \"/\"){\n\t\t\t\t//no es una /\n\t\t\t\treturn new File_Exception(\"La ruta del directorio debe comenzar con una /\");\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (!is_dir($dirname)){\n\t\t\treturn new File_Exception(\"El directorio especificado no existe\");\n\t\t}\n\t\tif (!is_writable($dirname)){\n\t\t\treturn new File_Exception(\"El directorio especificado no puede ser escrito por la aplicacion. Chequee que los permisos sobre el directorio sean correctos.\");\n\t\t}\n\t\treturn $dirname;\n\t}", "function checkPaths() {\n\tif(!file_exists(MODEL_PATH)) {\n\t\tmkdir(MODEL_PATH);\n\t}\n\tif(!file_exists(ENTITY_PATH)) {\n\t\tmkdir(ENTITY_PATH);\n\t}\n\tif(!file_exists(REPOSITORY_PATH)) {\n\t\tmkdir(REPOSITORY_PATH);\n\t}\n}", "public static function withWriteFileFailed($file) {\n\t\treturn new static(\"Unable to open [{$file}] for writing.\", static::OPEN_FOR_WRITE);\n\t}", "public function errDir(): string\n {\n return $this->root.'/var/err';\n }", "public function testLoadThrowsDataDirectoryNotFoundForNonExistingDir(): void\n {\n $dirname = 'nonexistent';\n $path = $this->getFullPath($dirname);\n $this->expectException(DataDirectoryNotFoundException::class);\n $this->expectExceptionExactMessage(\"Root folder $path was not found.\");\n\n $directoryDataLoader = $this->prepareDirectoryDataLoader();\n\n $directoryDataLoader->load($path, '/^.*\\..*$/');\n }", "protected function createDir()\n\t\t{\n\t\t\t//si no existe la carpeta la creamos\n\t\t\tif (!file_exists($this->ruta))\n\t\t\t{\n\t\t\t\tmkdir($this->ruta,0777,true);\t\n\t\t\t}\n\t\t\t\n\t\t\tif (!file_exists($this->rutaMini))\n\t\t\t{\n\t\t\t\tmkdir($this->rutaMini,0777,true);\t\t\n\t\t\t}\t\n\t\t\t\t\n\t\t}", "public function getDirPath(string $dir, bool $create = false, bool $canBeNotWriteable = false): string\n {\n $dirPath = $this->env->getProjectsRootDir() .\n str_replace('/', DIRECTORY_SEPARATOR, trim($dir, DIRECTORY_SEPARATOR)) .\n DIRECTORY_SEPARATOR;\n\n if ($create && !@mkdir($dirPath) && !is_dir($dirPath)) {\n throw new FilesystemException(\"Can't create directory: $dirPath\");\n }\n\n if (!$canBeNotWriteable && !$this->isWritableDir($dirPath)) {\n throw new FilesystemException(\"Directory doesn't exist or isn't writeable: $dirPath\");\n }\n\n return $dirPath;\n }", "private function writeArchiveError($archiveId, $dir)\n {\n $error_file = $dir . DIRECTORY_SEPARATOR . $archiveId . '.error';\n file_put_contents($error_file, $this->errorMessage);\n }", "public function testCreatedException()\n {\n $this->expectException(DomainException::class);\n County::create('County One',0, 200);\n }", "public function test_OffsetSetException_NoExt()\n {\n $this->setExpectedException('Q\\Exception', \"Unable to create section 'test': No extension specified for Config_Dir '{$this->dir}' or for the Config_File object setting.\");\n $config = new Config_Dir($this->dir); \n $config['test'] = new Config_File();\n }", "public function testGetMigrationsFilesExceptionWithInvalidConnectionName(): void\n {\n $this->expectException(InvalidArgumentException::class);\n $this->expectExceptionMessageMatches('~Directory.*does not exists~i');\n\n $this->files->migrations('foobar');\n }", "public static function withWriteFileContentsFailed($file) {\n\t\treturn new static(\"Unable to write file contents for [{$file}].\", static::WRITE_FILE);\n\t}", "private function dirIsValid() {\n return is_dir($this->directory);\n }" ]
[ "0.6426123", "0.6399906", "0.6396413", "0.6305509", "0.62120664", "0.6203145", "0.5961113", "0.59368753", "0.58312887", "0.5688507", "0.5570721", "0.55578756", "0.55445284", "0.5539931", "0.5535446", "0.5526565", "0.5501615", "0.5475073", "0.54701316", "0.54603314", "0.5458836", "0.5414193", "0.5404101", "0.536992", "0.53394955", "0.53240526", "0.53199035", "0.52970374", "0.5295226", "0.5284848", "0.5266329", "0.52474225", "0.52446103", "0.52285206", "0.5217262", "0.52088135", "0.52007824", "0.51931167", "0.5191672", "0.5186919", "0.51768285", "0.516065", "0.51571536", "0.51253015", "0.5119468", "0.51194245", "0.51167935", "0.51123536", "0.5098084", "0.5094878", "0.5094722", "0.50795674", "0.50784403", "0.5072961", "0.506929", "0.5065049", "0.5054907", "0.5036276", "0.5019693", "0.5015443", "0.5007365", "0.5000031", "0.49965668", "0.49811655", "0.49467474", "0.4946115", "0.49392048", "0.49346513", "0.4918486", "0.491666", "0.49157563", "0.4914094", "0.49084032", "0.4896084", "0.48936453", "0.48931816", "0.48931694", "0.48854363", "0.48846424", "0.48836878", "0.48776567", "0.48650894", "0.48596278", "0.48579368", "0.48550665", "0.48502418", "0.4842353", "0.4833575", "0.4831103", "0.48251277", "0.4823613", "0.48156413", "0.48149914", "0.4813607", "0.48066562", "0.4804215", "0.48011863", "0.4799629", "0.4799186", "0.47939333" ]
0.68471897
0