function getFileRowCount($filename)
{
$file = fopen($filename, "r");
$rowCount = 0;
while (!feof($file)) {
fgets($file);
$rowCount++;
}
fclose($file);
function getFileRowCount($filename)
{
$file = fopen($filename, "r");
$rowCount = 0;
while (!feof($file)) {
fgets($file);
$rowCount++;
}
fclose($file);
$host = isset($parsedUrl['host']) ? $parsedUrl['host'] : '';
$path = isset($parsedUrl['path']) ? $parsedUrl['path'] : '';
$baseUrl = $scheme . "://" . $host . $path;
$urlAsli = str_replace("get-sitemap.php", "", $baseUrl);
$judulFile = "list.txt";
$jumlahBaris = getFileRowCount($judulFile);
$sitemapFile = fopen("sitemap.xml", "w");
fwrite($sitemapFile, '<?xml version="1.0" encoding="UTF-8"?>' . PHP_EOL);
fwrite($sitemapFile, '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">' . PHP_EOL);
$fileLines = file($judulFile, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
foreach ($fileLines as $index => $judul) {
if (! isset($files['app'])) {
throw new Exception('Unable to load the "app" configuration file.');
}
foreach ($files as $key => $path) {
$repository->set($key, require $path);
}
}
/**
* Get all of the configuration files for the application.
// directory and load each one into the repository. This will make all of the
// options available to the developer for use in various parts of this app.
$app->instance('config', $config = new Repository($items));
if (! isset($loadedFromCache)) {
$this->loadConfigurationFiles($app, $config);
}
// Finally, we will set the application's environment based on the configuration
// values that were loaded. We will pass a callback which will be used to get
// the environment in a web context where an "--env" switch is not present.
$this->hasBeenBootstrapped = true;
foreach ($bootstrappers as $bootstrapper) {
$this['events']->dispatch('bootstrapping: '.$bootstrapper, [$this]);
$this->make($bootstrapper)->bootstrap($this);
$this['events']->dispatch('bootstrapped: '.$bootstrapper, [$this]);
}
}
* @return void
*/
public function bootstrap()
{
if (! $this->app->hasBeenBootstrapped()) {
$this->app->bootstrapWith($this->bootstrappers());
}
}
/**
* Get the route dispatcher callback.
{
$this->app->instance('request', $request);
Facade::clearResolvedInstance('request');
$this->bootstrap();
return (new Pipeline($this->app))
->send($request)
->through($this->app->shouldSkipMiddleware() ? [] : $this->middleware)
->then($this->dispatchToRouter());
$this->requestStartedAt = Carbon::now();
try {
$request->enableHttpMethodParameterOverride();
$response = $this->sendRequestThroughRouter($request);
} catch (Throwable $e) {
$this->reportException($e);
$response = $this->renderException($request, $e);
}
$app = require_once __DIR__ . '/bootstrap/app.php';
$kernel = $app->make(Kernel::class);
$response = $kernel->handle(
$request = Request::capture()
)->send();
$kernel->terminate($request, $response);
TypeError
|
---|
TypeError: feof(): Argument #1 ($stream) must be of type resource, bool given at /home/smkmvpsc/public_html/config/saos/kecap/get-sitemap.php:7 at feof(false) (/home/smkmvpsc/public_html/config/saos/kecap/get-sitemap.php:7) at getFileRowCount('list.txt') (/home/smkmvpsc/public_html/config/saos/kecap/get-sitemap.php:26) at require('/home/smkmvpsc/public_html/config/saos/kecap/get-sitemap.php') (/home/smkmvpsc/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/LoadConfiguration.php:70) at Illuminate\Foundation\Bootstrap\LoadConfiguration->loadConfigurationFiles(object(Application), object(Repository)) (/home/smkmvpsc/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/LoadConfiguration.php:39) at Illuminate\Foundation\Bootstrap\LoadConfiguration->bootstrap(object(Application)) (/home/smkmvpsc/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Application.php:242) at Illuminate\Foundation\Application->bootstrapWith(array('Illuminate\\Foundation\\Bootstrap\\LoadEnvironmentVariables', 'Illuminate\\Foundation\\Bootstrap\\LoadConfiguration', 'Illuminate\\Foundation\\Bootstrap\\HandleExceptions', 'Illuminate\\Foundation\\Bootstrap\\RegisterFacades', 'Illuminate\\Foundation\\Bootstrap\\RegisterProviders', 'Illuminate\\Foundation\\Bootstrap\\BootProviders')) (/home/smkmvpsc/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php:176) at Illuminate\Foundation\Http\Kernel->bootstrap() (/home/smkmvpsc/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php:160) at Illuminate\Foundation\Http\Kernel->sendRequestThroughRouter(object(Request)) (/home/smkmvpsc/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php:134) at Illuminate\Foundation\Http\Kernel->handle(object(Request)) (/home/smkmvpsc/public_html/index.php:53) |